import random
import math
random.seed("russia-team-2014")

class TestGen:
    def __init__(self):
        self.test_number = 0

    def generate_samples(self):             
        self.print_test(3)
        self.print_test(-2)

    def generate_min_tests(self):
        for i in range(-10, 10):
            if (i != -2) and (i != 3):
                self.print_test(i)
                                                            
    def generate_hand_tests(self):
        pass

    def generate_random_test(self, maxn):
        if random.randint(0, 1) == 0:
            self.print_test(random.randint(11, maxn))
        else:
            self.print_test(random.randint(-maxn, -11))
             
    def generate_max_tests(self, maxn):
        self.print_test(2**59)
        self.print_test(2**59 - 1)
        self.print_test(2**59 + 1)
        self.print_test(-384307168202282325)
        self.print_test(384307168202282325)
        self.print_test(768614336404564651)
        self.print_test(-768614336404564651)
                                    
    def print_test(self, x):
        self.test_number += 1
        test_name = "../tests/" + "{0:0=2d}".format(self.test_number)
        test_file = open(test_name, "w")
        print(x, file=test_file)
        test_file.close()

    def generate_all_tests(self):
        maxn = 10**18

        self.generate_samples()                               #2 tests
        self.generate_min_tests()                             #18 tests
        self.generate_hand_tests()                            #0 tests
        
        for i in range(10):                                   #10 tests
            self.generate_random_test(100)
        for i in range(10):                                   #10 tests
            self.generate_random_test(10**5)
        for i in range(10):                                   #10 tests
            self.generate_random_test(10**9)
        for i in range(10):                                   #10 tests
            self.generate_random_test(10**18)
        self.generate_max_tests(maxn)                         #7 tests

import os, shutil
if os.path.exists('../tests'):
    shutil.rmtree('../tests', ignore_errors=False, onerror=None)
try:
    os.makedirs('../tests')
except OSError:
    pass

import time
start = time.time()
writer = TestGen()
writer.generate_all_tests()
finish = time.time()
print('All tests were generated. Elapsed time: ', finish - start)