#include <bits/stdc++.h>
using namespace std;
int k[1000000], wei[400], q[400], f[1000000];
int cmp(int a, int b) { return a > b; }
int main() {
  int n;
  int b, g = 0;
  scanf("%d", &n);
  scanf("%d", &q[0]);
  b = q[0];
  while (b > 0) {
    if (b > 9) {
      k[g++] = 9;
      b -= 9;
    } else {
      k[g++] = b;
      b = 0;
    }
  }
  wei[0] = g;
  for (int j = wei[0] - 1; j >= 0; j--) {
    printf("%d", k[j]);
  }
  printf("\n");
  for (int i = 1; i < n; i++) {
    memcpy(f, k, sizeof(k));
    scanf("%d", &q[i]);
    if (q[i] > q[i - 1]) {
      int sum = 0;
      for (int j = 0; j < wei[i - 1]; j++) {
        while (k[j] < 9) {
          k[j] += 1;
          sum += 1;
          if (sum == (q[i] - q[i - 1])) {
            j = wei[i - 1];
            break;
          }
        }
      }
      wei[i] = wei[i - 1];
      while (sum < (q[i] - q[i - 1])) {
        wei[i] += 1;
        while (sum < (q[i] - q[i - 1])) {
          if (k[wei[i] - 1] >= 9) break;
          k[wei[i] - 1] += 1;
          sum += 1;
        }
      }
      for (int j = wei[i] - 1; j >= 0; j--) {
        printf("%d", k[j]);
      }
      printf("\n");
    } else if (q[i] == q[i - 1]) {
      wei[i] = wei[i - 1];
      int gd;
      for (int j = 0; j < wei[i - 1]; j++) {
        if (k[j] != 0) {
          gd = j;
          k[j] -= 1;
          break;
        }
      }
      for (int j = gd + 1; j < wei[i - 1]; j++) {
        if (k[j] < 9) {
          k[j] += 1;
          gd = -1;
          break;
        }
      }
      if (gd != -1) {
        k[wei[i]] = 1;
        wei[i] += 1;
      }
      if (wei[i] > wei[i - 1]) {
        sort(k, k + wei[i] - 1, cmp);
      } else {
        int kkk;
        for (int j = wei[i] - 1; j >= 0; j--) {
          if (k[j] > f[j]) {
            kkk = j;
            break;
          }
        }
        sort(k, k + kkk, cmp);
      }
      for (int j = wei[i] - 1; j >= 0; j--) {
        printf("%d", k[j]);
      }
      printf("\n");
    } else if (q[i] < q[i - 1]) {
      wei[i] = wei[i - 1];
      int sum = 0;
      for (int j = 0; j < wei[i - 1]; j++) {
        while (k[j] > 0) {
          k[j] -= 1;
          sum += 1;
          if (sum == (q[i - 1] - q[i])) {
            j = wei[i - 1];
            break;
          }
        }
      }
      int gd;
      for (int j = 0; j < wei[i - 1]; j++) {
        if (k[j] != 0) {
          gd = j;
          k[j] -= 1;
          break;
        }
      }
      for (int j = gd + 1; j < wei[i - 1]; j++) {
        if (k[j] < 9) {
          k[j] += 1;
          gd = -1;
          break;
        }
      }
      if (gd != -1) {
        k[wei[i]] = 1;
        wei[i] += 1;
      }
      if (wei[i] > wei[i - 1]) {
        sort(k, k + wei[i] - 1, cmp);
      } else {
        int kkk;
        for (int j = wei[i] - 1; j >= 0; j--) {
          if (k[j] > f[j]) {
            kkk = j;
            break;
          }
        }
        sort(k, k + kkk, cmp);
      }
      for (int j = wei[i] - 1; j >= 0; j--) {
        printf("%d", k[j]);
      }
      printf("\n");
    }
  }
  return 0;
}
