#include #include using namespace std; #define ll long long ll N, M; int main() { cin >> N >> M; string ans = ""; ll k = N; while (M > 0) { ll rem = M % N; ans += char('0'+(rem)); M /= N; } reverse(ans.begin(), ans.end()); cout << ans << endl; }