#include <iostream>
#include <vector>
#include <cmath>
#include <unordered_map>
#include <fstream>
#include <string>

int main()
{
	std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0);
	int a, b, c, d;
	std::cin >> a >> b >> c >> d;

	if (a == c && b != d) {
		std::cout << "drugi" << std::endl;
	}
	else if (b == d && a != c) {
		std::cout << "prvi" << std::endl;
	}
	else if (b == d && a == c) {
		std::cout << "nijedan" << std::endl;
	}
	else {
		std::cout << "?" << std::endl;
	}

	return 0;
}