#include<bits/stdc++.h> using namespace std; struct times{ int h, m, s,hh,mm,ss; }; void input(times& c) { cin >>c.m >> c.s >> c.hh >> c.mm >> c.ss; } int main() { times x; int h,a,b,c; while (cin >> h) { input(x); a = h + x.hh; b = x.m + x.mm; c = x.s + x.ss; while (c >= 60) { b = b + 1; c = c - 60; } while (b >= 60) { a = a + 1; b = b - 60; } while (a >=24) { a = a - 24; } printf("%02d:%02d:%02d\n", a, b, c); } return 0; }