you give bipartite graph n_1 vertex n_2 vertex second m edge the maximum match graph maximum possible size subset edge graph vertex incident choose edgeyou process type query graph 1 remove minimum possible number vertex graph size maximum matching gets reduce exactly 1 print vertex remove then find maximum match graph print sum index edge belong match 2 query type ask query type 1 as answer query print edge form maximum matching choose previous query note solve problem online mode it mean can not read input you read query write answer query Use function fflush C BufferedWriterflush Java language write program