#K61527. Grid Maximum Finder

    ID: 31329 Type: Default 1000ms 256MiB

Grid Maximum Finder

Grid Maximum Finder

You are given an n x m grid containing non-negative integers. Your task is to find the maximum element in the grid.

Although the problem description mentions the possibility of flipping one rectangular subgrid, it turns out that the optimal answer does not require performing any flips at all: the answer is simply the maximum value present in the grid.

Note: The input grid is provided as rows of integers and you should compute the maximum value in the entire grid.

Input: The first line contains two integers n and m. The next n lines each contain m integers separated by spaces representing the grid.

Output: Output a single integer which is the maximum element in the grid.

inputFormat

The input is read from stdin and has the following format:

n m
row1_element1 row1_element2 ... row1_elementm
...
rown_element1 rown_element2 ... rown_elementm

Where n is the number of rows and m is the number of columns.

outputFormat

Print to stdout a single integer representing the maximum element in the grid.

## sample
2 3
1 2 3
4 5 6
6