#include <bits/stdc++.h>
using namespace std;
int b[1000], n, r;
int a[1000][1000];
bool chek(int i) {
  if (b[i] > b[i - 1]) {
    int d = b[i] - b[i - 1];
    i--;
    int j = 0, cnt = 0;
    while (a[i][j] != 1001) {
      cnt += a[i][j];
      j++;
    }
    return (j * 9) - cnt <= d;
  } else if (b[i] == b[i - 1]) {
    int j = 1;
    i--;
    while (a[i][j] != 1001) {
      if (a[i][j - 1] < a[i][j]) return true;
      j++;
    }
    return false;
  }
}
void make_num(int i) {
  a[i][0] = 1;
  int t = b[i];
  t -= 1;
  int j = r - 1;
  while (t && j) {
    a[i][j] = min(9, t);
    t -= min(9, t);
    j--;
  }
  for (int h = j; h > 0; h--) a[i][h] = 0;
  a[i][0] += t;
}
void make_min_num(int i) {
  if (b[i] == b[i - 1]) {
    int j = 0;
    while (a[i - 1][j] != 1001) {
      a[i][j] = a[i - 1][j];
      j++;
    }
    int m = j;
    j--;
    while (a[i][j] == 0 && j >= 0) j--;
    if (j <= 0) {
      r++;
      make_num(i);
      return;
    }
    a[i][j] -= 1;
    j--;
    while (j >= 0 && a[i][j] == 9) j--;
    if (a[i][j] == 9 || j < 0) {
      r++;
      make_num(i);
      return;
    }
    a[i][j] += 1;
    sort(a[i] + j + 1, a[i] + m);
    return;
  }
  if (b[i] > b[i - 1]) {
    int d = b[i] - b[i - 1];
    int j = 0;
    while (a[i - 1][j] != 1001) {
      a[i][j] = a[i - 1][j];
      j++;
    }
    j--;
    int t;
    while (d && j >= 0) {
      t = min(d, 9 - a[i][j]);
      a[i][j] += t;
      d -= t;
      j--;
    }
    if (d) {
      r++;
      make_num(i);
      return;
    }
    return;
  }
  int j = 0;
  while (a[i - 1][j] != 1001) {
    a[i][j] = a[i - 1][j];
    j++;
  }
  j--;
  int m = j;
  int d = b[i - 1] - b[i];
  while (d) {
    j = m;
    while (a[i][j] == 0 && j >= 0) j--;
    if (j <= 0) {
      r++;
      make_num(i);
      return;
    }
    a[i][j] -= 1;
    j--;
    while (j >= 0 && a[i][j] == 9) j--;
    if (a[i][j] == 9 || j < 0) {
      r++;
      make_num(i);
      return;
    }
    a[i][j] += 1;
    sort(a[i] + j + 1, a[i] + m + 1);
    int t;
    j++;
    while (d && j <= m) {
      t = min(a[i][j], d);
      a[i][j] -= t;
      d -= t;
      j++;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 1000; i++)
    for (int j = 0; j < 1000; j++) a[i][j] = 1001;
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
  }
  r = b[0] / 9;
  if (b[0] % 9 != 0) r++;
  a[0][0] = b[0] % 9;
  if (b[0] % 9 == 0) a[0][0] = 9;
  for (int i = 1; i < r; i++) a[0][i] = 9;
  int t;
  for (int i = 1; i < n; i++) {
    t = b[i] / 9;
    if (b[i] % 9 != 0) t++;
    if (t > r) {
      r = t;
      make_num(i);
      continue;
    }
    make_min_num(i);
  }
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (a[i][j] != 1001) {
      printf("%d", a[i][j]);
      j++;
    }
    printf("\n");
  }
}
