#include <bits/stdc++.h>
using namespace std;
const int N = 301;
int arr[N + 5], flag[550][N + 5][2];
string prv, cur;
void fun2(int a) {
  cur = "";
  int k = (int)ceil(arr[a] / 9.0);
  int l = prv.length();
  if (k <= l) k = l + 1;
  cur.resize(k);
  int f = arr[a];
  for (int i = k - 1; i >= 0; i--) {
    if (f <= 9 && i == 0)
      cur[i] = f + '0';
    else if (f <= 9) {
      if (f > 1)
        cur[i] = f - 1 + '0', f = 1;
      else
        cur[i] = '0';
    } else {
      cur[i] = '9';
      f -= 9;
    }
  }
}
void fun(int a) {
  memset(flag, -1, sizeof flag);
  int l = prv.length();
  if (l != 0) {
    for (int i = prv[l - 1] - '0' + 1; i <= 9; i++) {
      flag[l - 1][i][1] = i;
    }
    for (int i = 0; i < 10; i++) flag[l - 1][i][0] = i;
  }
  int f = 0;
  for (int i = l - 2; i >= 0; i--) {
    for (int j = 0; j < N; j++) {
      if (j - (prv[i] - '0') >= 0) {
        if (flag[i + 1][j - (prv[i] - '0')][1] >= 0)
          flag[i][j][1] = prv[i] - '0';
      }
      if (flag[i][j][1] == -1)
        for (int k = prv[i] - '0' + 1; k <= 9; k++) {
          if (j - k >= 0 && flag[i + 1][j - k][0] >= 0) {
            flag[i][j][1] = k;
            break;
          }
        }
      for (int k = 0; k < 10; k++) {
        if (j - k >= 0 && flag[i + 1][j - k][0] >= 0) {
          flag[i][j][0] = k;
          break;
        }
      }
    }
  }
  int ff = 1;
  if (flag[0][arr[a]][1] == prv[0] - '0')
    f = arr[a];
  else if (flag[0][arr[a]][1] >= 0)
    f = arr[a];
  if (f) {
    for (int i = 0; i < l; i++) {
      cur += (flag[i][f][ff] + '0');
      if (flag[i][f][ff] == prv[i] - '0' && ff == 1) {
        f -= flag[i][f][ff];
      } else
        f -= flag[i][f][ff], ff = 0;
    }
  } else
    fun2(a);
  printf("%s\n", cur.c_str());
  prv = cur;
  cur = "";
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  for (int i = 0; i < n; i++) {
    fun(i);
  }
  return 0;
}
