import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Demo{ public static void main(String[] args)throws IOException { /* Scanner scanner =new Scanner(System.in); int m=scanner.nextInt(); int n=scanner.nextInt();*/ /...