#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T poww(T b, T p) {
  long long a = 1;
  while (p) {
    if (p & 1) {
      a = (a * b);
    }
    p >>= 1;
    b = (b * b);
  }
  return a;
}
template <class T>
inline T poww2(T b, int p) {
  T a = 1;
  while (p) {
    if (p & 1) {
      a = (a * b);
    }
    p >>= 1;
    b = (b * b);
  }
  return a;
}
template <class T>
inline T modpoww(T b, T p, T mmod) {
  if (p == 0 && b == 0) return 0;
  long long a = 1;
  while (p) {
    if (p & 1) {
      a = (a * b) % mmod;
    }
    p >>= 1;
    b = (b * b) % mmod;
  }
  return a % mmod;
}
int n;
int sum[310];
int visited[610][302][2];
int get_number(int sm, int last_number[][610], int cur_len, int req_len,
               int last_len, int ge_fl = 0) {
  if (cur_len == req_len) {
    if (sm)
      return 0;
    else if (cur_len == last_len && ge_fl)
      return 1;
    else if (cur_len > last_len)
      return 1;
    return 0;
  }
  if (visited[cur_len][sm][ge_fl]) return 0;
  visited[cur_len][sm][ge_fl] = 1;
  int i, j, start;
  if (ge_fl)
    start = 0;
  else
    start = (req_len > last_len ? 0 : last_number[0][cur_len]);
  if (cur_len == 0 && start == 0) start++;
  for (i = start; i < 10; i++) {
    if (i <= sm) {
      last_number[1][cur_len] = i;
      if (get_number(sm - i, last_number, cur_len + 1, req_len, last_len,
                     (ge_fl | (i > start))))
        return 1;
    }
  }
  return 0;
}
int solve(int sm, int last_number[][610], int len) {
  int i, j, l;
  int min_length = (sm / 9) + (sm % 9 != 0);
  for (i = max(min_length, len);; i++) {
    memset(visited, 0, sizeof(visited));
    if (get_number(sm, last_number, 0, i, len)) {
      return i;
    }
  }
}
int main() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &sum[i]);
  }
  int last_number[2][610], length = 0;
  for (i = 0; i < n; i++) {
    length = solve(sum[i], last_number, length);
    for (j = 0; j < length; j++) {
      cout << last_number[1][j];
      last_number[0][j] = last_number[1][j];
    }
    cout << "\n";
  }
}
