you give grid n row m column cell positive integer write Lets grid good row sequence number sort nondecrease order it mean 1 le le n 2 le j le m follow hold a_ij ge a_i j1You follow operation exactly choose column index j necessarily different 1 le j le m swap themyou ask determine possible grid good swap find column need swap