#include <bits/stdc++.h>
using namespace std;
char ch[500];
char s[500];
bool can(char s1[], char s2[]) {
  int l1 = strlen(s1);
  int l2 = strlen(s2);
  if (l1 == l2) {
    for (int i = l1 - 1; i >= 0; i--) {
      if (s1[i] > s2[i])
        return 1;
      else if (s2[i] > s1[i])
        return 0;
    }
    return 0;
  } else
    return l1 > l2;
}
void int_to_str(int x, char str[]) {
  int cnt = 0;
  while (x > 0) {
    str[cnt] = min(x, 9) + '0';
    x -= min(x, 9);
    cnt++;
  }
  str[cnt] = 0;
}
int dfs(int x, int sum) {
  int v = s[x] - '0';
  if (sum > v) {
    ch[x] = s[x];
    if (x == 0) return sum - v;
    int t = dfs(x - 1, sum - v);
    if (t == -1) {
      if (sum - v > 0) {
        if (ch[x] != '9') {
          ch[x]++;
          return sum - v - 1;
        }
        sum -= v;
        while (1) {
          if (ch[x] == '9') {
            ch[x] = '0';
            sum += 9;
          } else {
            if (ch[x] == 0) ch[x] = '0';
            ch[x]++;
            sum--;
            break;
          }
          x++;
        }
        return sum;
      } else
        return -1;
    }
    return t;
  } else {
    return -1;
  }
}
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (i == 1) {
      int_to_str(x, s);
      int l = strlen(s);
      for (int i = l - 1; i >= 0; i--) printf("%c", s[i]);
      printf("\n");
    } else {
      int len = strlen(s);
      memset(ch, 0, sizeof(ch));
      int t = dfs(len - 1, x);
      if (t == -1) {
        ch[len] = '1';
        x--;
        t = x;
      }
      int cnt = 0;
      while (cnt < 400) {
        int g = 0;
        if (ch[cnt] == 0) ch[cnt] = '0';
        if (t > 0) {
          g = min(t, 9 - (ch[cnt] - '0'));
          t -= g;
        }
        s[cnt] = (ch[cnt] - '0' + g) % 10 + '0';
        ch[cnt + 1] += (ch[cnt] - '0') / 10;
        cnt++;
      }
      cnt--;
      while (s[cnt] == '0') cnt--;
      s[cnt + 1] = 0;
      for (int i = cnt; i >= 0; i--) printf("%c", s[i]);
      printf("\n");
    }
  }
  return 0;
}
