Problem

3 /11


Simple task

Problem

Given a two-dimensional array N*M (\(0<N,M<=20\)).
Array element values ​​are entered from the keyboard
Output in the first line all the corner elements of the array, starting from the upper left corner and moving clockwise.

Input
The first line specifies the size of the array. N - number of rows, M - number of columns (\(0<N,M<=20\) )
Next come N lines of M numbers in each line - elements of a two-dimensional array (each element modulo no more than 50)

Imprint
Output, one space apart, all the corner elements of the array, starting from the upper left corner and moving clockwise.
 
Example
# Input Output
1 4 5
0 1 2 3 4
1 2 3 4 5
2 3 4 5 6
3 4 5 6 7
0 4 7 3