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(a == x && b == y) {
			System.out.println("nijedan");
		}else if(a == x && b != y) {
			System.out.println("drugi");
		}else if(a != x && b == y) {
			System.out.println("prvi");
		}else {
			System.out.println("?");
		}
	}
}