#include<iostream> int main(){ int x; scanf("%d"&x); printf("%d %d %d %d",x%10,x/10%10,x/100%100,x/1000); return 0; }