#include #include using namespace std; int main(){ int n;cin>>n; string r = ""; while(n){ r.push_back('0'+(n%7)); n/=7; } reverse(r.begin(),r.end()); cout << r << endl; }