#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "0";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = tmp[0] - '0';
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s.push_back(ps[t]);
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += (num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = (tmp[0] - '0');
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = (tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += (sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += (i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += (sum + '0');

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += (i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += (tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = int(tmp[0] - '0');
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = int(tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (len > 0) {
            if (len == 1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = int(ps[i] - '0');

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += char(ps[t]);
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = int(a[i][0] - '0');
        for (j = 2; j <= n; j++) {

            sum[i][j] = int(a[i][j-1] - '0');
            sum[i][j] += sum[i][j-1];

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = (tmp[0] - '0');
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = (LL)(tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += (i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += (sum + '0');

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += (i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += (tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += (LL)(a[i][j-1] - '0');

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = tmp[0] - '0';
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s.push_back(ps[t]);
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[305];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = (tmp[0] - '0');
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += (a[i][j-1] - '0');

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {

        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = tmp[0] - '0';
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0' + sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += sum + '0';
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += i + '0';
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += sum + '0';

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += i + '0';
                    j++;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                    while (t--){
                        s += '0';
                    }
                if (s.size() != 0)
                    reverse(s.begin(), s.end());
                tmp++;
                //cout << "*" << tmp << endl;

                s += tmp + '0';
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    //freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;
    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    //cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1] + a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    rep (i,n) {
        cout << a[i] << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += (num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = (tmp[0] - '0');
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = (tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += (i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += (sum + '0');

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += (i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += ('0');
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += (tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "1";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = int(tmp[0] - '0');
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = int(tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (len > 0) {
            if (len == 1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = int(ps[i] - '0');

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = int(a[i][0] - '0');
        for (j = 2; j <= n; j++) {

            sum[i][j] = int(a[i][j-1] - '0');
            sum[i][j] += sum[i][j-1];

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[305];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += (num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = tmp[0] - '0';
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += (sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += (i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += (sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += (i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += (tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = (tmp[0] - '0');
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = (tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += (i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += (sum + '0');

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += (i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += (tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = tmp[0] - '0';
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0' + sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');
                j++;

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');

                    sum -= i;
                    len--;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    //if (idx == 46) {
    //  cout << "*" << ps << endl;
    //}
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << tmp << endl;
        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //if (idx == 50)
                //cout << "#";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;

                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
            //if (idx == 50)
            //  cout << "*" << s << endl;
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;
                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                    while (t--){
                        s += '0';
                    }
                //if (s.size() != 0)
                //  reverse(s.begin(), s.end());
                tmp++;
                //cout << "*" << tmp << end

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //if (idx == 46)
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1] + a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    //rep (i,n) {
    //  cout << a[i] << endl;
    //}

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[305];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = tmp[0] - '0';
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = (tmp[0] - '0');
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = (tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += (sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += (i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += (sum + '0');

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += (i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += (tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = tmp[0] - '0';
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0' + sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += sum + '0';
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += i + '0';
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += sum + '0';

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += i + '0';
                    j++;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                    while (t--){
                        s += '0';
                    }
                if (s.size() != 0)
                    reverse(s.begin(), s.end());
                tmp++;
                //cout << "*" << tmp << endl;

                s += tmp + '0';
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1] + a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    rep (i,n) {
        cout << a[i] << endl;
    }

    return 0;
}


#include <bits/stdc++.h>

#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long LL.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp prLLf(" "); //PrLL space - psp;
#define pnl prLLf("\n"); //PrLL new line - pnl;

#define p(x) prLLf("%lld", x);  //p(x) is for long long LL.
#define pn(x) prLLf("%lld\n", x);  //..n(x) is for prLLing with New Line.
#define ps(x) prLLf("%lld ", x);  //..s(x) is for prLLing with Space.

#define pi(x) prLLf("%d", x);
#define pin(x) prLLf("%d\n", x);
#define pis(x) prLLf("%d ", x);
#define pf(x) prLLf("%f", x);
#define pfn(x) prLLf("%f\n", x);
#define pfs(x) prLLf("%f ", x);
#define pd(x) prLLf("%lf", x);
#define pdn(x) prLLf("%lf\n", x);
#define pds(x) prLLf("%lf ", x);

typedef long long int LL;
using namespace std;
LL n;
string a[305];
LL b[305];
LL sum[305][400];
int checker = 0;

string solve(LL num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0 and tmp.size() != 0) {
    sum[0][1] = tmp[0] - '0';
    LL i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0' + sum[0][i];
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(LL len, LL sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (LL i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        LL j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');
                j++;

                break;
            }
            for (LL i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');

                    sum -= i;
                    len--;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, LL num, LL idx) {
    //cout << "*" << idx << endl;
    LL len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    LL t;
    LL i;
    //cout << len << endl;
    //if (idx == 46) {
    //  cout << "*" << ps << endl;
    //}
    for (i = len-1; i >=0; i--) {

        LL tmp = ps[i] - '0';

        //cout << tmp << endl;
        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                    while (t--){
                        s += '0';
                    }
                if (s.size() != 0)
                    reverse(s.begin(), s.end());
                tmp++;
                //cout << "*" << tmp << endl;

                s += tmp + '0';
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //if (idx == 46)
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    LL i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    LL j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1] + a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    //rep (i,n) {
    //  cout << a[i] << endl;
    //}

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {

    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }

    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = tmp[0] - '0';
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "1";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = tmp[0] - '0';
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = tmp[i] - '0';
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (j < len) {
            if (j == len-1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = ps[i] - '0';

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = a[i][0] - '0';
        for (j = 2; j <= n; j++) {
            sum[i][j] = sum[i][j-1];
            sum[i][j] += a[i][j-1] - '0';

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}


#include <bits/stdc++.h>
#define f(i, a, n) for (i = a; i < n; i++)
#define fd(i, n, a) for (i = n; i >= a; i--)
#define rep(i,n) f(i,0,n)
#define repd(i,n) f(i, n, 0)
#define pb push_back
#define MOD 1000000007

#define s(x) scanf("%lld", &x); //s(x) is for long long int.
#define si(x) scanf("%d", &x);
#define sf(x) scanf("%f", &x);
#define sd(x) scanf("%lf", &x);
#define ss(x) scanf("%s", x);

#define psp printf(" "); //Print space - psp;
#define pnl printf("\n"); //Print new line - pnl;

#define p(x) printf("%lld", x);  //p(x) is for long long int.
#define pn(x) printf("%lld\n", x);  //..n(x) is for printing with New Line.
#define ps(x) printf("%lld ", x);  //..s(x) is for printing with Space.

#define pi(x) printf("%d", x);
#define pin(x) printf("%d\n", x);
#define pis(x) printf("%d ", x);
#define pf(x) printf("%f", x);
#define pfn(x) printf("%f\n", x);
#define pfs(x) printf("%f ", x);
#define pd(x) printf("%lf", x);
#define pdn(x) printf("%lf\n", x);
#define pds(x) printf("%lf ", x);

typedef long long int LL;
using namespace std;
int n;
string a[305];
int b[306];
int sum[305][400];
int checker = 0;

string solve(int num) {
    string tmp = "";

    while (num > 9) {
        tmp += "9";
        num -= 9;

    }
    if (num > 0 and num < 10) {
        tmp += char(num + '0');
    }
    else if (num >= 10) {
        return "lol";
    }
    if (tmp.size() != 0) {
    reverse(tmp.begin(),tmp.end());
    }
    if (checker == 0) {
        if (tmp.size() != 0) {

    sum[0][1] = int(tmp[0] - '0');
    int i;
    f (i, 1, (tmp.size())) {
        sum[0][i+1] = int(tmp[i] - '0');
        sum[0][i+1]  += sum[0][i];
    }
    }
    checker = 1;
    }

    return tmp;
}
string supersolve(int len, int sum)
{
    string s = "";
    if (len == 1) {
        s += char(sum + '0');
        return s;
    }
    if (sum < 9*len) {
        for (int i = 1; i <= 9; i++) {
            if (9*(len-1) >= (sum-i)) {
                s += char(i + '0');
                sum -= i;
                len--;

                break;
            }
        }
        int j = 0;
        while (len > 0) {
            if (len == 1) {
                s += char(sum + '0');

                break;
            }
            for (int i = 0; i <= 9; i++) {
                if (9*(len-1) >= (sum-i)) {
                    s += char(i + '0');
                    len--;
                    sum -= i;

                    break;
                }
            }
        }
        return s;
    }
    else {
        return solve(sum);
    }
}
string compute (string ps, int num, int idx) {
    //cout << "*" << idx << endl;
    int len = ps.size();
    string s = "";
     //cout << "*" << s.size() << endl;
    //int flag = 0;
    int t;
    int i;
    //
    //cout << len << endl;
    for (i = len-1; i >=0; i--) {

        int tmp = int(ps[i] - '0');

        //cout << i << endl;

        while (tmp < 9) {
            if ((num - (tmp+1) - sum[idx-1][i]) < 0){
                //flag = 1;
                //cout << "*";
                break;
            }
            //if (idx == 3 and i == 2)
            //cout << "#" << tmp << endl;
            if ((num - (tmp+1) - sum[idx-1][i]) > 9*(len-1-i)) {
                tmp++;
                //cout << "#";
                continue;
            }
            //cout << "#" << (num - (1+tmp) - sum[idx-1][i]) << endl;
            //cout << "#" << tmp << endl;
            s = solve ((num - (tmp+1) - sum[idx-1][i]));
        //  if (idx == 1 and i == 0)
            //  cout << "*" << tmp << endl;

                //cout << "*" << idx << endl;
                if (s.size() + i + 1 > len) {
                    tmp++;

                }
                else if (s.size() + i + 1<= len) {

                    //cout << "*";
                    //cout << "*" << idx << endl;
                     t = (len - (s.size()+i+1));
                    // cout << t << "*" <<  endl;
                     if (s.size() != 0)
                         reverse(s.begin(), s.end());
                    while (t--){
                        s += "0";
                    }

                tmp++;
                //cout << "*" << tmp << endl;

                s += char(tmp + '0');
                t = i-1;
                while (t >= 0) {
                    s += ps[t];
                    t--;
                }
                reverse(s.begin(),s.end());
                return s;
                }

        }
    }

    //if (flag == 1) {
        //cout << "#" << len <<" " << num<< endl;;
        s = supersolve(len+1, num);
        return s;
    //}

}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("/home/spharish/input.txt", "r", stdin);
    #endif
    cin >> n;

    int i;
    rep (i,n)  {
        cin >> b[i];
    }

    a[0] = solve(b[0]);
    cout << a[0] << endl;
    int j;
    f(i, 1, n) {
        a[i] = compute(a[i-1], b[i], i);
        cout << a[i] << endl;
        sum[i][1] = int(a[i][0] - '0');
        for (j = 2; j <= n; j++) {

            sum[i][j] = int(a[i][j-1] - '0');
            sum[i][j] += sum[i][j-1];

        }
        //cout << a[i];
    }

    /*rep (i,n) {
        cout << a[i] << endl;
    }*/

    return 0;
}