def popcount(x): ret = 0 while x: x &= x-1 ret += 1 return ret MOD = 10**9+7 h, w, k, p = map(int,input().split(' ')) x = [0] * k y = [0] * k n = [""] * k m = [[True] * (w+1) for i in range(h+1)] for i in range(k): a,b,n[i] = input().split(' ') x[i] = int(a) y[i] = int(b) m[x[i]][y[i]] = False mx = 0 bits = -1 for i in range(1< mx: mx = s[h][w] bits = i for j in range(k): if i&1<= 0: for j in range(k): if bits&1<