#include <bits/stdc++.h>
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
bool exmax(T &a, T b) {
  return (b > a) ? (a = b) || 1 : 0;
}
template <typename T>
bool exmin(T &a, T b) {
  return (b < a) ? (a = b) || 1 : 0;
}
using namespace std;
int a[510], b[510], l;
void print() {
  for (int i = l - 1; i >= 0; i--) cout << a[i];
  cout << endl;
}
int getsum(int s, int t) {
  int ret = 0;
  for (int i = s; i < t; i++) ret += b[i];
  return ret;
}
int main() {
  memset(a, 0x00, sizeof(a));
  int n;
  cin >> n;
  n--;
  int m;
  cin >> m;
  l = 0;
  int t = m;
  while (m) {
    if (m > 9)
      a[l++] = 9, m -= 9;
    else
      a[l++] = m, m = 0;
  }
  print();
  while (n--) {
    cin >> m;
    if (t < m) {
      for (int i = 0, j = m - t; j; i++) {
        if (j > 9 - a[i])
          j -= 9 - a[i], a[i] = 9;
        else
          a[i] += j, j = 0;
        exmax(l, i + 1);
      }
      t = m;
    } else {
      t = m;
      for (int i = 0; true; i++) {
        memcpy(b, a, sizeof(a));
        b[i]++;
        while (b[i] > 9) b[i] = 0, b[++i] += 1;
        for (int j = 0; j < i; j++) b[j] = 0;
        exmax(l, i + 1);
        int s = getsum(i, l);
        if (s > m) continue;
        if (i * 9 < m - s) continue;
        int k = 0;
        m -= s;
        while (m) {
          if (m > 9)
            b[k++] = 9, m -= 9;
          else
            b[k++] = m, m = 0;
        }
        break;
      }
      memcpy(a, b, sizeof(a));
    }
    print();
  }
  return 0;
}
