#include <iostream>
using namespace std;
int n,k,pu,nr,i,nst,ndr;
int main()
{
cin>>n;
k=n;
while(n)
{
n=n/10;
nr++;
}
if(nr%2==1)
{
nr=nr/2;
pu=10;
for(i=1;i<=nr;i++)
pu=pu*10;
ndr=k%pu;
nst=k/(pu);
} else
{
nr=nr/2;
pu=1;
for(i=1;i<=nr;i++)
pu=pu*10;
ndr=k%pu;
nst=k/(pu);
}
cout<<nst << " " << ndr;
return 0;
}