#include using namespace std; int main() { long n; cin>>n; string res; while (n) { res+=char(n%7+'0'); n/=7; } cout<