#include void change (int n){int i=n%8;if(i){change(n/8);printf("%d",i);}}int main(){int x;scanf("%d",&x);change(x);return 0;}