text: If CP was pointing to the left, now it points to the right, and DP stays the same.If CP was pointing to the right, now it points to the left, and DP is rotated 90 degrees clockwise.This way BP will never point to a black block (it is guaranteed that top-left pixel of the program will not be black).You are given a Piet program.You have to figure out which block of the program will be current after n steps.Input The first line of the input contains two integer numbers m (1 ≤ m ≤ 50) and n (1 ≤ n ≤ 5·107).Next m lines contain the rows of the program.All the lines have the same length between 1 and 50 pixels, and consist of characters 0-9.The first character of the first line will not be equal to 0.Output Output the color of the block which will be current after n steps of program interpretation.Examples Input 2 10 12 43 Output 1 Input 3 12 1423 6624 6625 Output 6 Input 5 9 10345 23456 34567 45678 56789 Output 5 Note In the first example IP changes in the following way.After step 1 block 2 becomes current one and stays it after two more steps.After step 4 BP moves to block 3, after step 7 — to block 4, and finally after step 10 BP returns to block 1.<image> The sequence of states of IP is shown on the image: the arrows are traversed clockwise, the main arrow shows direction of DP, the side one — the direction of CP.# Solution #include <bits/stdc++.h> using namespace std; static const int INF = 500000000; template <class T> void debug(T a, T b) { for (; a !