#include <bits/stdc++.h>
using namespace std;
void jadi9(char &x, long &y) {
  long r = '9' - x;
  if (r > y)
    x += y, y = 0;
  else
    x = '9', y -= r;
}
void pecah(string &to, string &from) {
  if (to.size() > from.size() || (to.size() == from.size() && to > from))
    return;
  else if (to.size() < from.size()) {
    long dif(from.size() - to.size());
    to.resize(from.size());
    for (long i = to.size() - 1; dif--; --i) to[i] = '0';
  }
  long c(0);
  for (long i = 0; i < to.size(); ++i) c += to[i] - '0', to[i] = '0';
  long at = from.size() - 1;
  for (long i = 0; i < from.size(); ++i) {
    c -= (from[i] - '0');
    to[i] = from[i];
    if (c < 0) {
      c += to[i] - '0';
      to[i] = '0';
      at = i - 1;
      break;
    }
  }
  bool found(false);
  for (long i = at; i >= 0; --i) {
    if (to[i] == '9' || c == 0)
      c += to[i] - '0', to[i] = '0';
    else if (c > 0) {
      ++to[i];
      --c;
      at = i + 1;
      found = true;
      break;
    }
  }
  if (!found) {
    at = 1;
    to = "1" + to;
    c += to[1] - 1 - '0';
  }
  for (long i = long(to.length()) - 1; i >= at; --i) {
    if (c >= 9)
      to[i] = '9', c -= 9;
    else
      to[i] = c + '0', c = 0;
  }
  if (c > 0)
    for (long i = at - 1; i >= 0; --i) jadi9(to[i], c);
}
string ambil(long dari) {
  string am;
  am.resize((dari + 8) / 9);
  for (long i = long(am.size()) - 1; i >= 0; --i) {
    if (dari > 9)
      am[i] = '9', dari -= 9;
    else
      am[i] = dari + '0';
  }
  return am;
}
int main() {
  long n;
  cin >> n;
  long in;
  cin >> in;
  string bef(ambil(in));
  cout << bef << '\n';
  for (long i = 1; i < n; ++i) {
    cin >> in;
    string aft(ambil(in));
    pecah(aft, bef);
    cout << aft << '\n';
    bef = aft;
  }
  return 0;
}
