#include<iostream>
#include<cmath>
using namespace std;
void convert(int n)
{
int i; char c;
if ((i = n / 10)!=0)
{
convert(i);
}
c = n % 10 + '0';
cout << " " << c;
}
int main()
{
int m;
cin >> m;
if (m < 0)
{
cout << "-";
m = -m;
}
convert(m);
cout << endl;
system("pause");
return 0;
}