#include <bits/stdc++.h>
using namespace std;
int a[3001], s[3001];
int l(int w, int e) {
  int r;
  if (a[w] >= e) return 0;
  if (w > 1) {
    s[w] = a[w];
    if (l(w - 1, e - a[w])) return 1;
  }
  if (a[w] < 9) {
    s[w] = a[w] + 1;
    e -= s[w];
    if (e <= 9 - s[w] + (w - 1) * 9) {
      for (r = w - 1; r > 0; r--) s[r] = 0;
      for (r = 1; e > 0; r++)
        while ((s[r] < 9) && (e > 0)) {
          s[r]++;
          e--;
        }
      return 1;
    }
  }
  return 0;
}
int main() {
  int q, w, e, r, t;
  for (w = 0; w < 3001; w++) a[w] = 0;
  cin >> q;
  for (w = 0; w < q; w++) {
    cin >> e;
    t = l(3000, e);
    for (r = 3000; s[r] == 0; r--)
      ;
    for (; r; r--) cout << s[r];
    cout << "\n";
    for (e = 0; e < 3001; e++) a[e] = s[e];
  }
  return 0;
}
