#17733: simple python solution


peterpeter200412@gmail.com (Peter Lin)


test_time = int(input())

for i in range(test_time):

n, m = input().split()
l = list()
for j in range(int(n)):

l+=input().split()

print(['keep defending', 'go forward'][l==l[::-1]])