// Convert user-specified date from American to standard	
// format 	
	
import java.util.*;	
	
class DateTranslation {	
	
	// main(): application entry point	
	static public void main(String args[]) {	
		// produce a legend (Step 1) 	
		System.out.println("Date format translator");	
		System.out.println("   Converts a date from an American"	
				+ " format (e.g., July 4, 1776)");	
		System.out.println("   to standard format (e.g.,"	
				+ " 1776-July-4).");	
		System.out.println();	
	
		// prompt the user for a date in American format (Step 2) 	
		System.out.print("Enter a date in American format: ");	
	
		// acquire the input entered by the user (Step 3) 	
		Scanner stdin = new Scanner(System.in);	
	
		String buffer = stdin.nextLine().trim();	
	
		// echo the input back (Step 4) 	
		System.out.println("The translation of");	
		System.out.println("   " + buffer);	
	
		// get month entered by the user (Step 5) 	
		buffer = buffer.trim();	
		int m = buffer.indexOf(" ");	
		String month = buffer.substring(0, m);	
		buffer = buffer.substring(m + 1);	
	
		// get day entered by the user (Step 6) 	
		buffer = buffer.trim();	
		int n = buffer.indexOf(",");	
		String day = buffer.substring(0, n);	
		buffer = buffer.substring(n + 1);	
	
		// get year entered by the user (Step 7) 	
		String year = buffer.trim();	
	
		// create standard format version of input (Step 8) 	
		String standardDate = year + "-" + month + "-" + day;	
	
		// display the translation (Step 9) 	
		System.out.println("to standard format is");	
		System.out.println("   " + standardDate);	
	}	
}	
	
