#include #include #include using namespace std; int main() { int n, m; cin >> n >> m; vector ans; while (n) { ans.push_back(n % m); n /= m; } reverse(ans.begin(), ans.end()); for (int i : ans) { cout << i; } cout << endl; }