Registered Users Only

Problem Description

Rar the Cat has found a greyscale picture H by W pixels wide. Each pixel is a value between 0 and 1023 (inclusive).

Rar the Cat wants to edit the photo but is too lazy. He wants you to code the 'Magic Wand' feature.

The 'Magic Wand' will start at pixel (X, Y) with a threshold T, that is the Xth pixel from the top and Yth pixel from the left. It will then propagate in 4 directions (up/down/left/right), selecting pixels whose value is not more than T different from the starting pixel (X, Y). A pixel will only be selected if it is adjacent to another selected pixel, in addition to the constraint of values.

At the end of the day, Rar the Cat wants to know which pixels are selected by printing a H by W grid of 0 and 1s. '0' will denote an unselected pixel while '1' will denote a selected pixel.

Limits

For all testcases, 0 < X ≤ H, 0 < Y ≤ W, 0 ≤ T ≤ 1023.

Subtask 1 (32%): H = 1, 1 ≤ W ≤ 500.

Subtask 2 (33%): 1 ≤ H, W ≤ 500, each pixel will be either 0 or 1.

Subtask 3 (35%): 1 ≤ H, W ≤ 500.

Subtask 4 (0%): Sample Testcases.

Input

The first line of input will contain five integers, H, W, X, Y followed by T. X and Y are 1-indexed.

There will be H lines containing W integers each. Each integer will be between 0 and 1023, representing the value of the pixel.

Output

The output should contain H lines with W characters each. Each character should either be a '0' or '1', indicating whether the pixel is selected or not.

Sample Testcase 1

Input

3 3 2 2 1
1 3 4
2 0 1
3 1 2

Output

000
011
010

Explanation

The 'Magic Wand' operation starts at cell(2, 2), which corresponds to the centre pixel with value 0.

The 2 adjacent '1's are then selected as they are adjacent to the starting cell and their difference to the starting cell is not more than 1.