#include using namespace std; using ll = long long; int main(){ int N, c; string S=""; cin >> N; for (int i=1; i<=9; i++){ cin >> c; S += string(c, '0'+i); } reverse(S.begin(), S.end()); cout << S << endl; return 0; }