/*
Query set processing =, and then sort the topology. When there are more than one element in the team, the conditions are insufficient. If the conditions are not used up, a conflict occurs.
*/
# Include <cstdio>
# Include <cstring>
# Include <vector>
# Include <queue>
Using namespace std;
Int u [10010], v [10010], p [10010], deg [10010];
Char opr [10010];
Vector <int> G [10010];
Int sum;
Int find (int x)
{
Return x = p [x]? X: p [x] = find (p [x]);
}
Int init (int n)
{
For (int I = 0; I <= n; I ++)
{
P [I] = I;
G [I]. clear ();
Deg [I] = 0;
}
}
Int topo (int n)
{
Queue <int> q;
For (int I = 0; I <n; I ++)
If (! Deg [I] & find (I) = I)
Q. push (I );
Int flag = 0;
While (! Q. empty ())
{
If (q. size ()> 1) flag = 1;
Int x = q. front ();
Q. pop ();
Sum --;
For (int I = 0; I <G [x]. size (); I ++)
{
Int y = G [x] [I];
If (-- deg [y] = 0)
{
Q. push (y );
}
}
}
If (sum> 0) puts ("CONFLICT ");
Else if (flag) puts ("UNCERTAIN ");
Else puts ("OK ");
}
Int main ()
{
Int n, m;
While (scanf ("% d", & n, & m) = 2)
{
Init (n );
Sum = n;
For (int I = 0; I <m; I ++)
{
Scanf ("% d % c % d", & u [I], & opr [I], & v [I]);
If (opr [I] = ')
{
Int x = find (u [I]);
Int y = find (v [I]);
If (x! = Y)
{P [y] = x;
Sum --;}
}
}
For (int I = 0; I <m; I ++)
{
If (opr [I] = ') continue;
Int x = find (u [I]);
Int y = find (v [I]);
If (opr [I] = '> ')
{
G [x]. push_back (y );
Deg [y] ++;
}
Else
{
G [y]. push_back (x );
Deg [x] ++;
}
}
Topo (n );
}
Return 0;
}