#include int main (void) { int n; int m; scanf("%d", &n); scanf("%d", &m); if (0 == m) { printf("0\n"); return 0; } short s[200000001];//文字列入力用 int j = 0; while (0 < m) { int i = m % n; s[j] = i; j++; m /= n; } j--; for (; 0 <= j; j--) { printf("%d", s[j]); } printf("\n"); return 0; }