#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> b(n);
  for (int i = 0; i < n; i++) cin >> b[i];
  string prev = "0";
  int vis[500][310][2];
  for (int sum : b) {
    bool ok = false;
    string cur;
    string ans;
    function<void(int, int, int)> rec = [&](int pos, int acc, int gt) {
      if (ok or acc > sum) return;
      if (pos == int(prev.size())) {
        if (gt and acc == sum) {
          ok = true;
          ans = cur;
        }
        return;
      }
      if (vis[pos][acc][gt]) return;
      vis[pos][acc][gt] = true;
      if (gt) {
        for (int d = 0; d <= 9 and not ok; d++) {
          cur += ('0' + d);
          rec(pos + 1, acc + d, gt);
          cur.pop_back();
        }
      } else {
        for (int d = (prev[pos] - '0'); d <= 9 and not ok; d++) {
          cur += ('0' + d);
          rec(pos + 1, acc + d, d != (prev[pos] - '0'));
          cur.pop_back();
        }
      }
    };
    ok = false;
    while (not ok) {
      memset(vis, false, sizeof vis);
      rec(0, 0, 0);
      if (ok) {
        cout << ans << '\n';
        prev = ans;
        break;
      }
      prev.insert(begin(prev), '0');
    }
  }
  return (0);
}
