import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Scanner;
class Main
{
{
Scanner in
= new Scanner
(System.
in); int n = in.nextInt();
System.
out.
print(n
/86400 + " " + (n
%86400
)/3600 + " " + ((n
%86400
)%3600
)/60 + " " + n
%60
); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLnV0aWwuU2Nhbm5lcjsKCmNsYXNzIE1haW4KewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJaW50IG4gPSBpbi5uZXh0SW50KCk7CgkJU3lzdGVtLm91dC5wcmludChuLzg2NDAwICsgIiAiICsgKG4lODY0MDApLzM2MDAgKyAiICIgKyAoKG4lODY0MDApJTM2MDApLzYwICsgIiAiICsgbiU2MCk7Cgl9Cn0=