eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

Points and Lines

Points and Lines

Andrew and Betty used to play the game of "Points and Lines" at their Computer Science lesson. They start with a sheet of paper that has \textbf{n} points drawn on it. Players make moves in turn, Andrew moves first. Each move the player must connect two points, not yet directly connected, by a line. For example, on the picture below the player can connect points \textbf{1} and \textbf{2}, \textbf{2} and \textbf{4}, or any of \textbf{1}, \textbf{2}, \textbf{3}, \textbf{4} to any of \textbf{5}, \textbf{6}. \includegraphics{https://static.e-olymp.com/content/67/67de649fd9743cc755a05a80c654f0f37fa8f51f.jpg} If after the player's turn all points become connected, i.e. it is possible to get from each point to any other by lines, he wins the game. Recently Andrew found the sheet of paper with the unfinished game in a heap on his table. He wonders, who would win the game if he was to move next and both players acted optimally. Help him to find that out. \InputFile The first line of the input file contains \textbf{n} - the number of points, and \textbf{m} - the number of lines already drawn (\textbf{2} ≤ \textbf{n} ≤ \textbf{150}, \textbf{0} ≤ \textbf{m} ≤ \textbf{n(n-1)/2}). The following \textbf{m} lines contain two integer numbers each - the numbers of points connected by a line. \OutputFile Output "\textbf{Andrew}" if Andrew would win the game, or "\textbf{Betty}" if Betty would do.
Ліміт часу 1 секунда
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
6 5
1 4
2 3
1 3
3 4
5 6
Вихідні дані #1
Andrew
Автор Andrew Stankevich
Джерело Andrew Stankevich Contest 32, Petrozavodsk Summer Training Camp, Wednesday, September 3, 2008