/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
//import java.util.regex.*;
import java.util.regex.Matcher; 
import java.util.regex.Pattern;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner myObj = new Scanner(System.in);  // Create a Scanner object
		
		//stackoverflow/questions/2296685/how-to-read-input-with-multiple-lines-in-java
		//stackoverflow/questions/56887493/how-to-take-multi-line-input-in-java search:HashmatWarrior
		while(myObj.hasNext()) // see if there's more
		{
			String schedule = myObj.nextLine();  // Read user input (from w3schools/java/java_user_input.asp)
			//stackoverflow/questions/10004066/java-splitting-an-input-file-by-colons
			String schedParts[] = schedule.split("\t");
			String workDay=schedParts[0];
			if(schedParts.length>1)
			{
				String workDate=schedParts[1];
				System.out.print(workDay+" "+workDate+", ");
				if(schedParts.length>2)
				{
					String workTime=schedParts[2];
					String workLength=schedParts[3];
					//w3 schools
					String matchMe="(pm)|( O)|( )";
					Pattern pattern = Pattern.compile(matchMe);
					Matcher matcher = pattern.matcher(workTime);
					workTime = matcher.replaceAll("");
					boolean matchFound = matcher.find();
					System.out.print(workTime+", ");
				}
				System.out.println();
			}
		else if(schedParts.length==1)
			{
				System.out.println();
			}
		}
	}
}
				Sun 12/22 4:30pm - 9:30pm O 5:00 Mon 12/23 Tue 12/24 Wed 12/25 Thu 12/26 Fri 12/27 5:30pm - 10:30pm O 5:00 Sat 12/28 5:30pm - 10:30pm O 5:00 Sun 12/29 5:30pm - 9:30pm O 4:00 Mon 12/30 5:30pm - 10:30pm O 5:00 Tue 12/31 Wed 1/1 Thu 1/2 Fri 1/3 5:30pm - 10:30pm O 5:00 Sat 1/4 5:30pm - 10:30pm O 5:00
Sun 12/22, 4:30-9:30, Mon 12/23, Tue 12/24, Wed 12/25, Thu 12/26, Fri 12/27, 5:30-10:30, Sat 12/28, 5:30-10:30, Sun 12/29, 5:30-9:30, Mon 12/30, 5:30-10:30, Tue 12/31, Wed 1/1, Thu 1/2, Fri 1/3, 5:30-10:30, Sat 1/4, 5:30-10:30,