import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner citac = new Scanner(System.in);
		
		int a,b,x,y;
		a = citac.nextInt();
		b = citac.nextInt();
		x = citac.nextInt();
		y = citac.nextInt();
		
		if (x < a && y < b) {   
		  System.out.println("?");
	    } else if (x < a) {
	      System.out.println("prvi");
	    } else if (y < b) {
	      System.out.println("drugi");
	    } else {
	      System.out.println("nijedan");
	    }
	}
}