#include <bits/stdc++.h>
using namespace std;
class Time {
private:
	int hours;
	int minutes;
	int seconds;
public:
	Time(int h, int m, int s) : hours(0), minutes(0), seconds(0) {
		SetTime(h, m, s);
	}
	Time &SetTime(int h, int m, int s) {
		SetHours(h);
		SetMinutes(m);
		SetSeconds(s);
		return *this;
	}
	Time& SetHours(int h) {
		h = (h >= 0) ? (h % 24) : 0;
		this->hours = h;
		return *this;
	}
	int GetHours() {return hours;}
	Time& SetMinutes(int m) {
		 m = (m >= 0 && m < 60) ? m : 0;
		this->minutes = m;
		return *this;
	}
	int GetMinutes() {return minutes;}
	int GetTotalMinutes() {
		return GetHours() * 60  + minutes;
	}
	Time& SetSeconds(int s) {
		s = (s >= 0 && s < 60) ? s : 0;
		this->seconds = s;
		return *this;
	}
	int GetSeconds() {return seconds;}
	int GetTotalSeconds() {
		return GetTotalMinutes() * 60 + seconds;
	}
	void PrintHHMMSS() {
		cout<<ToSring(":")<<"\n";
	}
	string ToSring(string seperator = "-") {
		string hours =to_string(this->hours);
		string minutes =to_string(this->minutes);
		string seconds =to_string(this->seconds);
		if (hours.size() == 1)
			hours = '0' + hours;
		if (minutes.size() == 1)
			minutes = '0' + minutes;
		if (seconds.size() == 1)
			seconds = '0' + seconds;
		ostringstream oss;
		oss<< hours<<seperator<<minutes<<seperator<<seconds;
		return oss.str();
	}
};
int main() {
	cout << "WARNING:"<< endl;
	cout << "The hours are calculated using a 24-hour cycle; any input exceeding 23 will wrap around." << endl;
	cout << "Hours (h), Minutes (m), Seconds (s), or All (a)?\n";
	string input;
	getline(cin, input);
	Time u(0, 0,0);
	if (input == "h" || input == "H") {
		cout << "Enter the hours: ";
		int h;
		cin >> h;
		u.SetHours(h);
	}
	else if (input == "m" || input == "M") {
		cout << "Enter the minutes: ";
		int m; cin >> m;
		u.SetMinutes(m);
	}
	else if (input == "s" || input == "S") {
		cout << "Enter the seconds:";
		int s; cin >> s;
		u.SetSeconds(s);
	}
	else {
		cout << "Enter Hours, Minutes, and Seconds:";
		int h, m, s;
		cin >> h >> m >> s;
		u.SetTime(h, m, s);
	}
	u.PrintHHMMSS();
	return 0;
}