#include<bits/stdc++.h> using namespace std; int main(){ int n,a,b; cin>>n; a=n%10; cout<<a<<" "; while(n!=0){ b=n/10; printf("%d ",b); } return 0; }