#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 100005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas,ok[Nmax];
int n;

inline bool Ok(int nrcif, int suma)
{
    int i,j,scur;
    if(nrcif==0 && suma==0) return true;
    if(nrcif==0) return false;
    if(suma<0)  return false;
    for(i=1,scur=0;i<=nrcif;++i)
        for(j=0;j<=9;++j)
        {
            if(suma-scur-j>=0 && suma-scur-j<=9*(nrcif-i))
            {
                ok[i]=j; scur+=j; break;
            }
            if(j==10) return false;
        }
    if(scur==suma) return true;
}

inline bool Egal()
{
    int nrcif,pref,i;
    nrcif=last[0];
    for(pref=last[0]-1;pref>=0;--pref)
    {
        int aux=0;
        for(i=1;i<=pref;++i) aux+=last[i];
        for(i=last[pref+1]+1;i<=9;++i)
            if(Ok(nrcif-pref-1,sum[pas]-i-aux))
            {
                last[pref+1]=i;
                for(i=pref+2;i<=nrcif;++i) last[i]=ok[i-pref-1];
                return true;
            }
    }
    return false;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=100;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas;
int n;

inline bool Full9(int poz)
{
    int i;
    for(i=poz;i<=last[0];++i)
        if(last[i]!=9) return false;
    return true;
}

inline bool Ok(int poz, int S)
{
    for(int i=poz;i<=last[0] && S;++i)
        if(last[i]!=min(S,9)) return false;
        else S-=min(S,9);
    return true;
}

inline bool Egal()
{
        int nrcif,i,limit,ok,scur,poz;
        nrcif=last[0];
        if(nrcif==1) limit=last[1]+1;
        else limit=last[1];
        if(limit==last[1] && Full9(2)) ++limit;
        if(limit==last[1] && Ok(2,sum[pas]-limit)) ++limit;
        for(i=limit;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) return false;
        ok=0;
        if(i>last[1]) ok=1;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            if(ok) limit=0;
            else
                if(poz<nrcif)
                    limit=last[poz];
                else
                    limit=last[poz]+1;
            if(!ok && limit==last[poz] && Full9(poz+1) && poz<nrcif) ++limit;
            if(!ok && limit==last[poz] && Ok(poz+1,sum[pas]-scur-limit) && poz<nrcif) ++limit;
            for(i=limit;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            //if(pas==22) cout<<i<<"\n";
            if(i==10) return false;
            if(!ok && i>last[poz]) ok=1;
            a[poz]=i; scur+=i;
        }
        last[0]=nrcif;
        for(i=1;i<=nrcif;++i) last[i]=a[i];
        return true;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=100;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1000005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas,ok[Nmax];
int n;

inline bool Ok(int nrcif, int suma)
{
    int i,j,scur;
    if(nrcif==0 && suma==0) return true;
    if(nrcif==0) return false;
    if(suma<0)  return false;
    for(i=1,scur=0;i<=nrcif;++i)
        for(j=0;j<=9;++j)
        {
            if(suma-scur-j>=0 && suma-scur-j<=9*(nrcif-i))
            {
                ok[i]=j; scur+=j; break;
            }
            if(j==10) return false;
        }
    if(scur==suma) return true;
}

inline bool Egal()
{
    int nrcif,pref,i;
    nrcif=last[0];
    for(pref=last[0]-1;pref>=0;--pref)
    {
        int aux=0;
        for(i=1;i<=pref;++i) aux+=last[i];
        for(i=last[pref+1]+1;i<=9;++i)
            if(Ok(nrcif-pref-1,sum[pas]-i-aux))
            {
                last[pref+1]=i;
                for(i=pref+2;i<=nrcif;++i) last[i]=ok[i-pref-1];
                return true;
            }
    }
    return false;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=1000000;++nrcif)
    {
        ok=1;
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas,ok[Nmax];
int n;

inline bool Ok(int nrcif, int suma)
{
    int i,j,scur;
    if(nrcif==0 && suma==0) return true;
    if(nrcif==0) return false;
    if(suma<0)  return false;
    for(i=1,scur=0;i<=nrcif;++i)
        for(j=0;j<=9;++j)
        {
            if(suma-scur-j>=0 && suma-scur-j<=9*(nrcif-i))
            {
                ok[i]=j; scur+=j; break;
            }
            if(j==10) return false;
        }
    if(scur==suma) return true;
}

inline bool Egal()
{
    int nrcif,pref,i;
    nrcif=last[0];
    for(pref=last[0]-1;pref>=0;--pref)
    {
        int aux=0;
        for(i=1;i<=pref;++i) aux+=last[i];
        for(i=last[pref+1]+1;i<=9;++i)
            if(Ok(nrcif-pref-1,sum[pas]-i-aux))
            {
                last[pref+1]=i;
                for(i=pref+2;i<=nrcif;++i) last[i]=ok[i-pref-1];
                return true;
            }
    }
    return false;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=100;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas;
int n;

inline bool Full9(int poz)
{
    int i;
    for(i=poz;i<=last[0];++i)
        if(last[i]!=9) return false;
    return true;
}

inline bool Ok(int poz, int S)
{
    for(int i=poz;i<=last[0] && S;++i)
        if(last[i]!=min(S,9)) return false;
        else S-=min(S,9);
    return true;
}

inline bool Egal()
{
        int nrcif,i,limit,ok,scur,poz;
        nrcif=last[0];
        if(nrcif==1) limit=last[1]+1;
        else limit=last[1];
        if(!ok && limit==last[1] && Full9(2)) ++limit;
        if(!ok && limit==last[1] && Ok(2,sum[pas]-limit)) ++limit;
        for(i=limit;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) return false;
        ok=0;
        if(i>last[1]) ok=1;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            if(ok) limit=0;
            else
                if(poz<nrcif)
                    limit=last[poz];
                else
                    limit=last[poz]+1;
            if(!ok && limit==last[poz] && Full9(poz+1) && poz<nrcif) ++limit;
            if(!ok && limit==last[poz] && Ok(poz+1,sum[pas]-scur-limit) && poz<nrcif) ++limit;
            for(i=limit;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            //if(pas==22) cout<<i<<"\n";
            if(i==10) return false;
            if(!ok && i>last[poz]) ok=1;
            a[poz]=i; scur+=i;
        }
        last[0]=nrcif;
        for(i=1;i<=nrcif;++i) last[i]=a[i];
        return true;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=100;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 100005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas,ok[Nmax];
int n;

inline bool Ok(int nrcif, int suma)
{
    int i,j,scur;
    if(nrcif==0 && suma==0) return true;
    if(nrcif==0) return false;
    if(suma<0)  return false;
    for(i=1,scur=0;i<=nrcif;++i)
        for(j=0;j<=9;++j)
        {
            if(suma-scur-j>=0 && suma-scur-j<=9*(nrcif-i))
            {
                ok[i]=j; scur+=j; break;
            }
            if(j==10) return false;
        }
    if(scur==suma) return true;
}

inline bool Egal()
{
    int nrcif,pref,i;
    nrcif=last[0];
    for(pref=last[0]-1;pref>=0;--pref)
    {
        int aux=0;
        for(i=1;i<=pref;++i) aux+=last[i];
        for(i=last[pref+1]+1;i<=9;++i)
            if(Ok(nrcif-pref-1,sum[pas]-i-aux))
            {
                last[pref+1]=i;
                for(i=pref+2;i<=nrcif;++i) last[i]=ok[i-pref-1];
                return true;
            }
    }
    return false;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=1000;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas;
int n;

inline bool Full9(int poz)
{
    int i;
    for(i=poz;i<=last[0];++i)
        if(last[i]!=9) return false;
    return true;
}

inline bool Egal()
{
        int nrcif,i,limit,ok,scur,poz;
        nrcif=last[0];
        if(nrcif==1) limit=last[1]+1;
        else limit=last[1];
        for(i=limit;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) return false;
        ok=0;
        if(i>last[1]) ok=1;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            if(ok) limit=0;
            else
                if(poz<nrcif)
                    limit=last[poz];
                else
                    limit=last[poz]+1;
            if(limit==last[poz] && Full9(poz+1)) ++limit;
            for(i=limit;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) return false;
            if(!ok && i>last[poz]) ok=1;
            a[poz]=i; scur+=i;
        }
        last[0]=nrcif;
        for(i=1;i<=nrcif;++i) last[i]=a[i];
        return true;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=100;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas;
int n;

inline bool Egal()
{
        int nrcif,i,limit,ok,scur,poz;
        nrcif=last[0];
        for(i=last[1];i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) return false;
        ok=0;
        if(i>last[1]) ok=1;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            if(ok) limit=0;
            else limit=last[poz];
            for(i=limit;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) return false;
            if(!ok && i>last[poz]) ok=1;
            a[poz]=i; scur+=i;
        }
        last[0]=nrcif;
        for(i=1;i<=nrcif;++i) last[i]=a[i];
        return true;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=100;++nrcif)
    {
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define MOD 1000000007
#define Nmax 1000005
#define INF 2000000000
#define eps 0.000000000001

using namespace std;

int sum[Nmax],last[Nmax],a[Nmax],pas,ok[Nmax];
int n;

inline bool Ok(int nrcif, int suma)
{
    int i,j,scur;
    if(nrcif==0 && suma==0) return true;
    if(nrcif==0) return false;
    if(suma<0)  return false;
    for(i=1,scur=0;i<=nrcif;++i)
        for(j=0;j<=9;++j)
        {
            if(suma-scur-j>=0 && suma-scur-j<=9*(nrcif-i))
            {
                ok[i]=j; scur+=j; break;
            }
            if(j==10) return false;
        }
    if(scur==suma) return true;
    return false;
}

inline bool Egal()
{
    int nrcif,pref,i;
    nrcif=last[0];
    for(pref=last[0]-1;pref>=0;--pref)
    {
        int aux=0;
        for(i=1;i<=pref;++i) aux+=last[i];
        for(i=last[pref+1]+1;i<=9;++i)
            if(Ok(nrcif-pref-1,sum[pas]-i-aux))
            {
                last[pref+1]=i;
                for(i=pref+2;i<=nrcif;++i) last[i]=ok[i-pref-1];
                return true;
            }
    }
    return false;
}

inline void Solve()
{
    if(Egal()) return;
    int poz,i,scur,ok,nrcif;
    for(nrcif=last[0]+1,ok=1;nrcif<=1000000;++nrcif)
    {
        ok=1;
        for(i=1;i<=9;++i)
            if(sum[pas]-i>=0 && sum[pas]-i<=9*(nrcif-1)) break;
        if(i==10) ok=0;
        a[1]=i; scur=i;
        for(poz=2;poz<=nrcif;++poz)
        {
            for(i=0;i<=9;++i)
                if(sum[pas]-scur-i>=0 && sum[pas]-scur-i<=9*(nrcif-poz)) break;
            if(i==10) ok=0;
            a[poz]=i; scur+=i;
        }
        if(ok)
        {
            last[0]=nrcif;
            for(i=1;i<=nrcif;++i) last[i]=a[i];
            return;
        }
    }
}

int main()
{
    int i,j;
    #ifndef ONLINE_JUDGE
        freopen ("date.in","r",stdin);
        freopen ("date.out","w",stdout);
    #endif
    cin.sync_with_stdio(0);
    cin>>n;
    for(i=1;i<=n;++i) cin>>sum[i];
    last[0]=1; last[1]=0;
    for(pas=1;pas<=n;++pas)
    {
        Solve();
        for(j=1;j<=last[0];++j) cout<<last[j];
        cout<<"\n";
    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int check(string a, string b)
{
    if(a.size() < b.size())
        return -1;
    else if(a.size() > b.size())
        return 1;
    else
    {
        for(int i = 0; i < a.size(); ++i)
        {
            if(a[i] > b[i])
                return 1;
            else if(a[i] < b[i])
                return -1;
        }
    }
    return 0;
}

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            int bit = b/9;
            string smallnum;
            for(int j = 0; j < bit; ++j)
            {
                smallnum.push_back('9');
            }

            if(b%9)
            {
                char c = b%9 + '0';
                smallnum = c+smallnum;
            }

            if(i == 0)
            {
                arr[i] = smallnum;
                presum = b;
                cout<<arr[i]<<endl;
                continue;
            }

            if(check(arr[i-1], smallnum) < 0)
            {
                arr[i] = smallnum;
            }
            else
            {
                int delt = presum-b;
                arr[i] = arr[i-1];
                if(delt < 0)
                {
                    delt = -delt;
                    for(int j = arr[i].size()-1; j >= 0 && delt; --j)
                    {
                        if(arr[i][j] != '9')
                        {
                            int d = 9-(arr[i][j]-'0');
                            if(d >= delt)
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                            else
                            {
                                delt -= d;
                                arr[i][j] = '9';
                            }
                        }
                    }
                    while(delt)
                    {
                        int d = min(delt, 9);
                        char c = d + '0';
                        arr[i] = c + arr[i];
                        delt -= d;
                    }
                }
                else
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '0')
                        r--;

                    int l = r-1;
                    while(l >=0 && arr[i][l] == '9')
                        l--;

                    r = l+1;
                    while(r < arr[i].size() && arr[i][r] == '0')
                        r++;
                    arr[i][r] -= 1;
                    if(l < 0)
                    {
                        char c = '1';
                        arr[i] = c + arr[i];
                        r = 1;
                        l = 0;
                    }
                    else
                    {
                        arr[i][l] += 1;
                    }

                    int j = arr[i].size()-1;
                    while(j >= 0 && delt > 0)
                    {
                        int num = arr[i][j]-'0';
                        if(num >= delt)
                        {
                            arr[i][j] -= delt;
                            delt = 0;
                            break;
                        }
                        else
                        {
                            arr[i][j] = '0';
                            delt -= num;
                        }
                        j--;
                    }
                    if(j <= l)
                    {
                        if(j > 0)
                        {
                            j--;
                            while(arr[i][j] == '9')
                                j--;
                        }
                        if(j == 0)
                        {
                            arr[i][j] -= 1;
                            char c = '1';
                            arr[i] = c+arr[i];
                        }
                        else
                        {
                            arr[i][j] += 1;
                        }
                        int j = arr[i].size()-1;
                        while(arr[i][j] == '0')
                            j--;
                        arr[i][j] -= 1;
                    }

                }

            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int check(string a, string b)
{
    if(a.size() < b.size())
        return -1;
    else if(a.size() > b.size())
        return 1;
    else
    {
        for(int i = 0; i < a.size(); ++i)
        {
            if(a[i] > b[i])
                return 1;
            else if(a[i] < b[i])
                return -1;
        }
    }
    return 0;
}

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            int bit = b/9;
            string smallnum;
            for(int j = 0; j < bit; ++j)
            {
                smallnum.push_back('9');
            }

            if(b%9)
            {
                char c = b%9 + '0';
                smallnum = c+smallnum;
            }

            if(i == 0)
            {
                arr[i] = smallnum;
                presum = b;
                cout<<arr[i]<<endl;
                continue;
            }

            if(check(arr[i-1], smallnum) < 0)
            {
                arr[i] = smallnum;
            }
            else
            {
                int delt = presum-b;
                arr[i] = arr[i-1];
                if(delt < 0)
                {
                    delt = -delt;
                    for(int j = arr[i].size()-1; j >= 0 && delt; --j)
                    {
                        if(arr[i][j] != '9')
                        {
                            int d = 9-(arr[i][j]-'0');
                            if(d >= delt)
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                            else
                            {
                                delt -= d;
                                arr[i][j] = '9';
                            }
                        }
                    }
                    while(delt)
                    {
                        int d = min(delt, 9);
                        char c = d + '0';
                        arr[i] = c + arr[i];
                        delt -= d;
                    }
                }
                else if(delt == 0)
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '0')
                    {
                        r--;
                    }
                    int l = r-1;
                    while(l >= 0 && arr[i][l] == '9')
                    {
                        l--;
                    }
                    if(l >= 0)
                    {
                        arr[i][l] += 1;
                        int cursum = 0;
                        for(int j = 0; j <= l; ++j)
                            cursum += arr[i][j] - '0';
                        for(int j = l+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int dsum = b - cursum;
                        int didx = arr[i].size()-1;
                        while(dsum)
                        {
                            if(dsum <= 9)
                            {
                                arr[i][didx] = dsum+'0';
                                dsum = 0;
                                break;
                            }
                            else
                            {
                                arr[i][didx] = '9';
                                dsum -= 9;
                            }
                            didx--;
                        }
                    }
                    else
                    {
                        arr[i] = '1' + arr[i];
                        for(int j = 1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int sz = arr[i].size()-1;
                        int snsz = smallnum.size()-1;
                        for(int j = 0; j < smallnum.size(); ++j)
                        {
                            arr[i][sz-j] = smallnum[snsz-j];
                        }
                        arr[i][sz-snsz] -= 1;

                    }
                }
                else
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '9')
                        r--;
                    if(r < 0)
                    {
                        char c = '1';
                        arr[i] = c + arr[i];
                        for(int j = 1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int cursum = b-1;
                        int curidx = arr[i].size()-1;
                        while(curidx >= 0 && cursum)
                        {
                            if(cursum <= 9)
                            {
                                arr[i][curidx] = cursum+'0';
                                break;
                            }
                            else
                            {
                                arr[i][curidx] = '9';
                                curidx--;
                                cursum -= 9;
                            }
                        }

                    }
                    else
                    {
                        arr[i][r] += 1;
                        for(int j = r+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int cursum = 0;
                        for(int j = 0; j < arr[i].size(); ++j)
                            cursum += arr[i][j] - '0';
                        while(cursum > b)
                        {
                            int pos = -1;
                            for(int j = arr[i].size()-1; j >= 0; --j)
                            {
                                if(arr[i][j] != '0')
                                {
                                    pos = j-1;
                                    break;
                                }

                            }
                            if(pos >= 0)
                            {
                                if(arr[i][pos] != '9')
                                {
                                    arr[i][pos] += 1;
                                    arr[i][pos+1] = '0';
                                }
                                else
                                {
                                    pos--;
                                }
                            }
                            if(pos < 0)
                            {
                                char c = '1';
                                arr[i] = c + arr[i];
                                for(int j = 1; j < arr[i].size(); ++j)
                                    arr[i][j] = '0';
                            }
                            cursum = 0;
                            for(int j = 0; j < arr[i].size(); ++j)
                                cursum += arr[i][j]-'0';

                        }
                        if(cursum < b)
                        {
                            int d = b - cursum;
                            int didx = arr[i].size()-1;
                            while(d)
                            {
                                int td = '9' - arr[i][didx];
                                if(td >= d)
                                {
                                    arr[i][didx] += d;
                                    break;
                                }
                                else
                                {
                                    arr[i][didx] = '9';
                                    d -= td;
                                    didx--;
                                }
                            }
                        }
                    }
                }

            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            if(i == 0)
            {
                int bit = b/9;
                for(int j = 0; j < bit; ++j)
                    arr[0].push_back('9');
                int res = b%9;
                if(res)
                {
                    char c = res + '0';
                    arr[0] = c + arr[0];
                }
            }
            else
            {
                arr[i] = arr[i-1];
                if(presum < b)
                {
                    int delt = b - presum;
                    for(int j = arr[i].size()-1; j >= 0 && delt > 0; --j)
                    {
                        int d = '9' - arr[i][j];
                        if(d >= delt)
                        {
                            arr[i][j] += delt;
                        }
                        else
                        {
                            arr[i][j] = '9';
                        }
                        delt -= d;

                    }
                    if(delt > 0)
                    {
                        int bit = delt/9;
                        string s;
                        for(int j = 0; j < bit; ++j)
                            s.push_back('9');
                        int res = b%9;
                        if(res)
                        {
                            char c = res + '0';
                            s = c + s;
                        }
                        arr[i] = s + arr[i];
                    }

                }
                else
                {
                    int cursum = presum;
                    string s = arr[i];
                    for(int j = arr[i].size()-1; j >= 0; --j)
                    {
                        cursum -= s[j] - '0';
                        s[j] = '0';
                        int high = j-1;
                        for(; high >= 0; --high)
                        {
                            if(s[high] != '9')
                            {
                                s[high] += 1;
                                cursum += 1;
                                break;
                            }
                        }
                        if(high < 0)
                        {
                            s = '1' + s;
                            cursum += 1;
                            high = 0;
                            j++;
                        }
                        if(cursum <= b)
                        {
                            int delt = b - cursum;
                            for(int k = s.size()-1; k >= 0; --k)
                            {
                                int d = '9' - s[k];
                                if(delt <= d)
                                {
                                    s[k] += delt;
                                    delt = 0;
                                    break;
                                }
                                else
                                {
                                    s[k] = '9';
                                    delt -= d;
                                }
                            }
                            arr[i] = s;
                            if(delt > 0)
                            {
                                int bit = delt/9;
                                string s;
                                for(int j = 0; j < bit; ++j)
                                    s.push_back('9');
                                int res = b%9;
                                if(res)
                                {
                                    char c = res + '0';
                                    s = c + s;
                                }
                                arr[i] = s + arr[i];
                            }
                            break;
                        }
                        else
                        {
                            int delt = cursum - b;
                            for(int k = s.size()-1; k > high; --k)
                            {
                                int d = s[k] - '0';
                                if(d >= delt)
                                {
                                    s[k] -= delt;
                                    delt = 0;
                                    break;
                                }
                                else
                                {
                                    s[k] = '0';
                                    delt -= d;
                                }
                            }
                            if(delt == 0)
                            {
                                arr[i] = s;
                                break;
                            }
                        }
                    }
                }
            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;
//namespace codeforce289{
int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            if(i == 0)
            {
                int bit = b/9;
                for(int j = 0; j < bit; ++j)
                    arr[0].push_back('9');
                int res = b%9;
                if(res)
                {
                    char c = res + '0';
                    arr[0] = c + arr[0];
                }
            }
            else
            {
                arr[i] = arr[i-1];
                int sum = 0;
                int pos = arr[i].size() - 1;
                while(pos >= 0 && arr[i][pos] == '9')
                {
                    arr[i][pos] = '0';
                    pos--;
                }

                if(pos < 0)
                    arr[i] = '1' + arr[i];
                else
                    arr[i][pos] += 1;

                for(int j = 0; j < arr[i].size(); ++j)
                    sum += arr[i][j] - '0';

                while(sum != b)
                {
                    if(sum < b)
                    {
                        int delt = b - sum;
                        for(int j = arr[i].size()-1; j >= 0; --j)
                        {
                            int d = 9 - (arr[i][j] - '0');
                            if(d < delt)
                            {
                                arr[i][j] = '9';
                                delt -= d;
                            }
                            else
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                        }
                        if(delt)
                        {
                            arr[i] = '1' + arr[i];
                            for(int j = 1; j < arr[i].size(); ++j)
                                arr[i][j] = '0';
                        }
                    }
                    else
                    {
                        int delt = sum - b;
                        int p = pos;
                        while(p >= 0 && arr[i][p] == '9')
                        {
                            p--;
                        }
                        if(p >= 0)
                        {
                            arr[i][p] += 1;
                        }
                        else
                        {
                            arr[i] = '1' + arr[i];
                            p = 0;
                        }
                        for(int j = p+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        pos = p;
                    }
                    sum = 0;
                    for(int j = 0; j < arr[i].size(); ++j)
                        sum += arr[i][j] - '0';
                }
            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int check(string a, string b)
{
    if(a.size() < b.size())
        return -1;
    else if(a.size() > b.size())
        return 1;
    else
    {
        for(int i = 0; i < a.size(); ++i)
        {
            if(a[i] > b[i])
                return 1;
            else if(a[i] < b[i])
                return -1;
        }
    }
    return 0;
}

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            int bit = b/9;
            string smallnum;
            for(int j = 0; j < bit; ++j)
            {
                smallnum.push_back('9');
            }

            if(b%9)
            {
                char c = b%9 + '0';
                smallnum = c+smallnum;
            }

            if(i == 0)
            {
                arr[i] = smallnum;
                presum = b;
                cout<<arr[i]<<endl;
                continue;
            }

            if(check(arr[i-1], smallnum) < 0)
            {
                arr[i] = smallnum;
            }
            else
            {
                int delt = presum-b;
                arr[i] = arr[i-1];
                if(delt < 0)
                {
                    delt = -delt;
                    for(int j = arr[i].size()-1; j >= 0 && delt; --j)
                    {
                        if(arr[i][j] != '9')
                        {
                            int d = 9-(arr[i][j]-'0');
                            if(d >= delt)
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                            else
                            {
                                delt -= d;
                                arr[i][j] = '9';
                            }
                        }
                    }
                    while(delt)
                    {
                        int d = min(delt, 9);
                        char c = d + '0';
                        arr[i] = c + arr[i];
                        delt -= d;
                    }
                }
                else
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '0')
                        r--;

                    int l = r-1;
                    while(l >=0 && arr[i][l] == '9')
                        l--;
                    if(l < 0)
                    {
                        char c = '1';
                        arr[i] = c + arr[i];
                        l = 0;
                    }
                    else
                    {
                        arr[i][l] += 1;
                    }

                    r = l+1;
                    while(r < arr[i].size() && arr[i][r] == '0')
                        r++;
                    arr[i][r] -= 1;

                    int j = arr[i].size()-1;
                    while(j >= 0 && delt > 0)
                    {
                        int num = arr[i][j]-'0';
                        if(num >= delt)
                        {
                            arr[i][j] -= delt;
                            delt = 0;
                            break;
                        }
                        else
                        {
                            arr[i][j] = '0';
                            delt -= num;
                        }
                        j--;
                    }
                    if(j <= l)
                    {
                        if(j > 0)
                        {
                            j--;
                            while(arr[i][j] == '9')
                                j--;
                        }
                        if(j == 0)
                        {
                            char c = '1';
                            arr[i] = c+arr[i];
                        }
                        else
                        {
                            arr[i][j] += 1;
                        }
                        int j = arr[i].size()-1;
                        while(arr[i][j] == '0')
                            j--;
                        arr[i][j] -= 1;
                    }

                }

            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            if(i == 0)
            {
                int bit = b/9;
                for(int j = 0; j < bit; ++j)
                    arr[0].push_back('9');
                int res = b%9;
                if(res)
                {
                    char c = res + '0';
                    arr[0] = c + arr[0];
                }
            }
            else
            {
                arr[i] = arr[i-1];
                if(presum < b)
                {
                    int delt = b - presum;
                    for(int j = arr[i].size()-1; j >= 0 && delt > 0; --j)
                    {
                        int d = '9' - arr[i][j];
                        if(d >= delt)
                        {
                            arr[i][j] += delt;
                        }
                        else
                        {
                            arr[i][j] = '9';
                        }
                        delt -= d;

                    }
                    if(delt > 0)
                    {
                        int bit = delt/9;
                        string s;
                        for(int j = 0; j < bit; ++j)
                            s.push_back('9');
                        int res = b%9;
                        if(res)
                        {
                            char c = res + '0';
                            s = c + s;
                        }
                        arr[i] = s + arr[i];
                    }

                }
                else
                {
                    int cursum = presum;
                    string s = arr[i];
                    for(int j = arr[i].size()-1; j >= 0; --j)
                    {
                        cursum -= s[j] - '0';
                        s[j] = '0';
                        int k = j-1;
                        for(; k >= 0; --k)
                        {
                            if(s[k] != '9')
                            {
                                s[k] += 1;
                                cursum += 1;
                                break;
                            }
                        }
                        if(k < 0)
                        {
                            s = '1' + s;
                            cursum += 1;
                        }
                        if(cursum <= b)
                        {
                            int delt = b - cursum;
                            for(int k = s.size()-1; k >= 0; --k)
                            {
                                int d = '9' - s[k];
                                if(delt <= d)
                                {
                                    s[k] += delt;
                                    delt = 0;
                                    break;
                                }
                                else
                                {
                                    s[k] = '9';
                                    delt -= d;
                                }
                            }
                            arr[i] = s;
                            if(delt > 0)
                            {
                                int bit = delt/9;
                                string s;
                                for(int j = 0; j < bit; ++j)
                                    s.push_back('9');
                                int res = b%9;
                                if(res)
                                {
                                    char c = res + '0';
                                    s = c + s;
                                }
                                arr[i] = s + arr[i];
                            }
                            break;
                        }
                    }
                }
            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;
//namespace codeforce289{
int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            if(i == 0)
            {
                int bit = b/9;
                for(int j = 0; j < bit; ++j)
                    arr[0].push_back('9');
                int res = b%9;
                if(res)
                {
                    char c = res + '0';
                    arr[0] = c + arr[0];
                }
            }
            else
            {
                arr[i] = arr[i-1];
                int sum = 0;
                int pos = arr[i].size() - 1;
                while(pos >= 0 && arr[i][pos] == '9')
                {
                    arr[i][pos] = '0';
                    pos--;
                }

                if(pos < 0)
                    arr[i] = '1' + arr[i];
                else
                    arr[i][pos] += 1;

                for(int j = 0; j < arr[i].size(); ++j)
                    sum += arr[i][j] - '0';

                while(sum != b)
                {
                    if(sum < b)
                    {
                        int delt = b - sum;
                        for(int j = arr[i].size()-1; j >= 0; --j)
                        {
                            int d = 9 - (arr[i][j] - '0');
                            if(d < delt)
                            {
                                arr[i][j] = '9';
                                delt -= d;
                            }
                            else
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                        }
                        if(delt)
                        {
                            arr[i] = '1' + arr[i];
                            for(int j = 1; j < arr[i].size(); ++j)
                                arr[i][j] = '0';
                        }
                    }
                    else
                    {
                        int delt = sum - b;
                        int p = arr[i].size()-1;
                        while(p >= 0 && arr[i][p] == '9')
                        {
                            p--;
                        }
                        if(p >= 0)
                        {
                            arr[i][p] += 1;
                        }
                        else
                        {
                            arr[i] = '1' + arr[i];
                            p = 0;
                        }
                        for(int j = p+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';

                    }
                    sum = 0;
                    for(int j = 0; j < arr[i].size(); ++j)
                        sum += arr[i][j] - '0';
                }
            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int check(string a, string b)
{
    if(a.size() < b.size())
        return -1;
    else if(a.size() > b.size())
        return 1;
    else
    {
        for(int i = 0; i < a.size(); ++i)
        {
            if(a[i] > b[i])
                return 1;
            else if(a[i] < b[i])
                return -1;
        }
    }
    return 0;
}

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            int bit = b/9;
            string smallnum;
            for(int j = 0; j < bit; ++j)
            {
                smallnum.push_back('9');
            }

            if(b%9)
            {
                char c = b%9 + '0';
                smallnum = c+smallnum;
            }

            if(i == 0)
            {
                arr[i] = smallnum;
                presum = b;
                cout<<arr[i]<<endl;
                continue;
            }

            if(check(arr[i-1], smallnum) < 0)
            {
                arr[i] = smallnum;
            }
            else
            {
                int delt = presum-b;
                arr[i] = arr[i-1];
                if(delt < 0)
                {
                    delt = -delt;
                    for(int j = arr[i].size()-1; j >= 0 && delt; --j)
                    {
                        if(arr[i][j] != '9')
                        {
                            int d = 9-(arr[i][j]-'0');
                            if(d >= delt)
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                            else
                            {
                                delt -= d;
                                arr[i][j] = '9';
                            }
                        }
                    }
                    while(delt)
                    {
                        int d = min(delt, 9);
                        char c = d + '0';
                        arr[i] = c + arr[i];
                        delt -= d;
                    }
                }
                else if(delt == 0)
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '0')
                    {
                        r--;
                    }
                    int l = r-1;
                    while(l >= 0 && arr[i][l] == '9')
                    {
                        l--;
                    }
                    r = l+1;
                    while(r < arr[i].size() && arr[i][r] == '0')
                        r++;
                    if(l >= 0)
                    {
                        arr[i][l] += 1;
                        arr[i][r] -= 1;
                        if(arr[i][0] == '0')
                        {
                            arr[i][0] = '2';
                            arr[i][r] -= 2;
                        }
                    }
                    else
                    {
                        arr[i] = '1' + arr[i];
                        for(int j = 1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int sz = arr[i].size()-1;
                        int snsz = smallnum.size()-1;
                        for(int j = 0; j < smallnum.size(); ++j)
                        {
                            arr[i][sz-j] = smallnum[snsz-j];
                        }
                        arr[i][sz-snsz] -= 1;

                    }
                }
                else
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '9')
                        r--;
                    if(r < 0)
                    {
                        char c = '1';
                        arr[i] = c + arr[i];
                        for(int j = 1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int cursum = b-1;
                        int curidx = arr[i].size()-1;
                        while(curidx >= 0 && cursum)
                        {
                            if(cursum <= 9)
                            {
                                arr[i][curidx] = cursum+'0';
                                break;
                            }
                            else
                            {
                                arr[i][curidx] = '9';
                                curidx--;
                                cursum -= 9;
                            }
                        }

                    }
                    else
                    {
                        arr[i][r] += 1;
                        for(int j = r+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int cursum = 0;
                        for(int j = 0; j < arr[i].size(); ++j)
                            cursum += arr[i][j] - '0';
                        while(cursum > b)
                        {
                            int pos = -1;
                            for(int j = arr[i].size()-1; j >= 0; --j)
                            {
                                if(arr[i][j] != '0')
                                {
                                    pos = j-1;
                                    break;
                                }

                            }
                            if(pos >= 0)
                            {
                                if(arr[i][pos] != '9')
                                {
                                    arr[i][pos] += 1;
                                    arr[i][pos+1] = '0';
                                }
                                else
                                {
                                    pos--;
                                }
                            }
                            if(pos < 0)
                            {
                                char c = '1';
                                arr[i] = c + arr[i];
                                for(int j = 1; j < arr[i].size(); ++j)
                                    arr[i][j] = '0';
                            }
                            cursum = 0;
                            for(int j = 0; j < arr[i].size(); ++j)
                                cursum += arr[i][j]-'0';

                        }
                        if(cursum < b)
                        {
                            int d = b - cursum;
                            int didx = arr[i].size()-1;
                            while(d)
                            {
                                int td = '9' - arr[i][didx];
                                if(td >= d)
                                {
                                    arr[i][didx] += d;
                                    break;
                                }
                                else
                                {
                                    arr[i][didx] = '9';
                                    d -= td;
                                    didx--;
                                }
                            }
                        }
                    }
                }

            }

            presum = b;
            cout<<arr[i]<<endl;
        }

    }
    return 0;
}


#include <string.h>
#include <iostream>
#include <stdio.h>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <stdlib.h>

using namespace std;

int check(string a, string b)
{
    if(a.size() < b.size())
        return -1;
    else if(a.size() > b.size())
        return 1;
    else
    {
        for(int i = 0; i < a.size(); ++i)
        {
            if(a[i] > b[i])
                return 1;
            else if(a[i] < b[i])
                return -1;
        }
    }
    return 0;
}

int main()
{
    int n, b;
    while(cin>>n)
    {
        string arr[305];
        int presum = 0;
        for(int i = 0; i < n; ++i)
        {
            cin>>b;
            int bit = b/9;
            string smallnum;
            for(int j = 0; j < bit; ++j)
            {
                smallnum.push_back('9');
            }

            if(b%9)
            {
                char c = b%9 + '0';
                smallnum = c+smallnum;
            }

            if(i == 0)
            {
                arr[i] = smallnum;
                presum = b;
                cout<<arr[i]<<endl;
                continue;
            }

            if(check(arr[i-1], smallnum) < 0)
            {
                arr[i] = smallnum;
            }
            else
            {
                int delt = presum-b;
                arr[i] = arr[i-1];
                if(delt < 0)
                {
                    delt = -delt;
                    for(int j = arr[i].size()-1; j >= 0 && delt; --j)
                    {
                        if(arr[i][j] != '9')
                        {
                            int d = 9-(arr[i][j]-'0');
                            if(d >= delt)
                            {
                                arr[i][j] += delt;
                                delt = 0;
                                break;
                            }
                            else
                            {
                                delt -= d;
                                arr[i][j] = '9';
                            }
                        }
                    }
                    while(delt)
                    {
                        int d = min(delt, 9);
                        char c = d + '0';
                        arr[i] = c + arr[i];
                        delt -= d;
                    }
                }
                else if(delt == 0)
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '0')
                    {
                        r--;
                    }
                    int l = r-1;
                    while(l >= 0 && arr[i][l] == '9')
                    {
                        l--;
                    }
                    if(l >= 0)
                    {
                        arr[i][l] += 1;
                        int cursum = 0;
                        for(int j = 0; j <= l; ++j)
                            cursum += arr[i][j] - '0';
                        for(int j = l+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int dsum = b - cursum;
                        int didx = arr[i].size()-1;
                        while(dsum)
                        {
                            if(dsum <= 9)
                            {
                                arr[i][didx] = dsum+'0';
                                dsum = 0;
                                break;
                            }
                            else
                            {
                                arr[i][didx] = '9';
                                dsum -= 9;
                            }
                            didx--;
                        }
                    }
                    else
                    {
                        arr[i] = '1' + arr[i];
                        for(int j = 1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int sz = arr[i].size()-1;
                        int snsz = smallnum.size()-1;
                        for(int j = 0; j < smallnum.size(); ++j)
                        {
                            arr[i][sz-j] = smallnum[snsz-j];
                        }
                        arr[i][sz-snsz] -= 1;

                    }
                }
                else
                {
                    int r = arr[i].size()-1;
                    while(r >= 0 && arr[i][r] == '9')
                        r--;
                    if(r < 0)
                    {
                        char c = '1';
                        arr[i] = c + arr[i];
                        for(int j = 1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int cursum = b-1;
                        int curidx = arr[i].size()-1;
                        while(curidx >= 0 && cursum)
                        {
                            if(cursum <= 9)
                            {
                                arr[i][curidx] = cursum+'0';
                                break;
                            }
                            else
                            {
                                arr[i][curidx] = '9';
                                curidx--;
                                cursum -= 9;
                            }
                        }

                    }
                    else
                    {
                        arr[i][r] += 1;
                        for(int j = r+1; j < arr[i].size(); ++j)
                            arr[i][j] = '0';
                        int cursum = 0;
                        for(int j = 0; j < arr[i].size(); ++j)
                            cursum += arr[i][j] - '0';
                        while(cursum > b)
                        {
                            int pos = -1;
                            for(int j = arr[i].size()-1; j >= 0; --j)
                            {
                                if(arr[i][j] != '0')
                                {
                                    pos = j-1;
                                    break;
                                }

                            }
                            if(pos >= 0)
                            {
                                if(arr[i][pos] != '9')
                                {
                                    arr[i][pos] += 1;
                                    if(pos < arr[i].size()-1)
                                        arr[i][pos+1] = '0';
                                }
                                else
                                {
                                    pos--;
                                }
                            }
                            if(pos < 0)
                            {
                                char c = '1';
                                arr[i] = c + arr[i];
                                for(int j = 1; j < arr[i].size(); ++j)
                                    arr[i][j] = '0';
                            }
                            cursum = 0;
                            for(int j = 0; j < arr[i].size(); ++j)
                                cursum += arr[i][j]-'0';

                        }
                        if(cursum < b)
                        {
                            int d = b - cursum;
                            int didx = arr[i].size()-1;
                            while(d)
                            {
                                int td = '9' - arr[i][didx];
                                if(td >= d)
                                {
                                    arr[i][didx] += d;
                                    break;
                                }
                                else
                                {
                                    arr[i][didx] = '9';
                                    d -= td;
                                    didx--;
                                }
                            }
                        }
                    }
                }

            }

            presum = b;
            cout<<arr[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 and 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];
    }
    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 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 += char('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');

                break;
            }
            for (LL 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, 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 += char('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;

    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 += (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];
    }
    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 + '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;
}