#include <bits/stdc++.h>
using namespace std;
int getint() {
  char c = 'd';
  int ret = 0;
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') ret = ret * 10 + c - '0', c = getchar();
  return ret;
}
int A, B, a, b;
int main() {
  A = getint();
  B = getint();
  a = getint();
  b = a % 60;
  a = a / 60;
  A += a;
  B += b;
  A = A + (B / 60);
  B %= 60;
  A %= 24;
  if (A <= 9)
    cout << 0 << A;
  else
    cout << A;
  cout << ':';
  if (B <= 9)
    cout << 0 << B;
  else
    cout << B;
  return 0;
}
