x = input() N, m = x.split(' ') N, m = int(N), int(m) price, weight, q_type, score = list(), list(), list(), list() for i in range(m): v, w, a = input...