#include <bits/stdc++.h>
using namespace std;
int digits[400] = {0};
void gen(int target) {
  int sum = 0;
  for (int ii = 0; ii < 400; ii++) {
    sum += digits[ii];
  }
  if (sum == target) {
    int a, b;
    for (a = 0; a < 400; a++) {
      if (digits[a] != 0) break;
    }
    for (b = a + 1; b < 400; b++) {
      if (digits[b] != 9) break;
    }
    digits[a]--;
    digits[b]++;
    int subsum = 0;
    for (int ii = 0; ii < b; ii++) {
      subsum += digits[ii];
    }
    for (int ii = 0; ii < b; ii++) {
      digits[ii] = min(subsum, 9);
      subsum -= min(subsum, 9);
    }
    return;
  } else if (sum > target) {
    int a, b, subsum = 0;
    for (a = 0; a < 400; a++) {
      subsum += digits[a];
      if (subsum > sum - target) break;
    }
    for (b = a + 1; b < 400; b++) {
      if (digits[b] != 9) break;
    }
    digits[b]++;
    sum += 1;
    for (int ii = 0; ii <= a; ii++) {
      int diff = min(digits[ii], sum - target);
      digits[ii] -= diff;
      sum -= diff;
    }
    subsum = 0;
    for (int ii = 0; ii < b; ii++) {
      subsum += digits[ii];
    }
    for (int ii = 0; ii < b; ii++) {
      digits[ii] = min(subsum, 9);
      subsum -= min(subsum, 9);
    }
  } else if (sum < target) {
    while (sum < target) {
      int a;
      for (a = 0; a < 400; a++) {
        if (digits[a] != 9) break;
      }
      while (digits[a] != 9) {
        digits[a]++;
        sum++;
        if (sum == target) break;
      }
    }
  }
}
int main() {
  int n;
  int b[300];
  cin >> n;
  for (int ii = 0; ii < n; ii++) {
    cin >> b[ii];
    gen(b[ii]);
    int end;
    for (end = 400 - 1; end > 0; end--) {
      if (digits[end] != 0) break;
    }
    for (int ii = end; ii >= 0; ii--) {
      cout << digits[ii];
    }
    cout << endl;
  }
}
