from random import *
from sys import argv

seed('ololo')

test = 0
	
def t1():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(1, file = out)
	print(5000, file = out)
	print(300, 1000, file = out)

def t2():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(1, file = out)
	print(5000, file = out)
	print(0, 1000, file = out)

def t3():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(1, file = out)
	print(5000, file = out)
	print(300, 5000, file = out)

def t4():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(1, file = out)
	print(5000, file = out)
	print(0, 5000, file = out)

def t5():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(5000, 10000, file = out)
	print(0, 0, 500, 8000, file = out)

def t6():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(10000, 5000, file = out)
	print(0, 300, 8000, 800, file = out)

def t7():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(5000, 10000, file = out)
	print(4000, 1, 4500, 9999, file = out)

def t8():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(5000, 10000, file = out)
	print(0, 0, 5000, 10000, file = out)

def t9():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(5000, 10000, file = out)
	print(0, 0, 5000, 8000, file = out)

def t10():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(5000, 10000, file = out)
	print(0, 10, 5000, 8000, file = out)

def t11():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(10000, 5000, file = out)
	print(0, 0, 8000, 5000, file = out)

def t12():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(2, file = out)
	print(10000, 5000, file = out)
	print(11, 0, 8000, 5000, file = out)

def t13():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(0, 0, 0, 150, 5000, 8001, file = out)

def t14():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(0, 1000, 0, 150, 5000, 8001, file = out)

def t15():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(0, 1000, 1000, 150, 5000, 8001, file = out)

def t16():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(0, 0, 0, 5000, 8000, 10000, file = out)

def t17():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(0, 1, 0, 5000, 8000, 10000, file = out)

def t18():
	global test
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(100, 100, 100, 500, 500, 500, file = out)

def t19():
	global test                             
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(100, 100, 0, 500, 500, 8000, file = out)

def t20():
	global test                             
	test += 1
	print('%d'%test)
	out = open('../tests/%02d'%test, 'w')
	print(3, file = out)
	print(5000, 8000, 10000, file = out)
	print(100, 0, 0, 500, 500, 8000, file = out)

FOUTP = open('../preliminary/01', 'w')
print('''1
5
0 3'''
, file = FOUTP)

FOUTP = open('../preliminary/02', 'w')
print('''2
3 4
2 2 3 3'''
, file = FOUTP)

FOUTP = open('../preliminary/03', 'w')
print('''3
2 2 2
0 1 0 1 2 1'''
, file = FOUTP)

	
t1()
t2()
t3()
t4()
t5()
t6()
t7()
t8()
t9()
t10()
t11()
t12()
t13()
t14()
t15()
t16()
t17()
t18()
t19()
t20()