import java.io.*; import java.util.*; public class bottom { public static void main( String args[] ) throws Exception { BufferedReader in=new BufferedReader(new FileReader("bottom.in") ); String S = ""; StringTokenizer T; boolean M[][]; boolean L[]; int v=-1, e=0; boolean first; while (true) { S = in.readLine(); if (S.compareTo("0")==0) break; if (v!=-1) System.out.println(""); T = new StringTokenizer( S ); v = Integer.parseInt(T.nextToken()); e = Integer.parseInt(T.nextToken()); M = new boolean[v][v]; for(int i=0; i