#include using namespace std; int main(void) { int N; cin >> N; vector c(9); for (int i = 0; i < 9; i++) cin >> c[i]; for (int i = 8; i >= 0; i--) { for (int j = 0; j < c[i]; j++) { cout << i + 1; } } cout << endl; return 0; }