#include <bits/stdc++.h>
using namespace std;
int main() {
  int h, m, s, c;
  while (1) {
    cin >> h >> m >> s;
    if ((h == -1) && (m == -1) && (s == -1)) {
      return 0;
    }
    s = 2 * 60 * 60 - h * 60 * 60 - m * 60 - s;
    c = 3 * s;
    h = 0;
    m = 0;
    for (int i = 0; s >= 3600; i++) {
      s -= 3600;
      h++;
    }
    for (int i = 0; s >= 60; i++) {
      s -= 60;
      m++;
    }
    cout << h << " " << m << " " << s << "\n";
    s = c;
    h = 0;
    m = 0;
    for (int i = 0; s >= 3600; i++) {
      s -= 3600;
      h++;
    }
    for (int i = 0; s >= 60; i++) {
      s -= 60;
      m++;
    }
    cout << h << " " << m << " " << s << "\n";
  }
  return 0;
}
