#include <stdio.h>

char buf[65] = {0};
int base;

int main (int x, char **y, char** s){
	return y && scanf("%d %d", &base, &x, printf("Enter base and number: ")) && main(x, 0, buf) && puts(buf)
	? 0 : x && (s = (char*)main(x / base, 0, s)) && (((char*)y)[(int)s] +=  10 > (((char*)y)[(int)s] = x % base) ? '0' : -10 - (-'A'))
	? &1[(char*)s] : (x[(char*)s] = '0', &x[(char*)s + 1]);
}