Storing input queries
v = [ [ [ 0 for i in range ( 2 ) ] for x in range ( 2 ) ] for z in range ( q ) ] NEW_LINE v [ 0 ] [ 0 ] [ 0 ] = 1 ; NEW_LINE v [ 0 ] [ 0 ] [ 1 ] = 5 ; NEW_LINE v [ 0 ] [ 1 ] = 3 ; NEW_LINE v [ 1 ] [ 0 ] [ 0 ] = 4 ; NEW_LINE v [ 1 ] [ 0 ] [ 1 ] = 8 ; NEW_LINE v [ 1 ] [ 1 ] = 7 ; NEW_LINE v [ 2 ] [ 0 ] [ 0 ] = 6 ; NEW_LINE v [ 2 ] [ 0 ] [ 1 ] = 9 ; NEW_LINE v [ 2 ] [ 1 ] = 1 ; NEW_LINE