n = int(input()) a = list(map(int, input().split())) s = "" for i in range(9, 0, -1): s += str(i) * a[i - 1] print(s)