#OJ1587. YOU CAN!
YOU CAN!
YOU CAN!
Time Limit: 1 Sec Memory Limit: 128 MB
Description
Two polar bears Menshykov and Uslada from the St.Petersburg zoo and elephant Horace from the Kiev zoo got six sticks to play with and assess the animals' creativity. Menshykov, Uslada and Horace decided to make either an elephant or a bear from those sticks. They can make an animal from sticks in the following way:
Four sticks represent the animal's legs, these sticks should have the same length. Two remaining sticks represent the animal's head and body. The bear's head stick must be shorter than the body stick. The elephant, however, has a long trunk, so his head stick must be as long as the body stick. Note that there are no limits on the relations between the leg sticks and the head and body sticks. Your task is to find out which animal can be made from the given stick set. The zoo keeper wants the sticks back after the game, so they must never be broken, even bears understand it.
Input
There are multiple test cases. In each test case, there's a single line containing six space-separated integers li (1≤li≤9) — the lengths of the six sticks. It is guaranteed that the input is such that you cannot make both animals from the sticks.
Output
If you can make a bear from the given set, print string "Bear" (without the quotes). If you can make an elephant, print string "Elephant" (wthout the quotes). If you can make neither a bear nor an elephant, print string "Alien" (without the quotes).
Sample Input
4 2 5 4 4 4
Sample Output
Bear
HINT
Append Code
Source