#include <bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int N = 500;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int last = 0;
  vector<int> ans(N, 0);
  while (n--) {
    int d;
    cin >> d;
    int tmp = d;
    if (d > last) {
      d = d - last;
      for (int i = 0; d > 0; i++) {
        int e = min(d, 9 - ans[i]);
        d -= e;
        ans[i] += e;
      }
    } else {
      for (int k = 0; k < N; k++) {
        if (ans[k] == 9) continue;
        int pre = 0;
        for (int i = k + 1; i < N; i++) pre += ans[i];
        bool ok = false;
        for (int i = ans[k] + 1; i <= 9; i++) {
          if (pre + i <= d && d <= pre + i + k * 9) {
            ok = true;
            ans[k] = i;
            d = d - pre - i;
            for (int j = 0; j < k; j++) {
              int e = min(9, d);
              ans[j] = e;
              d -= e;
            }
            break;
          }
        }
        if (ok) break;
      }
    }
    bool ok = false;
    for (int i = N - 1; i >= 0; i--) {
      if (ans[i]) ok = true;
      if (ok) cout << ans[i];
    }
    cout << "\n";
    last = tmp;
  }
}
