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