#include <bits/stdc++.h>
using namespace std;
int n;
int num[310];
int ans[310][610], cou[310];
int deal(int x) {
  if (cou[x] > cou[x - 1]) {
    return 1;
  } else if (cou[x] == cou[x - 1]) {
    for (int i = cou[x]; i >= 0; i--) {
      if (ans[x][i] > ans[x - 1][i]) {
        return 1;
      } else if (ans[x][i] < ans[x - 1][i]) {
        return 0;
      }
    }
    return 0;
  } else {
    return 0;
  }
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &num[i]);
    }
    int cnt = 0, x, re = num[0];
    while (re) {
      x = min(9, re);
      ans[0][cnt] = x;
      re -= x;
      cnt++;
    }
    cou[0] = cnt;
    for (int i = 1; i < n; i++) {
      int c = 0, re = num[i];
      while (re) {
        x = min(9, re);
        ans[i][c] = x;
        re -= x;
        c++;
      }
      cou[i] = c;
      int s = deal(i);
      if (s == 0) {
        if (num[i] > num[i - 1]) {
          for (int j = 0; j < cou[i - 1]; j++) {
            ans[i][j] = ans[i - 1][j];
          }
          int re = num[i] - num[i - 1];
          for (int j = 0; re && j < cou[i - 1]; j++) {
            if (ans[i][j] < 9) {
              x = min(re, 9 - ans[i][j]);
              ans[i][j] += x;
              re -= x;
            }
          }
          cou[i] = cou[i - 1];
        } else {
          re = num[i] - ans[i - 1][cou[i - 1] - 1];
          if (re > 0) {
            ans[i][cou[i - 1] - 1] = ans[i - 1][cou[i - 1] - 1];
            int pos = -1;
            for (int j = cou[i - 1] - 2; re && j >= 0; j--) {
              if (re > ans[i - 1][j] && ans[i - 1][j] != 9) {
                pos = j;
                break;
              }
              ans[i][j] = ans[i - 1][j];
              re -= ans[i][j];
            }
            if (pos != -1) {
              int j;
              cou[i] = cou[i - 1];
              for (j = pos; j >= 0; j--) {
                if (re > ans[i - 1][j]) {
                  ans[i][j] = ans[i - 1][j];
                  re -= ans[i - 1][j];
                } else {
                  break;
                }
              }
              int p = j;
              for (j = j + 1; j <= pos; j++) {
                if (ans[i][j] != 9) {
                  ans[i][j]++;
                  for (int k = p + 1; k < j; k++) {
                    re += ans[i][k];
                  }
                  re--;
                  break;
                }
              }
              for (p = 0; re && p < j; p++) {
                x = min(9, re);
                ans[i][p] = x;
                re -= x;
              }
              for (p; p < j; p++) {
                ans[i][p] = 0;
              }
            } else if (ans[i - 1][cou[i - 1] - 1] != 9) {
              cou[i] = cou[i - 1];
              ans[i][cou[i - 1] - 1] = ans[i - 1][cou[i - 1] - 1] + 1;
              re = num[i] - ans[i][cou[i - 1] - 1];
              int j;
              for (j = 0; re; j++) {
                x = min(9, re);
                ans[i][j] = x;
                re -= x;
              }
              for (j; j < cou[i] - 1; j++) {
                ans[i][j] = 0;
              }
            } else {
              cou[i] = cou[i - 1] + 1;
              ans[i][cou[i - 1]] = 1;
              re = num[i] - 1;
              int j = 0;
              for (; re; j++) {
                x = min(9, re);
                ans[i][j] = x;
                re -= x;
              }
              for (j; j < cou[i] - 1; j++) {
                ans[i][j] = 0;
              }
            }
          } else {
            cou[i] = cou[i - 1] + 1;
            ans[i][cou[i - 1]] = 1;
            re = num[i] - 1;
            int j = 0;
            for (; re; j++) {
              x = min(9, re);
              ans[i][j] = x;
              re -= x;
            }
            for (j; j < cou[i] - 1; j++) {
              ans[i][j] = 0;
            }
          }
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = cou[i] - 1; j >= 0; j--) {
        printf("%d", ans[i][j]);
      }
      printf("\n");
    }
  }
}
