// Tests generator for Notebook problem
// Author : Vladimir Ulyantsev, ulyantsev@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class NotebookTestsGen implements Runnable {
    public static void main(String[] args) {
        if (args.length < 1) {
            for (I = 1; (new File(getName(I) + ".t")).exists(); I++);
        } else {
            I = Integer.parseInt(args[0]);
        }
        new Thread(new NotebookTestsGen()).start();
    }

    PrintWriter out;

    Random random = new Random(6466403L);

    static int I;

    static String getName(int i) {
        return ((i < 10) ? "0" : "") + i;
    }
    
    void open() {
        try {
            System.out.println("Generating test " + I);
            out = new PrintWriter(getName(I));
        } catch (FileNotFoundException e) {         
            e.printStackTrace();
            System.exit(-1);
        }
    }

    void close() {
        out.close();
        I++;
    }

    final int MAXN = 20;
    final int MAXX = 1500;
    final int MAXTIME = 1440;

    String minuteToTime(int minute) {
        return (minute / 60) / 10 + "" + (minute / 60) % 10 + ":" + (minute % 60) / 10 + "" + (minute % 60) % 10;
    }

    void genRandom(int n, int min, int max) {
        open();
        
        out.println(n + " " + (min + random.nextInt(max - min + 1)) + " " + (min + random.nextInt(max - min + 1)));
        TreeSet<Integer> times = new TreeSet<Integer>();

        while (times.size() < n) {
            times.add(1 + random.nextInt(MAXTIME - 1));
        }

        for (int x : times) {
            out.println(minuteToTime(x));
        }

        close();    
    }

    void genMax() {
        open();

        out.println(MAXN + " 1 1");

        TreeSet<Integer> times = new TreeSet<Integer>();

        while (times.size() < MAXN) {
            times.add(1 + random.nextInt(MAXTIME - 1));
        }

        for (int x : times) {
            out.println(minuteToTime(x));
        }        

        close();    
    }

    public void solve() throws IOException {        
        for (int i = 0; i < 5; i++) {
            genRandom(2 * (1 + random.nextInt(3)), MAXX / 6, MAXX / 4);
        } 

        for (int i = 0; i < 5; i++) {
            genRandom(1 + 2 * (1 + random.nextInt(3)), MAXX / 6, MAXX / 4);
        } 

        for (int i = 0; i < 14; i++) {
            genRandom(MAXN / 2 + random.nextInt(MAXN / 2), MAXX / 2, MAXX);
        }

        genMax();
    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }
}
