#include <bits/stdc++.h>
using namespace std;
bool Mn(string &f, string &s) {
  if (f.size() != s.size()) return f.size() < s.size();
  if (f == s) return 0;
  return f < s;
}
string getMn(string prev, int sum) {
  string res = "#";
  int ln = (int)prev.size();
  for (int difInd = 0; difInd < ln; difInd++) {
    if (prev[difInd] == '9') continue;
    string check = prev;
    check[difInd]++;
    int rem = sum;
    for (int it = difInd; it >= 0; it--) rem -= (check[it] - '0');
    if (rem < 0) continue;
    for (int j = ln - 1; j > difInd; j--) {
      check[j] = char(min(rem, 9) + 48);
      rem -= min(rem, 9);
    }
    int g = min(9 - (check[difInd] - '0'), rem);
    check[difInd] += g;
    rem -= g;
    if (rem) continue;
    if (res == "#") {
      if (Mn(prev, check)) res = check;
    } else {
      if (Mn(prev, check) && Mn(check, res)) res = check;
    }
  }
  if (res != "#") return res;
  res = "";
  ln++;
  while (sum > 9 * ln) ln++;
  for (int i = 0; i < ln; i++) {
    res += char(min(9, sum) + 48);
    sum -= min(9, sum);
  }
  reverse(res.begin(), res.end());
  if (res[0] == '0') {
    res[0]++;
    for (int x = 1; x < ln; x++) {
      if (res[x] != '0') {
        res[x]--;
        break;
      }
    }
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> b(n);
  string cur = "0";
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    string f = getMn(cur, b[i]);
    cur = f;
    for (int x = 0; x < cur.size(); x++) printf("%c", cur[x]);
    printf("\n");
  }
}
