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]])