n = int(input()) c = list(map(int,input().split())) for i in range(9,-1): if c[i] > 0: ans += str(i) * c[i] print(ans)