#include <bits/stdc++.h>
#pragma comment(linker, "/stack:102400000,102400000")
using namespace std;
const double PI = acos(-1.0);
template <class T_T>
T_T f_max(T_T a, T_T b) {
  return a > b ? a : b;
}
template <class T_T>
T_T f_min(T_T a, T_T b) {
  return a < b ? a : b;
}
template <class T_T>
T_T f_abs(T_T a) {
  return a > 0 ? a : -a;
}
template <class T_T>
T_T gcd(T_T a, T_T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T_T>
void swap(T_T *a, T_T *b) {
  T_T c;
  c = a;
  a = b;
  b = c;
}
int n, m;
int b[400], len[400];
int str[400][400];
int now;
bool dfs(int l, int sum, bool flag) {
  int t = str[now - 1][l];
  bool f;
  if (sum < 0) return false;
  if (sum == 0 && flag) {
    for (int i = l; i >= 0; i--) str[now][i] = 0;
    return true;
  }
  if (sum == 0 && flag == false) return false;
  if (l * 9 < sum) return false;
  if (l == 1) {
    str[now][l] = sum;
    if (flag == false) return str[now][l] > str[now - 1][l];
    return true;
  }
  if (flag == false) {
    str[now][l] = t;
    f = dfs(l - 1, sum - t, flag);
    if (f) return true;
    for (int i = t + 1; i <= 9 && i <= sum; i++) {
      str[now][l] = i;
      f = dfs(l - 1, sum - i, true);
      if (f) return true;
    }
  } else {
    t = (l - 1) * 9;
    if (t >= sum)
      str[now][l] = 0;
    else
      str[now][l] = sum - t;
    return dfs(l - 1, sum - str[now][l], flag);
  }
  return false;
}
void run(int le, int sum) {
  int i, j, k, t;
  t = (sum + 8) / 9;
  if (t > len[now - 1]) {
    len[now] = t;
    for (i = 1; i <= t; i++) {
      str[now][i] = sum >= 9 ? 9 : sum;
      sum -= 9;
    }
  } else {
    dfs(len[now - 1] + 1, sum, false);
    for (len[now] = len[now - 1] + 1; str[now][len[now]] == 0; len[now]--)
      ;
  }
  for (i = len[now]; i; i--) {
    printf("%d", str[now][i]);
  }
  printf("\n");
}
int main() {
  int q, w, e, r;
  int i, j, k;
  int t;
  while (~scanf("%d", &n)) {
    memset(str, 0, sizeof(str));
    len[0] = 1;
    for (i = 1; i <= n; i++) {
      scanf("%d", &b[i]);
      now = i;
      run(len[i - 1], b[i]);
    }
  }
  return 0;
}
