print s="#{2%H/2} 0 #{3%H%2} #{H/6} ",H%2,s.reverse,' 'while H=gets.hex