#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

if __FILE__ == $0
  while line = STDIN.gets
    tokens = line.chomp!.split.map!(&:to_i)
    sec = tokens[0]
    h = int(sec/3600)
    m = int((sec - h*3600)/60)
    s = sec % 60


    puts "#{a} #{b}"
  end
end