1. 

/**
* FWP, Ausgew√¤hlte Probleme aus dem ACM Programming Contest, SS10
* Problem: 10004 - Bicoloring
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=945
*
* @author Evgeni Pavlidis
* @version 1.0, 06/02/2010
*
* Method : Graphs - DFS
* Status : Accepted
* Runtime: 0.156
*/

import java.io.*;
import java.util.*;

class Main {


private static int n, edges, a, b;
private static Map<Integer, Set<Integer>> g = new HashMap<Integer, Set<Integer>>();
private static int[] color;
private static Set<Integer> visited = new HashSet<Integer>();

private static boolean dfs(int node, int c)
{
color[node] = c;
visited.add(node);
for(int j : g.get(node))
if(visited.contains(j))
{
if(color[j] == c)
return false;
}
else
if(!dfs(j, (c + 1) % 2))
return false;

return true;
}

public static void main(String...args)
{
Scanner sc = new Scanner(System.in);
while(true)
{
n = sc.nextInt();
if(n == 0)
break;

color = new int[n];
visited.clear();
g.clear();

for(int i = 0; i < n; i++)
g.put(i, new HashSet<Integer>());

edges = sc.nextInt();
for(int e = 0; e < edges; e++)
{
a = sc.nextInt();
b = sc.nextInt();
g.get(a).add(b);
g.get(b).add(a);
}

System.out.println((dfs(0,0)? "" : "NOT ") + "BICOLORABLE.");
}
}
}