Write a program that finds the minimum and maximum elements in a matrix. If the matrix has several identical minimum (maximum) elements, you need to find the indices of the first such element in the order of traversal along the lines: from left to right, from top to bottom.

Input
The first line contains the dimensions of the matrix separated by a space: the number of rows Nand the number of columns M (\(1 <= N , M <= 100\)). The following Nlines contain matrix rows, each – by Mnatural numbers separated by spaces.

Imprint
On the first line, the program should print the indexes of the minimum element (row and column), and then – its meaning. Numbering of rows and columns starts from one. All numbers are separated by spaces. The second line displays information about the maximum element in the same format.