#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
char digit[N][N];
int len[N];
int b[N];
void setLen(int len, int sum, char* digit, int mi) {
  int beginDigit = max(mi, sum - (len - 1) * 9);
  digit[0] = beginDigit;
  sum -= beginDigit;
  for (int i = len - 1; i > 0; --i) {
    digit[i] = min(9, sum);
    sum -= digit[i];
  }
}
int sum[N];
int dp[N];
bool isFull(int remDig, int sum) { return sum == remDig * 9; }
int main() {
  int n, k, i, j;
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> b[i];
  }
  len[0] = (b[0] + 8) / 9;
  setLen(len[0], b[0], digit[0] + 1, 1);
  for (i = 1; i < n; ++i) {
    int miLen = (b[i] + 8) / 9;
    int preLen = len[i - 1];
    if (miLen > preLen) {
      len[i] = miLen;
      setLen(len[i], b[i], digit[i] + 1, 1);
      continue;
    }
    for (j = preLen; j > 0; --j) {
      dp[j] = digit[i - 1][j] == 9 ? dp[j + 1] + 9 : digit[i - 1][j] + 1;
    }
    for (j = 1; j <= preLen; ++j) {
      sum[j] = sum[j - 1] + digit[i - 1][j];
    }
    if (isFull(preLen, sum[preLen]) || dp[1] > b[i]) {
      len[i] = len[i - 1] + 1;
      setLen(len[i], b[i], digit[i] + 1, 1);
      continue;
    }
    len[i] = len[i - 1];
    for (j = 1; j <= preLen; ++j) {
      int remLen = preLen - j;
      digit[i][j] = digit[i - 1][j];
      b[i] -= digit[i - 1][j];
      if (b[i] > remLen * 9) {
        b[i] += digit[i - 1][j];
        setLen(remLen + 1, b[i], digit[i] + j, 1);
        break;
      }
      if (isFull(preLen - j, sum[preLen] - sum[j]) || dp[j + 1] > b[i]) {
        --b[i];
        ++digit[i][j];
        setLen(remLen, b[i], digit[i] + j + 1, 0);
        break;
      }
    }
  }
  for (i = 0; i < n; ++i) {
    for (j = 1; j <= len[i]; ++j) {
      digit[i][j] += '0';
    }
    digit[i][j] = 0;
    puts(digit[i] + 1);
  }
  return 0;
}
