import scala.math.{min,max}

object Main {
  val sc = new java.util.Scanner(System.in)
  def sec(a: List[Int]) = {
    a(0) * 3600 + a(1) * 60 + a(2)
  }
  def hms(s: Int) = {
    List(s/3600, (s%3600)/60, s%60)
  }
  def calc(a: List[Int]) = {
    hms(sec(a.drop(3)) - sec(a.take(3)))
  }
  def main(args: Array[String]) {
    for(i <- 1 to 3) {
      println(calc(sc.nextLine.split(" ").map(_.toInt).toList).mkString(" "))
    }
  }
}