var map,sav:array[0..105,0..105]of Longint; n,m,i,j,k,x,y,mi,num: Longint; Begin //assign(input,'t1.in');reset(input); //assign(output,'t1.out');rewrite(output); Readln(n,m); While n<>0 Do Begin Fillchar(map,sizeof(map),0); For i:=1 To m Do Begin Readln(x,y); map[x][y]:=1; map[y][x]:=1; End; if map[1][n]=1 Then Writeln(1,' ',(n-1)*n Div 2) Else Writeln(1,' ',1); n:=0; Readln(n,m); End; //close(input); close(output); End.