#include <bits/stdc++.h>
void out(char *r, char *p, char *q);
int main() {
  int i, j, k, len, f, lastsum, nines, currentsum, n, p, q, sum[10000];
  char A[1000], B[1000];
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) scanf("%d", &sum[i]);
    nines = sum[0] / 9;
    for (i = 0; i < nines; i++) A[i] = '9';
    A[nines] = sum[0] % 9 + 48;
    if (A[nines] == '0') nines--;
    for (i = nines; i >= 0; i--) printf("%c", A[i]);
    printf("\n");
    for (i = nines + 1; i < 999; i++) A[i] = '0';
    A[i] = '\0';
    for (i = 1; i < n; i++) {
      if (sum[i] == sum[i - 1]) {
        f = 0;
        len = strlen(A);
        strcpy(B, A);
        for (j = 0; j < 999; j++) {
          if (A[j] != '0' && f == 0) {
            B[j] = A[j] - 1;
            if (A[j + 1] != '9') {
              B[j + 1] = A[j + 1] + 1;
              f += 2;
              break;
            } else
              f++;
          } else if (A[j] != '9' && f == 1) {
            B[j] = A[j] + 1;
            f++;
            break;
          }
        }
        out(A, B, A);
      } else if (sum[i] > sum[i - 1]) {
        f = 0;
        strcpy(B, A);
        for (j = 0; j < 999; j++) {
          while (B[j] < '9') {
            B[j]++;
            sum[i - 1]++;
            if (sum[i - 1] == sum[i]) {
              f++;
              break;
            }
          }
          if (f) break;
        }
        out(A, B, A);
      } else {
        f = 0;
        strcpy(B, A);
        for (j = 1; j < 999; j++) {
          while (B[j] == '9') j++;
          B[j]++;
          sum[i - 1]++;
          for (k = j - 1; k >= 0; k--) {
            while (B[k] > '0') {
              B[k]--;
              sum[i - 1]--;
              if (sum[i - 1] == sum[i]) {
                f++;
                break;
              }
            }
            if (f) break;
          }
          if (f) break;
          B[j]--;
          sum[i - 1]--;
        }
        out(A, B, A);
      }
    }
  }
  return 0;
}
void out(char *r, char *p, char *q) {
  int i, len = strlen(p), lenA = 0, lenB = 0, min, index, j, k, m;
  char A[1000], B[1000], l;
  for (i = len - 1; i >= 0; i--) {
    if (p[i] != '0') {
      for (; i >= 0; i--) {
        A[lenA] = p[i];
        lenA++;
      }
    }
  }
  A[lenA] = '\0';
  len = strlen(q);
  for (i = len - 1; i >= 0; i--) {
    if (q[i] != '0') {
      for (; i >= 0; i--) {
        B[lenB] = q[i];
        lenB++;
      }
    }
  }
  B[lenB] = '\0';
  if (strlen(A) == strlen(B)) {
    for (i = 0; i < strlen(A); i++) {
      if (A[i] > B[i]) {
        m = i;
        break;
      }
    }
    for (i = m + 1; i < (lenA - 1); i++) {
      for (j = m + 1; j < lenA - 1; j++) {
        if (A[j] > A[j + 1]) {
          l = A[j];
          A[j] = A[j + 1];
          A[j + 1] = l;
        }
      }
    }
    printf("%s\n", A);
  } else if (strlen(A) != strlen(B)) {
    min = 10000;
    for (i = 0; i < lenA; i++) {
      if (A[i] < min && A[i] != '0') {
        min = A[i];
        index = i;
      }
    }
    l = A[0];
    A[0] = A[index];
    A[index] = l;
    for (i = 1; i < (lenA - 1); i++) {
      for (j = 1; j < lenA - 1; j++) {
        if (A[j] > A[j + 1]) {
          l = A[j];
          A[j] = A[j + 1];
          A[j + 1] = l;
        }
      }
    }
    printf("%s\n", A);
  }
  for (i = 0; i < lenA; i++) r[lenA - i - 1] = A[i];
  for (i = lenA; i < 998; i++) r[i] = '0';
  r[999] = '\0';
}
