import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES") no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO") ######################################################################## Binary Indexed Tree (Fenwick Tree) # 0-indexed class BIT: def __init__(self, n): self.n = n self.data = [0]*(n+1) self.el = [0]*(n+1) def sum(self, i): s = 0 while i > 0: s += self.data[i] i -= i & -i return s def add(self, i, x): assert 0 <= i < self.n i = i+1 self.el[i] += x while i <= self.n: self.data[i] += x i += i & -i def set(self, i, x): assert 0 <= i <= self.n self.add(i,x-self.get(i)) def get(self, i, j=None):# j=Noneのときiを取得, [i, j)の和を取得 if j is None: return self.el[i+1] return self.sum(j) - self.sum(i) def lower_bound(self, k):# a[0],…,a[i]>kなる最小のi n = self.n x = 0 r = 1 while r <= n:r <<= 1 size = r while size: if x + size <= n and self.data[x+size] <= k: k-=self.data[x+size] x += size size >>= 1 return x def debug(self): res = [] n = self.n for i in range(n): res.append(self.get(i)) print(*res) N,K,Q = na() eve = [] color = [-1]*K for i in range(K): l,r,c,h = na() color[i] = c eve.append((l, 0, i, h)) eve.append((r, 2, i, h)) ans = [-1]*Q for j in range(Q): i, x = na() eve.append((i, 1, j, x-1)) eve = sorted(eve) bit = BIT(K) for i, p, j, h in eve: if p == 0: bit.add(j, h) elif p == 2: bit.add(j, -h) else: x = bit.lower_bound(h) #bit.debug() #print(x) if x == K: ans[j] = -1 else: ans[j] = color[x] print(*ans,sep="\n")