from os import system
from random import randint

m = 1000

c = 1
while True:
    f = open("test.in", "w")
    for i in range(7):
        f.write(str(randint(1, m)) + "\n")
    f.close()
    system("submissions/accepted/antti < test.in > test.out1")
    system("submissions/accepted/paul < test.in > test.out2")
    system("submissions/accepted/mzuenni < test.in > test.out3")
    res1 = open("test.out1").readline().strip()
    res2 = open("test.out2").readline().strip()
    res3 = open("test.out3").readline().strip()
    if res1 == res2 and res1 == res3:
        print("test", c, "ok")
    else:
        print("test", c, "fail")
        break
    c += 1
