#include <bits/stdc++.h>
using namespace std;
inline void Boost() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
pair<int, int> min(pair<int, int> X, pair<int, int> Y) {
  if (X < Y) return X;
  return Y;
}
int minI(int X, int Y) {
  if (X < Y) return X;
  return Y;
}
int b[300];
string s, t;
vector<string> ans;
int main() {
  int n;
  int i, j, k;
  cin >> n;
  s.append(400, '0');
  t.append(400, '0');
  for (i = 0; i < n; i++) {
    int x;
    cin >> x;
    int sum = 0;
    pair<int, int> pos = {400, 0};
    for (j = 399; j >= 0; j--) {
      for (k = s[j] - '0' + 1; k < 10; k++)
        if (0 <= x - (sum + k) && x - (sum + k) <= j * 9)
          pos = min(pos, {j, k});
      sum += s[j] - '0';
    }
    k = pos.first;
    for (j = 399; j > k; j--) {
      x -= s[j] - '0';
      t[j] = s[j];
    }
    x -= pos.second;
    t[k] = '0' + pos.second;
    int p = 0;
    for (j = 0; j < k; j++) {
      int d = minI(x, 9);
      t[j] = '0' + d;
      x -= d;
    }
    s = t;
    ans.push_back(s);
  }
  for (i = 0; i < n; i++) {
    int p = 399;
    while (ans[i][p] == '0') p--;
    for (j = p; j >= 0; j--) cout << ans[i][j];
    cout << "\n";
  }
  return 0;
}
