import java.util.ArrayList;
import java.util.Scanner;
/*
5 7
2 1
1 4
2 4
2 3
3 4
3 5
4 5
2
* */
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int num = 0;
int count = 0;
while (in.hasNext()) {
String s = in.nextLine();
String[] split = s.split(" ");
num = Integer.parseInt(split[0]);
count = Integer.parseInt(split[1]);
int[][] arr = new int[count][2];
for (int i = 0; i < count; i++) {
String s1 = in.nextLine();
String[] split1 =