#include <bits/stdc++.h>
using namespace std;
inline void inp(int &n) {
  n = 0;
  int ch = getchar();
  int sign = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') sign = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  n = n * sign;
}
long long gcd(long long A, long long B) {
  return A > B ? gcd(B, A) : A ? gcd(B % A, A) : B;
}
long long lcm(long long A, long long B) { return A / gcd(A, B) * B; }
long long pow(long long A, long long B, long long P) {
  if (!B) return 1 % P;
  long long h = pow(A, B / 2, P);
  h *= h;
  h %= P;
  if (B % 2) h *= A;
  return h % P;
}
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
int tst;
void get_ready() { tst = 1; }
string ild(int o) {
  string ret;
  for (int j = 0; j < o; j++) ret += "9";
  return ret;
}
string bill(int n, int x) {
  string s;
  for (int i = 0; i < n; i++) s += char(min(9, x) + '0'), x -= min(x, 9);
  return s;
}
string sub(string s, int l) {
  string ret;
  for (int i = l; i < s.size(); i++) ret += s[i];
  return ret;
}
string s[500], q;
int XX, is;
void build(int l, int x) {
  if (x < 0) {
    s[XX] += '#';
    return;
  }
  if (l >= q.size()) return;
  if (is) {
    for (int i = 0; i <= 9; i++)
      if (i + 9 * (q.size() - 1 - l) >= x) {
        s[XX] += char(i + '0');
        build(l + 1, x - i);
        return;
      }
  }
  int st = q[l] + 1 - '0';
  if (q[l] - '0' + 9 * (q.size() - 1 - l) >= x) {
    if (bill(q.size() - 1 - l, x - q[l] + '0') > sub(q, l + 1)) {
      s[XX] += q[l];
      build(l + 1, x - q[l] + '0');
      return;
    }
  }
  for (int i = st; i <= 9; i++)
    if (i + 9 * (q.size() - 1 - l) >= x) {
      s[XX] += char(i + '0');
      is = 1;
      build(l + 1, x - i);
      return;
    }
  s[XX] += '#';
}
int x, i, n, j;
int X[500];
bool READ() {
  cin >> n;
  s[0] = "0";
  for (i = 1; i <= n; i++) {
    cin >> X[i];
    x = X[i];
    while (x > 0) {
      s[i] = char(min(9, x) + '0') + s[i];
      x -= min(x, 9);
    }
    if ((s[i].size() < s[i - 1].size()) ||
        (s[i].size() == s[i - 1].size() && s[i] <= s[i - 1])) {
      if (9 * s[i - 1].size() - 1 < X[i] || ild(s[i - 1].size()) == s[i - 1]) {
        s[i] = "1";
        for (j = 0; j < s[i - 1].size(); j++) s[i] += "0";
        x = X[i] - 1;
        int l = s[i].size() - 1;
        while (x) {
          s[i][l] = char(min(9, x) + '0');
          l--;
          x -= min(9, x);
        }
        continue;
      }
      q = s[i - 1];
      XX = i;
      s[i] = "";
      is = 0;
      build(0, X[i]);
      for (j = 0; j < s[i].size(); j++)
        if (s[i][j] == '#') break;
      if (j != s[i].size()) {
        s[i] = bill(s[i - 1].size(), X[i] - 1);
        reverse(s[i].begin(), s[i].end());
        s[i] = "1" + s[i];
      }
    }
  }
  for (i = 1; i <= n; i++) cout << s[i] << endl;
  return 1;
}
bool SOLVE() { return 1; }
bool PRINT() { return 1; }
bool CLEAR() { return 1; }
int main() {
  get_ready();
  while (tst--) {
    if (!READ()) {
      return 0;
    }
    if (!SOLVE()) {
      return 0;
    }
    if (!PRINT()) {
      return 0;
    }
    if (!CLEAR()) {
      return 0;
    }
  }
}
