public class Main{
public static void main(String[] args){
java.util.Scanner s = new java.util.Scanner(System.in);
int seconds = s.nextInt();
// 简单的数学问题,控制好输出格式
System.out.print(seconds/3600+" "+seconds%3600/60+" "+seconds%3600%60);}
}