using System.Console;for(;;)WriteLine(System.DateTime.ParseExact(ReadLine(),"yyyy M d",null).DayOfWeek:>int)