N = int(input()) C = list(map(int, input().split())) Answer = "" for i in range(9): Answer += (str(9 - i) * C[8 - i]) print(Answer)