시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 141 38 15 20.270%

문제

상근이는 개인이 소유한 한 중소기업의 CEO이다. 이 회사의 소유주는 자신의 아들 정인이를 회사의 팀장으로 임명했다. 상근이는 정인이가 일을 잘하면 소유주가 CEO자리를 정인이에게 줄 것이라고 생각한다. 다행히 그는 정인이의 팀에 속하는 사람을 정할 수 있다. 따라서 상근이는 정인이를 위해 최대한 일을 못하는 팀을 만드려고 한다.

상근이는 같은 팀에 속했을 때, 일을 못하는 사람들의 쌍을 모두 알고 있다. 상근이는 팀의 난이도라는 말을 주로 사용하는데, 이것은 같은 팀에 속했을 때, 일을 못하는 쌍의 수를 팀원의 수로 나눈 값이다. 팀의 난이도가 높아질수록 팀을 관리하는 것은 매우 어렵다.

팀의 난이도가 가장 높은 그룹을 찾는 프로그램을 작성하시오.

위와 같은 경우에 난이도가 가장 높은 팀은 1, 2, 4, 5로 구성된 팀이다. 총 5개의 쌍이 일을 못하는 사람의 쌍이고, 이를 팀원의 수로 나누면 5/4가 된다. 예를 들어, 이 팀에 3을 추가하면, 난이도는 6/5로 감소하게 된다.

입력

입력의 첫째 줄에는 직원의 수 n과 같은 팀에 속하면 일을 못하는 쌍의 수 m이 주어진다. (1 ≤ n ≤ 100, 0 ≤ m ≤ 1000)

다음 m개 줄에는 쌍에 속하는 두 사람의 번호 ai와 bi가 주어진다. (1 ≤ ai, bi ≤ n, ai ≠ bi) 같은 쌍이 두 번 주어지는 경우는 없다.

출력

첫째 줄에는 가장 난이도가 높은 팀에 속하는 사람의 수 k (1 ≤ k ≤ n)를 출력한다. 그 다음 k개 줄에는 팀에 속하는 사람의 번호를 오름차순으로 출력한다. 난이도가 가장 높은 팀이 여럿인 경우에는 아무거나 출력한다.

예제 입력 1

5 6
1 5
5 4
4 2
2 5
1 2
3 1

예제 출력 1

4
1
2
4
5
W3sicHJvYmxlbV9pZCI6IjM2MTEiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOi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