Knight is a newly popular game. Kangsani and Changyoung want to play it. Kangsani places one chess knight on an N x N board, then moves it exactly T times, once per second. Changyoung waits blindfolded and wins if he guesses the knight's final position after those T moves.
This board is not an ordinary chessboard. Each square contains one positive integer. If a square contains K, the knight may be on that square only at times 0, K, 2K, 3K, ... seconds after the game starts.
The game starts at time 0. Every second, Kangsani must move the knight from its current square to one square reachable by a normal knight move. Therefore, the square reached by the first move must be allowed at time 1, and the square reached by the t-th move must be allowed at time t.
Find every square where the knight can be after exactly T moves.
The first line contains the board size N and the number of moves T. (3 <= N <= 30, 1 <= T <= 1,000,000)
The second line contains the starting position X and Y of the knight. (1 <= X, Y <= N)
Each of the next N lines contains the numbers written on the board. Every number is a positive integer at most 10^9.
Print M, the number of squares where the knight can be after T moves, on the first line.
Then print the M positions, one per line. Print them in increasing row order; if two positions have the same row, print them in increasing column order.