// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class Gen {
    public static void main(String[] args) throws IOException {
        int size = Integer.parseInt(args[1]);
        long t1 = System.currentTimeMillis();
        PrintWriter pw = new PrintWriter(new FileWriter(args[0]));
        for(int i = 0; i < size / 10; i++) {
            for(int j = 0; j < 10 - System.getProperty("line.separator").length(); j++) {
                pw.print(Integer.toString(i % 10));
            }
            pw.println();
        }
        pw.close();
        long t2 = System.currentTimeMillis();
        System.out.printf("Gen (%d bytes) : %d ms\n", size, t2 - t1);
    }
}
