from collections import Counter N, *c = map(int, open(0).read().split()) t = [] for i in range(10): for _ in c[i]: t.append(i + 1) print(''.join(str(i) for i in sorted(t, reverse=True)))