13881388 SUSTech Online Judge
Problem 1388 --Cycles are Bad

1388: Cycles are Bad

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 1163  Solved: 225
[Submit][Status][Web Board]


Given a graph with \(n\) nodes and \(m\) edges, we define cycles as paths which start from and end at the same point (no matter how many nodes are there in the path. Single/double node(s) is also OK.) One day, a student thinks that graphs with cycles are very "bad" and graphs without cycles are really "good". But he does not know how to distinguish them. Can you help him?


Line 1: Two integers \(n(1\le n\le 10^5)\) and \(m(1\le m\le 10^5)\), which means the graph has \(n\) nodes and \(m\) edges.
There are \(m\) lines following:
Line 2~(m+1): Two integers \(u\), \(v\) which means there is an undirected edge between node \(u\) and node \(v\). Node indices are integers in range \([1,n]\).


Print whether the given graph is bad or not. Use "Bad" to indicate that the graph is bad and "Good" otherwise.

Sample Input

3 3
1 2
2 3
1 3

Sample Output