input() cs = [int(x) for x in input().split()] cv = sum([[x] * y for (y, x) in zip(cs, range(1, 10))], []) print(''.join([str(x) for x in sorted(cv, reverse=True)]))