# include <cstdio># include <iostream># include <set># include <map># include <vector># include <list># include <queue># include <stack># include <cstring># include <string># include <cstdlib># include <cmath># include <algorithm>using namespace std ;int a , b , c , d , e , f ;int check ( ) { if ( a > d ) return 1 ; if ( a < d ) return 0 ; if ( b > e ) return 1 ; if ( b < e ) return 0 ; if ( c > f ) return 1 ; if ( c < f ) return 0 ; return -1 ;}int main ( ) { int T ; cin >> T ; while ( T -- ) { cin >> a >> b >> c >> d >> e >> f ; if ( check ( ) == 0 ) { cout << "javaman" << endl ; } else if ( check ( ) == -1 ) { cout << "same" << endl ; } else { cout << "cpcs" << endl ; } }}


