#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;
priority_queue<int, vector<int>, greater<int> > pq;
vector<int> v;
char dp[401][301][2];
char s[402];
int tn, kk;
char go(int o, int k, int st) {
  if (k > kk || (o == 1 && k == 0)) return 0;
  if (dp[o][k][st] != -1) return dp[o][k][st];
  if (o == tn) return (k == kk && st == 1);
  char ret = 0;
  for (int i = 0; i < 10; i++) {
    if (st)
      ret = go(o + 1, k + i, 1);
    else {
      if (i == s[o] - '0')
        ret = go(o + 1, k + i, 0);
      else if (i > s[o] - '0')
        ret = go(o + 1, k + i, 1);
    }
    if (ret) {
      s[o] = i + '0';
      return 1;
    }
  }
  return dp[o][k][st] = 0;
}
int main() {
  int n, flag;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &kk);
    flag = 0;
    while (1) {
      memset(dp, -1, sizeof(dp));
      if (go(0, 0, flag)) {
        printf("%s\n", s);
        break;
      }
      flag = 1;
      tn++;
    }
  }
}
