#include <algorithm>
#include <cctype>
#include <ctime>
#include <iostream>
#include <iomanip>
#include <limits>
#include <sstream>
#include <string>

using namespace std;

int main() {
	tm tmbuf{};
	stringstream str("20:48:01.469 UTC MAR 31 2016");
	string tm_mon;

	str >> get_time(&tmbuf, "%T");
	
	str.ignore(std::numeric_limits<std::streamsize>::max(), 'C');

	str >> tm_mon >> get_time(&tmbuf, "%d %Y");

	for (const auto& i : { "JAN"s, "FEB"s, "MAR"s, "APR"s, "MAY"s, "JUN"s, "JUL"s, "AUG"s, "SEP"s, "OCT"s, "NOV"s, "DEC"s }) {
		if (equal(cbegin(tm_mon), cend(tm_mon), cbegin(i), cend(i), [](const unsigned char a, const unsigned char b) { return toupper(a) == b; })) break;
		++tmbuf.tm_mon;
	}

	cout << put_time(&tmbuf, "%m-%d-%Y") << endl;
}