#include <iostream>

using namespace std; 

string ispis(int a, int b, int x, int y) {
    
    if(a == x) {
        
        if(b == y) { return "nijedan"; }
        return "drugi"; 
        
    }
    
    if(b == y) { return "prvi"; }
    
    return "?"; 
    
}

int main() {
    
    ios_base::sync_with_stdio(false); 
    cin.tie(0); 
    cout.tie(0); 
    
    int a, b; 
    int x, y; 
    
    cin>>a>>b;
    cin>>x>>y; 
    
    cout<<ispis(a, b, x, y); 
    
    return 0; 
    
}