#include #include using namespace std; main(){ int N; scanf("%d",&N); string str; while(N!=0){ char c = N%7+'0'; str = c + str; N /= 7; } printf("%s\n",str.c_str()); }