#include #define ll long long using namespace std; void solve() { ll n,m; cin>>n>>m; string ans=""; bool ch=true; while(true) { if(m/n==0) { ans.push_back((char)m%n+48); break; } ans.push_back((char)m%n+48); m/=n; } reverse(ans.begin(),ans.end()); cout<< ans << "\n"; } signed main(){ ios_base::sync_with_stdio(false),cin.tie(0); cout.tie(0); solve(); }