import java.util.*;
import java.io.*;

public class ii {

	public static void main (String[] args) throws IOException {
		//System.out.println("");
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String line;
		while ((line = br.readLine()) != null) {
			if (line.equals("end")) {
				break;
			}
			
			String[] parts = line.split("/");
			if (parts.length != 2) {
				System.out.println("invalid");
				continue;
			} else {
				if (parts[0].length() != 6 || parts[1].length() > 4  || parts[1].length() < 3) {
					System.out.println("invalid");
					continue;
				} else {
					String x1 = parts[0].substring(0,2);
					String x2 = parts[0].substring(2,4);
					String x3 = parts[0].substring(4,6);
					int y1 = Integer.parseInt(x1);
					int y2 = Integer.parseInt(x2);
					int y3 = Integer.parseInt(x3);
					
					if (y1 > 9 && y1 < 20) {
						System.out.println("invalid");
						
						continue;
					}
					
					boolean boy = true;
					
					if (y2 > 50) {
						boy = false;
						y2 -= 50;
					}
					
					if (y2 < 1 || y2 > 12) {
						System.out.println("invalid");
						
						continue;
					}
						
					Calendar c = Calendar.getInstance();
					c.setLenient(false);
					try {
						if (y1 < 20) {
							c.set(y1+2000, y2-1, y3);
						} else {
							c.set(y1+1900, y2-1, y3);
						}
						
						c.getTime();
						//System.out.println(c.getTime());
					} catch (Exception e) {
						System.out.println("invalid");
						continue;
					}
					
					boolean before = false;
					
					if (y1 < 54 && y1 > 19) {
						if (parts[1].length() != 3) {
							System.out.println("invalid");
							continue;
						}
						
						
					} else {
						if (parts[1].length() != 4) {
							System.out.println("invalid");
							continue;
						}
						long x = Long.parseLong(parts[0] + parts[1]);
					if ((x % 11) != 0) {
						System.out.println("invalid");
						continue;
					}
					}
					
					
					
					if (boy) {
							System.out.println("boy");
						} else {
							System.out.println("girl");
						}
				}
			}
	

		}

	}

}
 
