import scala.io.StdIn.readLine

object Main {
  def getTime(s:String) = {
    val t = s.split(" ").map(_.toInt)
    t(3)*3600 + t(4)*60 + t(5)- (t(0)*3600 + t(1)*60 + t(2))
  }

  def main(args:Array[String]) = {
    (1 to 3).foreach { _ =>
      val t = getTime(readLine)
      println((t/3600) + " " + ((t/60)%60) + " " + (t%60))
    }
  }
}