#include <bits/stdc++.h>
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T>
inline void scand(T &x) {
  char c;
  x = 0;
  while ((c = getchar()) < '0')
    ;
  while (c >= '0' && c <= '9') x = x * 10 + (c - 48), c = getchar();
}
template <class T>
inline void gmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline void gmin(T &a, T b) {
  if (b < a) a = b;
}
using namespace std;
const int N = 1000, M = 0, Z = 1e9 + 7, maxint = 2147483647, ms31 = 522133279,
          ms63 = 1061109567, ms127 = 2139062143;
const double eps = 1e-8, PI = acos(-1.0);
struct A {};
map<int, int> mop;
int casenum, casei;
int n, i, x;
int a[N], b[N], r[N];
bool chance[N];
void tryit(int l, int x) {
  int i, j;
  int rst = x;
  b[0] = l;
  for (i = l; i >= 1; i--) {
    int st = 0;
    if (i == l) st = 1;
    for (j = st; j <= 9 && j <= rst; j++) {
      if ((i - 1) * 9 >= rst - j) {
        b[i] = j;
        rst -= j;
        break;
      }
    }
  }
}
void make(int x) {
  int i, j;
  int l = a[0];
  while (l * 9 < x) l++;
  b[0] = l;
  bool larger = 0;
  if (l > a[0])
    larger = 1;
  else {
    memset(r, 0, sizeof(r));
    r[a[0]] = x;
    for (i = a[0] - 1; i >= 1; i--) r[i] = r[i + 1] - a[i + 1];
  }
  int rst = x;
  for (i = l; i >= 1; i--) {
    bool flag = 0;
    if (larger) {
      int st = 0;
      if (i == l) st = 1;
      for (j = st; j <= 9 && j <= rst; j++) {
        if ((i - 1) * 9 >= rst - j) {
          b[i] = j;
          rst -= j;
          flag = 1;
          break;
        }
      }
    } else {
      memset(chance, 0, sizeof(chance));
      for (int i = 1; i <= a[0]; i++) {
        chance[i] = chance[i - 1] |
                    (a[i] < 9 && a[i] + 1 <= r[i] && (i - 1) * 9 >= r[i] - 9);
      }
      for (j = a[i]; j <= 9 && j <= rst; j++) {
        if ((j > a[i] || chance[i - 1]) && (i - 1) * 9 >= rst - j) {
          b[i] = j;
          rst -= j;
          flag = 1;
          if (j > a[i]) larger = 1;
          break;
        }
      }
    }
    if (!flag) {
      tryit(l + 1, x);
      break;
    }
  }
  memcpy(a, b, sizeof(a));
  for (i = a[0]; i >= 1; i--) printf("%d", a[i]);
  puts("");
}
int main() {
  while (~scanf("%d", &n)) {
    memset(a, 0, sizeof(a));
    a[0] = 1;
    a[1] = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &x);
      make(x);
    }
  }
  return 0;
}
