N,M,Q = list(map(int, input().split()))
q = []
S = 0
a = [0 for _ in range(N)]
b = [0 for _ in range(M)]
for _ in range(Q):
    t,x,y = list(map(int, input().split()))

    if t == 1:


    else:



2b75e52659a60d0d59f38cd859851a0bb3cc3257
N,M,Q = list(map(int, input().split()))
q = []
S = 0
a = [0 for _ in range(N)]
b = [0 for _ in range(M)]
for _ in range(Q):
    t,x,y = list(map(int, input().split()))

    if t == 1:


    else:


