#include <iostream>
using namespace std;
int main(void)
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int a,b;
    cin >> a >> b;
    int x,y;
    cin >> x >> y;

    x-=a; 
    y-=b;
    
    if(x == 0 && y > 0)
        cout << "drugi\n";
    else if(y == 0 && x > 0)
        cout << "prvi\n";
    else if(y == x)
        cout << "nijedan\n";
    else cout << "?\n";
    return 0;
}