#include <bits/stdc++.h>
using namespace std;
template <int POS, class TUPLE>
void deploy(std::ostream &os, const TUPLE &tuple) {}
template <int POS, class TUPLE, class H, class... Ts>
void deploy(std::ostream &os, const TUPLE &t) {
  os << (POS == 0 ? "" : ", ") << get<POS>(t);
  deploy<POS + 1, TUPLE, Ts...>(os, t);
}
template <class T, class U>
std::ostream &operator<<(std::ostream &os, std::pair<T, U> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::vector<T> &v) {
  int remain = v.size();
  os << "{";
  for (auto e : v) os << e << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::set<T> &v) {
  int remain = v.size();
  os << "{";
  for (auto e : v) os << e << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T, class K>
std::ostream &operator<<(std::ostream &os, std::map<T, K> &make_pair) {
  int remain = make_pair.size();
  os << "{";
  for (auto e : make_pair)
    os << "(" << e.first << " -> " << e.second << ")"
       << (--remain == 0 ? "}" : ", ");
  return os;
}
using ll = long long;
template <typename T>
string to_string(T &x) {
  stringstream is;
  is << x;
  return is.str();
}
int N;
int nums[310];
string ans[310];
string before;
bool memo[310][310][2];
int sum;
int M;
bool go(int now_sum, int now, bool over, string &t) {
  if (now == M) {
    if (over && now_sum == sum) {
      return true;
    } else {
      return false;
    }
  }
  if (memo[now][now_sum][over]) {
    return false;
  }
  memo[now][now_sum][over] = true;
  char c = before[now];
  if (over) {
    c = '0';
  }
  for (; c <= '9'; c++) {
    if (now_sum + (c - '0') <= sum) {
      t += c;
      if (go(now_sum + (c - '0'), now + 1, over || (c > before[now]), t)) {
        return true;
      }
      t.pop_back();
    }
  }
  return false;
}
string solve() {
  M = before.size();
  memset(memo, 0, sizeof(memo));
  {
    string t;
    if (go(0, 0, false, t)) {
      return t;
    }
  }
  int len = before.size() + 1;
  len = max(len, sum / 9 + min(1, sum % 9));
  int now_sum = sum;
  string t(len, '0');
  for (int i = len - 1; i >= 1; i--) {
    t[i] = '0';
    if (now_sum == 1) {
      continue;
    }
    if (now_sum >= 10) {
      t[i] = '9';
      now_sum -= 9;
    } else {
      t[i] = (now_sum - 1) + '0';
      now_sum = 1;
    }
  }
  t[0] = now_sum + '0';
  return t;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cin >> N;
  for (int i = 0; i < (N); i++) {
    cin >> nums[i];
  }
  {
    int sum = nums[0];
    int len = sum / 9 + min(1, sum % 9);
    int now_sum = nums[0];
    string t(len, '0');
    for (int i = len - 1; i >= 1; i--) {
      t[i] = '0';
      if (now_sum == 1) {
        continue;
      }
      if (now_sum >= 10) {
        t[i] = '9';
        now_sum -= 9;
      } else {
        t[i] = (now_sum - 1) + '0';
        now_sum = 1;
      }
    }
    t[0] = now_sum + '0';
    ans[0] = t;
  }
  for (int i = 1; i < (N); i++) {
    before = ans[i - 1];
    sum = nums[i];
    ans[i] = solve();
  }
  for (int i = 0; i < (N); i++) {
    cout << ans[i] << "\n";
  }
  return 0;
}
