/*#include <stdio.h>
#include <string.h>
int main()
{
char str[201]={};
int i;
gets(str);
for (i=0;i<=strlen(str);i++)
{
if ('d'<=str[i]&&str[i]<='z')
{
printf("%c", str[i]-3);
}
else if ('a'<=str[i]&&str[i]<='c')
{
printf("%c", str[i]+23);
}
else if (str[i]==32)
printf(" ");
}
return 0;
}
*//*
#include <stdio.h>
#include <string.h>
int main()
{
char S1[21]={},S2[21]={},S3[21]={},a1,a2,b1,b2,c1,c2;
int s1,s2,s3;
scanf("%s",S1);
scanf("%s",S2);
scanf("%s",S3);
s1=strlen(S1)-1;
s2=strlen(S2)-1;
s3=strlen(S3)-1;
a1=S1[s1];
a2=S1[0];
b1=S2[s2];
b2=S2[0];
c1=S3[s3];
c2=S3[0];
if (a1==b2&&b1==c2&&c1==a2)
printf("good");
else
printf("bad");
return 0;
}
*/
/*
#include <stdio.h>
int main()
{
int arr[1001][1001]={};
int i, j,r, n, x,y, k;
scanf("%d %d %d", &n,&x,&y);
arr[x][y]=1;
for (r=1;r<=n*n;r++)
{
for (i=1;i<=n;i++)
{
for (j=1;j<=n;j++)
{
k=arr[i][j];
if (k>=1&&arr[i+1][j]==0)
{
arr[i+1][j]=k+1;
}
if (k>=1&&arr[i-1][j]==0)
{
arr[i-1][j]=k+1;
}
if (k>=1&&arr[i][j+1]==0)
{
arr[i][j+1]=k+1;
}
if (k>=1&&arr[i][j-1]==0)
{
arr[i][j-1]=k+1;
}
}
}
}
for (i=1;i<=n;i++)
{
for (j=1;j<=n;j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}
return 0;
}*/
/*
#include<stdio.h>
int main() {
int i, n, j, x, y;
int s;
scanf("%d", &n);
scanf("%d %d", &x, &y);
for(i=1; i<=n; i++) {
for(j=1; j<=n; j++) {
s = (i<x) ? x-i : i-x;
s += d(j<y) ? y-j : j-y;
printf("%d ", s+1);
}
printf("\n");
}
}
*//*
#include <stdio.h>
int main()
{
int arr[11][11];
int i,j,k,x,y;
for (i=1; i<=10; i++)
{
for (j=1; j<=10; j++)
{
scanf("%d", &arr[i][j]);
}
}
x = 2;
y = 2;
if(arr[x][y] == 2)
{
arr[x][y]=9;
}
else
{
arr[x][y] = 9;
for(;;)
{
if(arr[x][y+1] == 0)
{
y++;
arr[x][y] = 9;
}
else if(arr[x][y+1] == 2)
{
y++;
arr[x][y]=9;
break;
}
else
{
// 1
if(arr[x+1][y]==0)
{
x++;
arr[x][y]=9;
}
else if(arr[x+1][y]==1)
{
break;
}
else
{
x++;
arr[x][y]=9;
break;
}
}
}
}
for (i=1; i<=10; i++)
{
for (j=1; j<=10; j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}
}
*//*
#include <stdio.h>
int main()
{
int arr[100][100];
int i,j,n,a=1;
scanf("%d", &n);
for (i=1;i<=n;i++)
{
if (i%2!=0)
for (j=i;j<=n;j++)
{
arr[n-i+1][j]=a++;
}
else
{
for (j=n;j>=i;j--)
{
arr[i][j]=a++;
}
}
}
for (i=1;i<=n;i++)
{
for (j=1;j<=n;j++)
{
printf("%d ", arr[i][j]);
}
printf("\n");
}
return 0;
}
**//*
#include <stdio.h>
#include <string.h>
int main()
{
char str1[101]={},str2[101]={};
int i;
scanf("%s %s", str1, str2);
if (strlen(str1)>strlen(str2))
printf("%s %s",str2 ,str1);
else if (strlen(str1)==strlen(str2))
{
for (i=1;i<=strlen(str1);i++)
{
if (str1[i]>str2[i])
{
printf("%s %s", str2,str1);
break;
}
else if (str1[i]<str2[i])
{
printf("%s %s", str1,str2);
break;
}
}
}
else
{
printf("%s %s",str1 ,str2 );
}
return 0;
}
//111111111111111111111111111112 111111111111111111111111111121
*/
/*
#include<stdio.h>
int k;
void show() {
printf("HELLO");
k = 10;
}
int sum(int a, int b)
{
int s = a+b;
k = 20;
if(a == 10) {
return 345934593;
}
}
int main() {
int n;
n = sum(10, 20);
printf("%d", n);
}
*/