CSES - KILO 2016 3/5 - Time bomb
  • Time limit: 1.00 s
  • Memory limit: 512 MB

Uolevi is defusing a time bomb. There seems to be a number which is ticking down in the LED display of the bomb. Uolevi has learned from undisclosed sources that the bomb can be defused by pressing the button if the number is divisible by 97. Help Uolevi by creating a program that, given the display as input, tells if it is possible to defuse the bomb at that moment.

The digits in the display are 5 \times 3 arrays in the following format. The digits are separated by columns of .

###...#.###.###.#.#.###.###.###.###.###
#.#...#...#...#.#.#.#...#.....#.#.#.#.#
#.#...#.###.###.###.###.###...#.###.###
#.#...#.#.....#...#...#.#.#...#.#.#...#
###...#.###.###...#.###.###...#.###.###

Input

The input consists of 5 lines containing characters . and # representing the number n on the screen. Refer to examples for understanding the input format.

Output

Output BEER!! if it is possible to defuse the bomb at the moment and BOOM! otherwise.

Constraints

  • 1 \le n < 10^9

Examples

Input:

###.###...#
..#.#.#...#
###.###...#
#.....#...#
###.###...#

Output:

BEER!!

Input:

###.#.#.###
#...#.#...#
###.###.###
..#...#...#
###...#.###

Output:

BOOM!