#include <bits/stdc++.h>
using namespace std;
string nex(string pres, int spres, int snex) {
  if (snex > spres) {
    string tmp = pres;
    int s = spres;
    int i = tmp.length() - 1;
    while ('9' - tmp[i] < snex - s) {
      if (i > 0) {
        s = s + '9' - tmp[i];
        tmp[i] = '9';
        i--;
      } else {
        s = s + '9' - tmp[i];
        tmp[i] = '9';
        tmp = "0" + tmp;
      }
    }
    tmp[i] = tmp[i] + snex - s;
    return tmp;
  } else {
    int d = spres - snex + 1;
    int i = pres.length() - 1;
    int c = d;
    int sum = 0;
    while (c > 0) {
      c = c - pres[i] + '0';
      sum = sum + pres[i] - '0';
      i--;
    }
    while (pres[i] == '9') {
      sum = sum + pres[i] - '0';
      i--;
      if (i == -1) break;
    }
    if (i == -1) {
      pres = "1" + pres;
      i = 0;
    } else
      pres[i] += 1;
    sum = sum - d;
    for (int j = pres.length() - 1; j > i; j--) {
      if (sum > 9) {
        pres[j] = '9';
        sum -= 9;
      } else if (sum > 0) {
        pres[j] = '0' + sum;
        sum = 0;
      } else
        pres[j] = '0';
    }
  }
  return pres;
}
int main() {
  string k = "0";
  int n;
  cin >> n;
  int pre = 0;
  int t;
  for (int i = 0; i < n; i++) {
    cin >> t;
    k = nex(k, pre, t);
    cout << k << endl;
    pre = t;
  }
}
