#include <bits/stdc++.h>
using namespace std;
const int N = 2000100;
long long b[301];
vector<int> getMini(int m, int sum) {
  vector<int> mini;
  sum = sum - 1;
  for (int i = 0; i < m - 1; i++) {
    if (sum >= 9) {
      mini.push_back(9);
      sum -= 9;
    } else {
      mini.push_back(sum);
      sum = 0;
    }
  }
  mini.push_back(sum + 1);
  return mini;
}
vector<int> getMiniPart(int m, int sum) {
  vector<int> mini;
  for (int i = 0; i < m; i++) {
    if (sum >= 9) {
      mini.push_back(9);
      sum -= 9;
    } else {
      mini.push_back(sum);
      sum = 0;
    }
  }
  return mini;
}
void printOut(vector<int> ans) {
  reverse(ans.begin(), ans.end());
  for (vector<int>::iterator it = ans.begin(); it != ans.end(); it++) {
    cout << *it;
  }
  cout << endl;
}
vector<int> increaseSum(vector<int> x, int diff) {
  int m = x.size();
  for (int i = 0; i < m; i++) {
    int v = x[i];
    if ((diff - 9 + v) > 0) {
      x[i] = 9;
      diff = diff - 9 + v;
    } else {
      x[i] = v + diff;
      break;
    }
  }
  return x;
}
vector<int> equalSum(vector<int> y, int in, int Tsum) {
  int ind = 0;
  int sum = 0;
  while (y[ind] == 0) {
    sum += y[ind];
    ind++;
  }
  y[ind]--;
  sum += y[ind];
  ind++;
  while (y[ind] == 9 && ind < y.size()) {
    ind++;
    sum += 9;
  }
  if (ind >= y.size()) return getMini(y.size() + 1, Tsum);
  if ((ind - in) > 1) {
    vector<int> part = getMiniPart(ind - in, sum);
    for (int i = in; i < ind; i++) y[i] = part[i - in];
  }
  y[ind]++;
  return y;
}
vector<int> decSum(vector<int> x, int diff, int Tsum) {
  int i;
  if (diff == 0) {
    return equalSum(x, 0, Tsum);
  }
  for (i = 0; i < x.size(); i++) {
    if (diff == 0) {
      return equalSum(x, 0, Tsum);
    }
    if (diff > x[i]) {
      diff -= x[i];
      x[i] = 0;
    } else {
      x[i] -= diff;
      diff = 0;
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> b(n);
  for (int i = 0; i < n; i++) cin >> (b[i]);
  int numDigit;
  int prevNumDigit = 0;
  vector<int> a;
  for (vector<int>::iterator it = b.begin(); it != b.end(); it++) {
    numDigit = (*it) / 9 + 1;
    if ((*it) % 9 == 0) numDigit--;
    if (prevNumDigit < numDigit) {
      a = getMini(numDigit, (*it));
    } else if (a[a.size() - 1] >= (*it)) {
      a = getMini(prevNumDigit + 1, (*it));
    } else {
      int diff = (*it) - *(it - 1);
      if (diff > 0)
        a = increaseSum(a, diff);
      else
        a = decSum(a, -diff, (*it));
    }
    prevNumDigit = a.size();
    printOut(a);
  }
  return 0;
}
