import java.io.*;

public class code_axel
{
    public static void main(String[] args)
        throws Exception
    {
        StreamTokenizer in = new StreamTokenizer(new InputStreamReader(System.in));
        while (in.nextToken() == StreamTokenizer.TT_NUMBER) {
            int n = (int) in.nval;
            if (n == 0)
                break;

            int m = 1;
            for (int i = 0; i < n; ++i)
                m *= 10;

            boolean[] o = new boolean[m];
            for (int i = 0; i < n; ++i)
                System.out.print('0');

            int s = 0;
            int a;
            for (int z = 1; z < m; ++z) {
                o[s] = true;
                s = (s * 10) % m;
                a = 9;
                while (o[s + a])
                    --a;

                System.out.print(a);
                s += a;
            }
            System.out.println();
        }
    }
}
