import java.util.*; public class Main { static int n; static int m; static boolean list[][]; static int ans = 0; public static void main(String[] args) throws Exception { Scanner scan = new Scanner(System.in); n = scan.nextInt(); m = scan.nextInt(); list = new boolean[n][n]; for(int i=0; i 0) { if(right == con[index-1]) continue; } if(list[left][right]) { con[index+1] = right; solve(con, index+1); } } } }