#include <iostream>
//#include <fstream>
//#include <iomanip>
//#include <cmath>
//#include <algorithm>
//#include <string>
//#include <vector>
//#include <utility>
//#include <map>
//#include <ctime>
//#include <cctype>
//#include <cstdlib>
//#include <limits>
//#include <numeric>
//#include <mycpp.h>

using namespace std;

int main()
{
	std::ios_base::sync_with_stdio(false);
	int a, b, x, y;
	cin >> a >> b >> x >> y;
	if(a == x && b == y) cout << "nijedan" << endl;
	else if(a > x && b > y) cout << "?" << endl;
	else if(a > x) cout << "prvi" << endl;
	else cout << "drugi" << endl;
}