#include <bits/stdc++.h>
using namespace std;
char dp[350][350][2];
int n;
int a[310];
int b[350][350];
int xx[350];
char func(int here, int ch, int ch1) {
  if (ch < 0) return 0;
  if (here == -1) {
    if (ch == 0 && ch1)
      return 1;
    else
      return 0;
  }
  char &ret = dp[here][ch][ch1];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = 0; i <= 9; i++) {
    if (!ch1 && i < xx[here]) continue;
    if (i > xx[here])
      ret = max(ret, func(here - 1, ch - i, 1));
    else
      ret = max(ret, func(here - 1, ch - i, ch1));
  }
  return ret;
}
void func1(int here, int ch, int ch1, int m) {
  if (here == -1) return;
  char ret = 0;
  for (int i = 0; i <= 9; i++) {
    if (!ch1 && i < xx[here]) continue;
    if (i > xx[here]) ch1 = 1;
    if (func(here - 1, ch - i, ch1)) {
      xx[here] = i;
      b[m][here] = i;
      func1(here - 1, ch - i, ch1, m);
      break;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int idx = 0;
  for (int i = 1; i <= n; i++) {
    memset(dp, -1, sizeof(dp));
    while (!func(idx, a[i], 0)) {
      idx++;
    }
    func1(idx, a[i], 0, i);
  }
  for (int i = 1; i <= n; i++) {
    int update = 0;
    for (int y = 349; y >= 0; y--) {
      if (!update && !b[i][y]) continue;
      update = 1;
      printf("%d", b[i][y]);
    }
    printf("\n");
  }
}
