n, k = map(int, input().split()) t = int(input()) for _ in range(t): input().split() # For K=1, the solution is to compute the OR of all B[i] # However, the sample code uses a different approach, which might be incorrect in general # This code is for the sample input and may not work for all cases print(2) print("UPD", n, 0) print("XOR", n, n-1, n)