# include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main(){
unsigned long long int sec_input, sec, min, hour, day;
cin >> sec_input;
sec=sec_input%60;
min=sec_input/60;
hour=min/60;
day=hour/24;
min%=60;
hour%=24;
cout << day<<" "<<hour<<" "<<min<<" "<<sec<<endl;
return 0;
}
IyBpbmNsdWRlIDxpb3N0cmVhbT4KIAogCiAKIHVzaW5nIHN0ZDo6Y291dDsKdXNpbmcgc3RkOjpjaW47CnVzaW5nIHN0ZDo6ZW5kbDsKIAogCmludCBtYWluKCl7CiAKdW5zaWduZWQgbG9uZyBsb25nIGludCBzZWNfaW5wdXQsIHNlYywgbWluLCBob3VyLCAgZGF5OwogCgkJY2luID4+IHNlY19pbnB1dDsKCQlzZWM9c2VjX2lucHV0JTYwOwoJCW1pbj1zZWNfaW5wdXQvNjA7CgkJaG91cj1taW4vNjA7CgkJZGF5PWhvdXIvMjQ7CgkJbWluJT02MDsKCQlob3VyJT0yNDsKCQkKCQkKCQkJY291dCA8PCBkYXk8PCIgIjw8aG91cjw8IiAiPDxtaW48PCIgIjw8c2VjPDxlbmRsOwogCgkJCXJldHVybiAwOwoJCX0=