#include <stdio.h>

int main() {
	int input,ten,five,two,one;
	
	scanf("%d",&input);
	
	ten = input / 10;
	five = input % 10 / 5;
	two = input % 10 % 5 / 2;
	one = input % 10 % 5 % 2 / 1;
	
	printf("%d %d %d %d",ten,five,two,one);
	
	return 0;
}