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

public class TestsGen 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 TestsGen()).start();
	}

	PrintWriter out;

	Random rand = new Random(6439586L);

	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 String ALPHA = "abcdefghijklmnopqrstuvwxyz";

	String randString(int len, String alpha) {
		StringBuilder ans = new StringBuilder();
		int k = alpha.length();
		for (int i = 0; i < len; i++) {
			ans.append(alpha.charAt(rand.nextInt(k)));
		}
		return ans.toString();
	}


	long rand(long l, long r) {
		return l + (rand.nextLong() >>> 1) % (r - l + 1);
	}

	int rand(int l, int r) {
		return l + rand.nextInt(r - l + 1);
	}
	
	String getDate(int i) {
		return (i / 60 < 10 ? "0" : "") + i / 60 + ":" + (i % 60 < 10 ? "0" : "") + i % 60;
	}
	
	final int MAXN = 20;
	final int MAX = 24 * 60 - 1;
	
	class Segment {
		int l, r;
		
		public Segment(int l_, int r_) {
			l = l_;
			r = r_;
		}
		
		boolean intersects(Segment s) {
			if (l > r) {
				return s.intersects(new Segment(l, MAX)) || s.intersects(new Segment(0, r));
			} else {
				if (s.l > s.r) return s.intersects(this);
				return !(r < s.l || s.r < l);
			}
		}
	}
	
	void genRandTest(int a, int b, int n, int ml) {
		open();
		out.println(a + " " + b);
		out.println(n);
		Segment[] sa = new Segment[n];
		for (int i = 0; i < n; ++i) {
			loop:
			while (true) {
				int l = rand(0, MAX);
				sa[i] = new Segment(l, (l + rand(1, ml - 1)) % (MAX + 1));
				for (int j = 0; j < i; ++j) {
					if (sa[j].intersects(sa[i])) continue loop;
				}
				break;
			}
		}
		for (int i = 0; i < n; ++i) {
			out.println(getDate(sa[i].l) + "-" + getDate(sa[i].r));
		}
		close();
	}
	
	void genPossible(int n, double pspl) {
		open();
		int a = 60 * rand(1, 23 / n);
		int b = (24 * 60 - n * a) / n;
//		System.out.println(n + " % " + a + " ! " + b);
		Segment[] sa = new Segment[n];
		int l = 0;
		int pb = b;
		for (int i = 0; i < n; ++i) {
			if (pb < 2 || rand.nextDouble() > pspl) {
				l += a;
				pb = b;
			} 
//			System.out.println(b + " " + (MAX - l + 1));
			int il = rand(2, Math.min(b, MAX - l + 1));
			pb -= il;
			sa[i] = new Segment(l, l + il - 1);
			l += il;
		}
		int sh = rand(0, MAX);
		for (int i = 0; i < n; ++i) {
			sa[i].l = (sa[i].l + sh) % (MAX + 1); 
			sa[i].r = (sa[i].r + sh) % (MAX + 1); 
		}
		ArrayList<Segment> ff = new ArrayList<Segment>();
		for (int i = 0; i < n; ++i) {
			ff.add(sa[i]);
		}
		Collections.shuffle(ff);
		ff.toArray(sa);
		out.println(a / 60 + " " + (b + 59) / 60);
		out.println(n);
		for (int i = 0; i < n; ++i) {
			out.println(getDate(sa[i].l) + "-" + getDate(sa[i].r));
		}
		close();
	}
	
	
	
	public void solve() throws IOException {
		for (int i = 0; i < 20; ++i) {
			genRandTest(rand(1, 24), rand(1, 24), rand(1, MAXN), rand(2, 5 * 60));
		}
		genRandTest(1, 24, 20, 338);
		for (int i = 0; i < 20; ++i) {
			genPossible(rand(1, MAXN), rand.nextDouble());
		}
		for (int i = 0; i < 5; ++i) {
			genPossible(MAXN, rand.nextDouble());
		}
	}
	
	public void run() {
		try {
			solve();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(-1);
		}
	}
}