/*
#include <stdio.h>
int main()
{
int s[120][120];
int n,i,j,k=1;
scanf("%d",&n);
for (i=1; i<=n; i++){
for (j=1; j<=n; j++){
s[i][j]=k++;
}
}
if (j%2==0){
for (i=n; i>=1; i--){
for (j=1; j<=n; j++){
printf("%d ",s[j][i]);
}
printf("\n");
}
}
else {
for (i=1; i<=n; i++){
for (j=1; j<=n; j++){
printf("%d ",s[j][i]);
}
printf("\n");
}
}
}
*/
/*
#include <stdio.h>
int main()
{
int s[120][120];
int n,i,j,k=1;
scanf("%d",&n);
for (i=1; i<=n; i++){
for (j=1; j<=n; j++){
s[i][j]=k++;
}
}
if(i%2!=0){
for (i=n; i>=1; i--){
for (j=1; j<=n; j++){
printf("%d ",s[j][i]);
}
printf("\n");
}
}
else {
for (j=1; j<=n; j++){
for (i=1; i<=n; i++){
printf("%d ",s[j][i]);
}
printf("\n");
}
}
}
*/
/*
#include <stdio.h>
int main()
{
int n,i,min=24;
int s[100000];
scanf("%d",&n);
for (i=1; i<=n; i++){
scanf("%d",&s[i]);
if (min>s[i]){
min=s[i];
}
}
printf("%d",min);
}
*/
/*
#include <stdio.h>
int main()
{
int n,i,min=24;
int s[10004]={};
scanf("%d",&n);
for (i=1; i<=n; i++){
scanf("%d",&s[i]);
}
if (s[i]<min){
min=s;
}
printf("%d",min);
}
*/
/*
#include <stdio.h>
int main()
{
int s[120][120];
int a,b,i,j,k=1;
scanf("%d %d",&a,&b);
for (i=1; i<=a; i++)
{
for (j=1; j<=b; j++)
{
s[i][j]=k++;
}
}
for (i=a; i>=1; i--)
{
if (i%2==0)
{
for (j=1; j<=b; j++)
{
printf("%d ",s[i][j]);
}
}
else
{
for (j=b; j>=1; j--)
{
printf("%d ",s[i][j]);
}
}
printf("\n");
}
}
*/
/*
#include <stdio.h>
int main()
{
int s[120][120];
int a,b,i,j,k=1;
scanf("%d %d",&a,&b);
for (i=1; i<=a; i++)
{
for (j=1; j<=b; j++)
{
s[i][j]=k++;
}
}
for (i=a; i>=1; i--)
{
if (i%2==0)
{
for (j=b; j>=1; j--)
{
printf("%d ",s[i][j]);
}
}
else
{
for (j=1; j<=b; j++)
{
printf("%d ",s[i][j]);
}
}
printf("\n");
}
}
*/
/*
#include <stdio.h>
int main()
{
int s[120][120];
int a,b,i,j,k=1;
scanf("%d %d",&a,&b);
for (i=1; i<=a; i++){
for (j=1; j<=b; j++){
s[i][j]=k++;
}
}
for (j=b; j>=1; j--){
if (j%2==0){
for (i=1; i<=a; i++){
printf("%d ",s[i][j]);
}
}
else {
for (i=a; i>=1; i--){
printf("%d ",s[i][j]);
}
}
printf("\n");
}
}
*/
/*
#include <stdio.h>
int main()
{
int n,i,j;
scanf("%d",&n);
for (i=1; i<=n; i++){
}
}
*/