#!/usr/bin/python3.8 input() C=list(map(int,input().split())) ans="" i=9 while C: x=C.pop() ans+=str(i)*x i-=1 print(ans)