## An Animal Contest 7 P1 - Squirrnect 4

View as PDF

Points: 3
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Andrew was playing Connect 4 with his friend Julian when a squirrel came up and challenged him to a duel. Secretly, it was on an information gathering mission to see how Earth's strategists fared against squirrel intellect. If Andrew lost, the squirrel nation would deem Earth a suitable place to invade. It turns out that squirrels are not actually native to Earth and are not as nice as they seem ...

Squirrel Connect 4, or Squirrnect 4, is slightly different compared to the conventional version of Connect 4: The board is customizable and can have any positive integer width and height . Unfortunately, certain dimensions for the board are bad, since they would cause any games played on it to be a tie, regardless of how the two players move. This would hinder Andrew's goal of winning, so before they play each of matches, Andrew will tell you the dimensions of the board, and you must tell him whether or not it is bad.

Connect 4 explanation

Two players alternately drop tokens down the columns of a by sized board. The tokens fall straight down, stopping at the lowest cell not already occupied by another token. The first person to stack four of their own tokens in a line — whether it be horizontal, vertical or diagonal — wins.

#### Input Specification

The first line will contain a single integer .

The next lines will contain two space-separated integers and .

#### Output Specification

Output lines. On each line, output bad if the corresponding board dimensions are bad; otherwise, output good.

#### Sample Input

5
1 1
22 13
3 3
7 1
2 4

#### Sample Output

bad
good
good