import os
import sys

log = open('check-10.log', 'w')

for k in [10]:
    for n in range(0, 20) + range(100, 120) + range(1000, 1020) + range(10000, 10020) + range(100000 - 20, 100000):
        for r in xrange(k):
            for l in xrange(k):
                print >>open('bender.in', 'w'), n + 1, k, r + 1, l + 1
                os.system('bender_vu');
                ans = open('bender.out').readline()
                print >>log, n + 1, k, r + 1, l + 1, ' : ', ans,
    if (n + 1) % 100 == 0:
        print n + 1

log.close()
