#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
const double eps = (double)1e-9;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 2050;
int n, a[N], ptr[N], sum[N], ans[N][N];
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; a[1]; i++) {
    int mn = min(a[1], 9);
    ans[1][i] = mn;
    a[1] -= mn;
    ptr[1] = i;
  }
  for (int i = 2; i <= n; i++) {
    memset(sum, 0, sizeof(sum));
    for (int j = ptr[i - 1]; j >= 1; j--) sum[j] = sum[j + 1] + ans[i - 1][j];
    bool found = 0;
    for (int j = 1; j <= ptr[i - 1]; j++) {
      for (int c = ans[i - 1][j] + 1; c <= min(9, a[i]); c++) {
        if (sum[j + 1] + c + (j - 1) * 9 >= a[i] &&
            a[i] - c - sum[j + 1] >= 0) {
          for (int k = j + 1; k <= ptr[i - 1]; k++) {
            ans[i][k] = ans[i - 1][k];
            a[i] -= ans[i][k];
          }
          ans[i][j] = c;
          a[i] -= c;
          for (int k = 1; a[i]; k++) {
            int mn = min(9, a[i]);
            ans[i][k] = mn;
            a[i] -= mn;
          }
          ptr[i] = ptr[i - 1];
          found = 1;
          break;
        }
      }
      if (found) break;
    }
    if (!found) {
      for (int j = ptr[i - 1] + 1;; j++) {
        for (int c = 1; c <= 10; c++) {
          if (c + (j - 1) * 9 >= a[i]) {
            ans[i][j] = c;
            a[i] -= c;
            for (int k = 1; a[i]; k++) {
              int mn = min(9, a[i]);
              ans[i][k] = mn;
              a[i] -= mn;
            }
            ptr[i] = j;
            found = 1;
            break;
          }
        }
        if (found) break;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = ptr[i]; j >= 1; j--) cout << ans[i][j];
    cout << endl;
  }
  return 0;
}
