// Arup Guha
// 12/19/2019
// Solution to 2019 December USACO Bronze Problem: Livestock Lineup

import java.util.*;
import java.io.*;

public class lineup {

	final public static String[] COWS = {"Beatrice", "Belinda", "Bella", "Bessie", "Betsy", "Blue", "Buttercup", "Sue"};

	public static int n;
	public static int[][] list;
	
	public static void main(String[] args) throws Exception {
		
		// For easy look up.
		HashMap<String,Integer> map = new HashMap<String,Integer>();
		for (int i=0; i<COWS.length; i++) map.put(COWS[i], i);
		
		// Read in the constraints.
		Scanner stdin = new Scanner(new File("lineup.in"));
		n = stdin.nextInt();
		
		// Store these by indexes.
		list = new int[n][2];
		for (int i=0; i<n; i++) {
			list[i][0] = map.get(stdin.next());
			for (int j=0; j<4; j++) stdin.next();
			list[i][1] = map.get(stdin.next());
		}
		
		// Set up permutation algorithm and run it!
		int[] perm = new int[COWS.length];
		boolean[] used = new boolean[COWS.length];
		go(perm, used, 0);
		
		// Output to file.
		PrintWriter out = new PrintWriter(new FileWriter("lineup.out"));
		for (int i=0; i<COWS.length; i++)
			out.println(COWS[perm[i]]);
		out.close();		
		stdin.close();
	}
	
	public static boolean go(int[] perm, boolean[] used, int k) {
		
		// Done, evalulate it.
		if (k == perm.length) return valid(perm);
			
		// Usual permutation algorithm; just return true immediately when we get our first success.
		for (int i=0; i<perm.length; i++) {
			if (!used[i]) {
				perm[k] = i;
				used[i] = true;
				boolean tmp = go(perm, used, k+1);
				if (tmp) return true;
				used[i] = false;
			}
		}
		
		// Nothing was good if we get here.
		return false;
	}
	
	public static boolean valid(int[] perm) {
		
		// Helpful to have backwards lookup table.
		int[] indexOf = new int[perm.length];
		for (int i=0; i<perm.length; i++)
			indexOf[perm[i]] = i; 
		
		// Go through each list pairing and see if they are located adjacent in the permutation array or not.
		for (int i=0; i<n; i++) 
			if (Math.abs(indexOf[list[i][0]]-indexOf[list[i][1]]) != 1)
				return false;
			
		// If we get here, we're good.
		return true;
	}
}