# include # include using namespace std; const int MAXN = 100010; int parent[ MAXN ]; int otac( int x ){ if( parent[ x ] == x ) return x; return parent[ x ] = otac( parent[ x ] ); } void connect( int a, int b ){ parent[ otac( a ) ] = otac( b ); } int N, M, K; int main( void ){ int t1, t2; scanf( "%d %d %d", &N, &M, &K ); for( int i = 0 ; i <= N ; ++i ){ parent[ i ] = i; } for( int i = 0 ; i < M ; ++i ){ scanf( "%d %d", &t1, &t2 ); connect( t1, t2 ); } for( int i = 0 ; i < K ; ++i ){ scanf( "%d %d", &t1, &t2 ); printf( otac( t1 ) == otac( t2 ) ? "SIGURNO\n" : "MOZDA\n" ); } return 0; }