// Bits Trocados
#include <stdio.h>

int main() {
	int teste, bits;
	
	for (teste=1; scanf("%d", &bits)&&bits!=0; teste++) {
		printf("Teste %d\n", teste);
		printf("%d ", bits/50);
		bits%=50;
		printf("%d ", bits/10);
		bits%=10;
		printf("%d ", bits/5);
		bits%=5;
		printf("%d\n\n", bits);
	}

	return 0;
}

