#include <bits/stdc++.h>
using namespace std;
int str1[1005];
int str2[1005];
int dp[1005][1005][3];
int vis[1005][1005][3], True;
int len = 500;
int back(int pos, int sum, int t) {
  if (vis[pos][sum][t] == True) return dp[pos][sum][t];
  dp[pos][sum][t] = 0;
  vis[pos][sum][t] = True;
  if (pos == len) {
    if (sum == 0 && t == 1) {
      dp[pos][sum][t] = 1;
      return 1;
    }
    return dp[pos][sum][t];
  }
  for (int i = 0; i <= 9 && i <= sum; i++) {
    if (t == 1) {
      if (back(pos + 1, sum - i, t) == 1) {
        dp[pos][sum][t] = 1;
        return 1;
      }
    } else {
      if (str1[pos] > i) continue;
      int nt = t;
      if (str1[pos] < i) nt = 1;
      if (back(pos + 1, sum - i, nt) == 1) {
        dp[pos][sum][t] = 1;
        return 1;
      }
    }
  }
  return dp[pos][sum][t];
}
void Go(int pos, int sum, int t) {
  if (pos == len) {
    return;
  }
  for (int i = 0; i <= 9 && i <= sum; i++) {
    if (t == 1) {
      if (back(pos + 1, sum - i, t) == 1) {
        str2[pos] = i;
        Go(pos + 1, sum - i, t);
        return;
      }
    } else {
      if (str1[pos] > i) continue;
      int nt = t;
      if (str1[pos] < i) nt = 1;
      if (back(pos + 1, sum - i, nt) == 1) {
        str2[pos] = i;
        Go(pos + 1, sum - i, nt);
        return;
      }
    }
  }
  return;
}
int b[305], n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = 0; i < len; i++) str1[i] = 0;
  for (int i = 0; i < n; i++) {
    True++;
    back(0, b[i], 0);
    Go(0, b[i], 0);
    for (int k = 0; k < len; k++) {
      str1[k] = str2[k];
    }
    int st = 0;
    while (st < len && str1[st] == 0) st++;
    while (st < len) printf("%d", str1[st]), st++;
    printf("\n");
  }
  return 0;
}
