#include <iostream>
using namespace std;
int main()
{
char*arr = new char[4];
cin >> arr;
cout << arr[0] << " " << arr[3];
return 0;
}
#include <iostream>
using namespace std;
int main()
{
char*arr = new char[4];
cin >> arr;
cout << arr[0] << " " << arr[3];
return 0;
}