n = int(input()) cnt = list(map(int, input().split())) for i in range(8, -1, -1): print(end = str(i + 1) * cnt[i]) print()