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