```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 ``` ```import sys import numpy as np from gurobipy import * def solve(filename): m = Model() n,A,B = map(int,input().split(' ')) a_var = np.zeros(A,dtype=Var) na_var = np.zeros(A,dtype=Var) b_var = np.zeros(B,dtype=Var) nb_var = np.zeros(B,dtype=Var) z = np.zeros(n,dtype=Var) for i in range(A): a_var[i] = m.addVar(vtype=GRB.BINARY,name="a_"+str(i)) for i in range(A): na_var[i] = m.addVar(vtype=GRB.BINARY,name="na_"+str(i)) for i in range(B): b_var[i] = m.addVar(vtype=GRB.BINARY,name="b_"+str(i)) for i in range(B): nb_var[i] = m.addVar(vtype=GRB.BINARY,name="nb_"+str(i)) for i in range(n): z[i] = m.addVar(vtype=GRB.BINARY,name="z_"+str(i)) m.update() for i in range(A): m.addConstr(a_var[i]+na_var[i]==1) for i in range(B): m.addConstr(b_var[i]+nb_var[i]==1) sum_satisfied = 0 for i in range(n): s1,a,s2,b = map(int,input().split(' ')) a -= 1; b -= 1; s1 -= 1 s2 -= 1 # print(s1,a,s2,b) cond = 0 if(s1 == 0): cond += a_var[a] cond += (1-b_var[b]) else: cond += b_var[a] cond += (1-a_var[b]) m.addConstr(2*z[i] <= cond) m.setObjective(quicksum(z),GRB.MAXIMIZE) m.optimize() dudes_a = [] dudes_b = [] for i in range(A): if(a_var[i].X > 0): dudes_a.append(i+1) for i in range(B): if(b_var[i].X > 0): dudes_b.append(i+1) print(len(dudes_a),file=filename) print(' '.join(map(str,dudes_a)),file=filename) print(len(dudes_b),file=filename) print(' '.join(map(str,dudes_b)),file=filename) t = int(input()) with open("output.txt","w") as filename: for i in range(t): solve(filename) ```
 ```1 2 3 4 ``` ``` Line 54 print(len(dudes_a),file=filename) ^ SyntaxError: invalid syntax ```