#include <stdio.h>

int main() {
    int a;
    scanf("%d",&a);
    int t=a%60;//对a取余即是秒
    if(a/60>60)//1h=60min 要精确到h,min,60是分界点;
    {
        {
            a=a/60;
        }
        printf("%d %d ",a/60,a%60);
    }
    else {
    printf("%d %d ",a/3600,a/60);
    }
    printf("%d",t);
    return 0;
}