n = io.read("*n") a = {} for i = 1, 9 do a[i] = io.read("*n") end for i = 9, 1, -1 do if 0 < a[i] then io.write(string.rep(tostring(i), a[i])) end end io.write("\n")