#include #include #include #include #include #include using namespace std; using ll = long long; void solve(); int main() { solve(); #ifdef DBG while (true); #endif } //499 void solve() { int n; scanf("%d", &n); vector v; while (n) { v.push_back(n % 7); n /= 7; } while (!v.empty()) { printf("%d", v.back()); v.pop_back(); } printf("\n"); }