#ifdef DEBUG
#  define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include "testlib.h"
#define ff first
#define ss second
#define szof(x) ((int)x.size())
#ifndef LOCAL
#  define cerr __get_ce
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef unsigned long long ull;

using namespace __gnu_pbds;
template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename K, typename V> using ordered_map = tree<K, V, less<K>, rb_tree_tag, tree_order_statistics_node_update>;

int const INF = (int)1e9 + 1e3;
ll const INFL = (ll)1e18 + 1e6;

const int MAX_N = 1'000;

int main(int argc, char* argv[]) {
	registerValidation(argc, argv);

	for (int i = 0; i < 2; i++) {
		string s = inf.readLine("[0-9]{2}:[0-9]{2}", i == 0 ? "time on the clock" : "correct time");
		int h = (int) (s[0] - '0') * 10 + (int) (s[1] - '0');
		int m = (int) (s[3] - '0') * 10 + (int) (s[4] - '0');
		ensuref(h <= 23, "hh = %d, must not exceed 23", h);
		ensuref(m <= 59, "mm = %d, must not exceed 59", m);
	}

	inf.readEof();

	return 0;
}
