#include<iostream>
#include<cmath>
using namespace std;
int f(int a,int b)
{
	int c,x,y,m,n;
	x=a%10;
	y=a/10;
	m=b%10;
	n=b/10;
	c=1000*y+100*n+10*m+x;
	return c;
}

int main()
{
	int a,b,c;
	cin>>a>>b;
	c=f(a,b);
	cout<<c;
	
	return 0;
}
