import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int secs = in.nextInt();
int hour = secs / 3600;
int min = secs % 3600 / 60;
int sec = secs % 60;
System.out.println(hour + " " + min + " " + sec);
}
}