#include <bits/stdc++.h>
using namespace std;
int a,b,x,y;
int main(){
  cin>>a>>b;
  cin>>x>>y;
  a-=x;
  b-=y;
  if(a==0 and b==0)cout<<"nijedan"<<"\n";
  if(a==0 and b!=0)cout<<"drugi"<<"\n";
  if(a!=0 and b==0)cout<<"treci"<<"\n";
  if(a!=0 and b!=0)cout<<"?"<<"\n";


 return 0;
}