#include <bits/stdc++.h>
using namespace std;
int GCD(int a, int b) {
  if (!a) return b;
  return GCD(b % a, a);
}
bool cmp(const string &a, const string &b) {
  if (a.size() < b.size())
    return true;
  else if (a.size() > b.size())
    return false;
  else {
    return a < b;
  }
}
string makeLowest(int sum, int at = -1, int bef = 0) {
  if (!at) return "";
  string ret;
  while (sum > 9) {
    ret += '9';
    sum -= 9;
  }
  ret += sum + '0';
  if (bef) reverse(ret.begin(), ret.end());
  if (at != -1) {
    while (ret.size() < at) {
      ret += '0';
    }
  } else {
    if (!sum) return "";
  }
  if (!bef) reverse(ret.begin(), ret.end());
  return ret;
}
string getBest(const string &bar, int sum) {
  cerr << bar << " BAR " << sum << endl;
  string ret;
  int n = bar.size();
  int s = 0;
  for (int i = 0; i < n; i++) {
    s += (bar[i] - '0');
  }
  int dig = 1;
  ret = bar;
  for (int i = n - 1; i >= 0; i--) {
    cerr << i << " " << sum << " " << s << "\n";
    if (bar[i] != '9') {
      for (int j = bar[i] + 1; j <= '9'; j++) {
        int sumToMake = (sum - s) - (j - bar[i]);
        if (sumToMake <= dig * 9 && sumToMake >= 0) {
          string tmp = ret;
          if (ret.size()) ret.pop_back();
          ret += j;
          int k = (bar.size() - ret.size());
          ret += makeLowest(sumToMake, k);
          int ss = 0;
          for (int i = 0; i < ret.size(); i++) ss += (ret[i] - '0');
          cerr << ret << " " << k << "\n";
          if (ret.size() == bar.size() && ss == sum) {
            cerr << "SAME\n";
            return ret;
          } else {
            ret = tmp;
          }
        }
      }
    }
    ret.pop_back();
    if (i > 0) {
      s -= (bar[i] - '0');
    }
    dig++;
  }
  dig = n + 1;
  cerr << "HERE " << dig << "\n";
  ;
  int req = sum / 9 + !!(sum % 9);
  if (req >= dig) {
    cerr << "REQ\n";
    return makeLowest(sum);
  } else {
    vector<string> cand;
    for (int first = 1; first <= 9; first++) {
      int sumToMake = sum - first;
      if (sumToMake >= 0) {
        string str;
        str += first + '0';
        str += makeLowest(sumToMake, dig - 1);
        cand.push_back(str);
      }
    }
    cerr << "\n";
    sort(cand.begin(), cand.end(), cmp);
    cerr << "CAND\n";
    return cand[0];
  }
}
int main() {
  clock_t startTime = clock();
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> b;
  for (int i = (0); i < (int)(n); i++) {
    int z;
    cin >> z;
    b.push_back(z);
  }
  vector<string> ans;
  ans.push_back(makeLowest(b[0]));
  for (int i = 1; i < b.size(); i++) {
    ans.push_back(getBest(ans.back(), b[i]));
  }
  for (int i = (0); i < (int)(ans.size()); i++) cout << ans[i] << "\n";
  clock_t endTime = clock();
  cerr << "\nTime:" << double(endTime - startTime) / CLOCKS_PER_SEC
       << " seconds\n";
  return 0;
}
