import java.util.*;

public class ii {
// 010229/0001
	public static void main(String[] srgs) {
	
		Scanner sc = new Scanner(System.in);
		
		while(sc.hasNextLine()) {
			String line = sc.nextLine();
			if (line.equals("end")) {
				break;
			}
			if (line.length() == 10 || line.length() == 11) {
				try {
					int year, month, day;
					
					year = Integer.parseInt(line.substring(0,2));
					month = Integer.parseInt(line.substring(2,4));
					day = Integer.parseInt(line.substring(4,6));
										
 					if (('/' == line.charAt(6)) == false) {
 						throw new Exception("23");
 					}
					if (month == 2) {
						if ((year % 4) != 0) {
							if (day > 28) {
								throw new Exception("500");
							}
						} else {
							if (day > 29) {
								throw new Exception("511");
							}
						}
					}					

					if (year > 9 && year < 20) {
						throw new Exception("27");
					}
					if (year <= 9) {
						year = 56;
					}
					if (year >= 54) {
						if (line.length() == 10) {
							throw new Exception("28");
						} else {
							long number = Long.parseLong(line.replace("/", ""));
							if ((number % 11) != 0) {
								throw new Exception("32");
							}
						}
					} else {
						if (line.length() == 11) {
							throw new Exception("37");
						}
					}
					if (month == 4 || month == 6 || month == 6 || month == 9 || month == 11) {
						if (day > 30) {
							throw new Exception("488");
						}
					}
					if ((day > 0 && day < 32) == false) {
						throw new Exception("42");
					}
					if ((month > 0 && month < 13) || (month > 50 && month < 63)) {
						if (month > 50) {
							System.out.println("girl");
						} else {
							System.out.println("boy");
						}
					} else {
						throw new Exception("51");
					}

					
				} catch (Exception e) {
					System.out.println("invalid");
				}
			} else {
				System.out.println("invalid");
			}
		}
	}

}