#include <bits/stdc++.h>
using namespace std;
int n, b[301], k, x, y;
vector<string> v;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  string s = "", s2 = "";
  x = b[0];
  for (int i = 9; i >= 1; i--) {
    y = x % i;
    x /= i;
    for (int j = 0; j < x; j++) s2 += (i + '0');
    x = y;
  }
  for (int i = s2.length() - 1; i >= 0; i--) s += s2[i];
  v.push_back(s);
  string s1 = "";
  for (int i = 1; i < n; i++) {
    s1 = "";
    x = b[i - 1];
    int sum = b[i - 1];
    bool was = false;
    for (int j = s.length() - 1; j >= 0; j--) {
      for (int z = '1'; z <= '9'; z++) {
        if (s[j] < z && sum + (z - s[j]) <= b[i]) {
          string s3 = "";
          s2 = "";
          x = b[i] - (sum + (z - s[j]));
          for (int r = 9; r >= 1; r--) {
            y = x % r;
            x /= r;
            for (int j = 0; j < x; j++) s2 += (r + '0');
            x = y;
          }
          for (int r = s2.length() - 1; r >= 0; r--) s3 += s2[r];
          if (s3.length() <= s.length() - j - 1) {
            x = b[i];
            s[j] = z;
            int pos = s.length() - 1;
            for (int q = s3.length() - 1; q >= 0; q--) {
              s[pos] = s3[q];
              pos--;
            }
            for (int q = j + 1; q <= pos; q++) s[q] = '0';
            was = true;
            break;
          }
        }
      }
      sum -= (s[j] - '0');
      if (was) break;
    }
    if (was) {
      v.push_back(s);
      continue;
    }
    was = false;
    for (int j = s.length() + 1; j <= 350; j++) {
      s1 = "";
      s1 += '1';
      for (int z = 1; z < j; z++) {
        s1 += '0';
      }
      x = 1;
      sum = 1;
      for (int e = s1.length() - 1; e >= 0; e--) {
        sum = 1;
        for (int z = '0'; z <= '9'; z++) {
          if (s1[e] <= z && sum + (z - s1[e]) <= b[i]) {
            string s3 = "";
            s2 = "";
            x = b[i] - (sum + (z - s1[e]));
            for (int r = 9; r >= 1; r--) {
              y = x % r;
              x /= r;
              for (int e = 0; e < x; e++) s2 += (r + '0');
              x = y;
            }
            for (int r = s2.length() - 1; r >= 0; r--) s3 += s2[r];
            if (s3.length() <= s1.length() - e - 1) {
              x = b[i];
              s1[e] = z;
              int pos = s1.length() - 1;
              for (int q = s3.length() - 1; q >= 0; q--) {
                s1[pos] = s3[q];
                pos--;
              }
              for (int q = e + 1; q <= pos; q++) s1[q] = '0';
              was = true;
              break;
            }
          }
        }
        if (was) break;
      }
      if (was) break;
    }
    v.push_back(s1);
    s = s1;
  }
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << endl;
  }
  return 0;
}
