import java.util.*; public class Main { public static class pos { int x; int y; pos(int x, int y) { this.x = x; this.y = y; } } static int[][]map; static List<pos> ans=new ArrayList<>(); static List<pos> res=new ArrayList<>(); static int m, n; public static void main(String[]...