/*
    1小时 = 60分钟 = 3600秒
*/
import java.util.Scanner;
public class Main {
    
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int hour = n / 3600;
        int minute = (n - hour * 3600) / 60;
        int second = n - hour * 3600 - minute * 60;
        System.out.println(hour + " " + minute + " " + second);
    }
}