import numpy as np def main(): n = int(input()) m = int(input()) print(np.base_repr(m, n)) if __name__ == '__main__': main()