Livestock Lineup#10286

Livestock Lineup

1 second
128 megabytes
Very easy

Every day, Farmer John milks his dairy cows: Bessie, Buttercup, Belinda, Beatrice, Bella, Blue, Betsy, and Sue.

The cows are rather picky and require that Farmer John milks them in an order that respects constraints. Each constraint is of the form "X must be milked beside Y", meaning cow X must appear in the milking order either immediately after cow Y or immediately before cow Y.

Help Farmer John determine an ordering of his cows that satisfies all the given constraints. It is guaranteed that a valid ordering always exists. If there are several valid orderings, output the one that is alphabetically first. That is, the first cow should be the one with the alphabetically smallest name among all cows that may appear first in any valid ordering. Among all orderings starting with this first cow, the second cow should be alphabetically smallest among all possible valid orderings, and so on.

Input

The first line contains the integer (1 \leq n \leq 7). Each of the next lines contains a sentence describing a constraint of the form "X must be milked beside Y", where X and Y are names of Farmer John's cows (the eight possible names are listed above).

Output

Output lines — the ordering of the cows, one per line, satisfying all constraints. If multiple orderings are valid, output the alphabetically first one.

Examples

Example 1

Loading
Loading