import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner s = new Scanner(System.in);
        int x = s.nextInt(),y = s.nextInt();
        int a = s.nextInt() ,b = s.nextInt();

        if (x == a && y == b)
        {
            System.out.println("nijedan");
        }
        if (x == a && b < y)
        {
            System.out.println("drugi");
        }
        if ( a < x && y == b)
        {
            System.out.println("prvi");
        }
        if (a  < x && b < y)
        {
            System.out.println("?");
        }
    }
}