#include<bits/stdc++.h>
using namespace std;
char ans[ ] [ 22 ] = { "Incorrect" , "Correct" } ;
int low[ 2222 ] , disc[ 2222 ] , par[ 2222 ] , vist[ 2222 ] ;
vector< int > arr[ 2222 ] ;
pair< int , int > bridg;
void dfs( int x) {
static int tim = 0 ;
low[ x] = disc[ x] = ++ tim;
vist[ x] = 1 ;
for ( int i = 0 , ln = arr[ x] .size ( ) ; i < ln; ++ i) {
int y = arr[ x] [ i] ;
if ( ! vist[ y] ) {
par[ y] = x;
dfs( y) ;
low[ x] = min( low[ x] , low[ y] ) ;
if ( low[ y] <= disc[ x] ) {
bridg = make_pair( min( x, y) , max( x, y) ) ;
}
} else if ( par[ x] ! = y) {
low[ x] = min( low[ x] , disc[ y] ) ;
}
}
}
class TheKingsRoadsDiv2 {
public :
string getAnswer( int h, vector< int > a, vector< int > b) {
int in[ 2222 ] = { } ;
set< pair< int , int > > st;
for ( size_t i = 0 ; i < a.size ( ) ; ++ i) {
if ( a[ i] == b[ i]
|| st.find ( make_pair( min( a[ i] , b[ i] ) , max( a[ i] , b[ i] ) ) )
! = st.end ( ) ) {
continue ;
}
st.insert ( make_pair( min( a[ i] , b[ i] ) , max( a[ i] , b[ i] ) ) ) ;
arr[ a[ i] ] .push_back ( b[ i] ) ;
arr[ b[ i] ] .push_back ( a[ i] ) ;
in[ a[ i] ] ++ ;
in[ b[ i] ] ++ ;
}
memset ( disc, - 1 , sizeof disc) ;
dfs( 1 ) ;
for ( int i = 1 ; i <= ( 1 << h) - 1 ; ++ i) {
if ( ! vist[ i] )
return ans[ 0 ] ;
}
in[ bridg.first ] -- ;
in[ bridg.second ] -- ;
int cnt[ 3 ] = { } ;
for ( int i = 1 ; i <= ( 1 << h) - 1 ; ++ i) {
if ( in[ i] == 2 )
++ cnt[ 0 ] ;
if ( in[ i] == 3 )
++ cnt[ 1 ] ;
if ( in[ i] == 1 )
++ cnt[ 2 ] ;
}
return ans[ cnt[ 0 ] == 1 && cnt[ 2 ] == ( 1 << (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