#include <bits/stdc++.h>
using namespace std;
const int MX = 350;
vector<int> dq, dq1;
int x, N, last = -1;
int a[MX];
int dp[MX][302][3];
int solve(int i, int sum, int bigger) {
  if (sum == x && i >= dq.size() && bigger == 2) {
    return 0;
  }
  if (sum > x || i > MX - 2) return 1e7;
  int &ret = dp[i][sum][bigger];
  if (ret != -1) return ret;
  ret = 1e7;
  int j = 0;
  if (sum == 0) j = 1;
  for (; j < 10; j++) {
    int valid = bigger;
    if (last == -1) valid = 2;
    if (i < dq.size() && valid != 2 && (valid == 1)) {
      if (dq[i] > j) valid = 0;
      if (dq[i] < j) valid = 2;
      if (dq[i] == j) valid = 1;
    } else if (i + 1 > dq.size())
      valid = 2;
    ret = min(ret, 1 + solve(i + 1, sum + j, valid));
  }
  return ret;
}
void path(int i, int sum, int bigger) {
  if (sum == x && i >= dq.size() && bigger == 2) {
    return;
  }
  if (sum > x || i > MX - 2) return;
  int ret = dp[i][sum][bigger];
  int j = 0;
  if (sum == 0) j = 1;
  for (; j < 10; j++) {
    int valid = bigger;
    if (last == -1) valid = 2;
    if (i < dq.size() && valid != 2 && (valid == 1)) {
      if (dq[i] > j) valid = 0;
      if (dq[i] < j) valid = 2;
      if (dq[i] == j) valid = 1;
    } else if (i + 1 > dq.size())
      valid = 2;
    if (ret == 1 + solve(i + 1, sum + j, valid)) {
      dq1.push_back(j);
      path(i + 1, sum + j, valid);
      return;
    }
  }
  return;
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int i = 0; i < N; i++) {
    memset(dp, -1, sizeof dp);
    x = a[i];
    dq1.clear();
    solve(0, 0, 1);
    path(0, 0, 1);
    last = 1;
    dq.clear();
    for (int i = 0; i < dq1.size(); i++) cout << dq1[i], dq.push_back(dq1[i]);
    cout << "\n";
  }
  return 0;
}
