Types: N: int, M: int, Q: int, a: List[int], b: List[int], c: List[int], d: List[int]
Ranges: 2 ≤ N ≤ 10, 1 ≤ M ≤ 10, 1 ≤ Q ≤ 50, 1 ≤ a_i < b_i ≤ N, 0 ≤ c_i ≤ M - 1, 1 ≤ d_i ≤ 10^5
Addtl Info: (a_i, b_i, c_i) ≠ (a_j, b_j, c_j) for i ≠ j