#!/usr/bin/env python3 import sys def main(): N = int(input()) A = list(map(int, input().split())) ans = "" for i in reversed(range(9)): ans += str(i + 1) * A[i] print(ans) if __name__ == '__main__': main()