#include <bits/stdc++.h>
using namespace std;
int main(){
//4个点
int x[4];
int y[4];
int i,j;
//读入4个点的坐标
for(i = 0;i < 4;i++){
cin>>x[i];
cin>>y[i];
}
sort(x,x + 4);
sort(y,y + 4);
//统计4个点中x和y最多相同的数值有几个
int cx = 0,cy = 0;//存最多相同值的数量
for(i = 0;i < 3;i++){
for(j = i + 1;j < 4;j++){
if(x[i] == x[j]) cx++;
if(y[i] == y[j]) cy++;
}
}
if(cx == 6 || cy == 6){
cout<<"zhisi"<<endl;
}else if(cx == 2 && cy == 2){
cout<<"fangsi"<<endl;
}else if(cx == 3 || cy == 3){
//曲四或丁四
if(cx == 3){
//中间2个相同是丁四
if(y[1] == y[2]){
cout<<"dingsi"<<endl;
}else{
cout<<"qusi"<<endl;
}
} else{
if(x[1] == x[2]){
cout<<"dingsi"<<endl;
}else{
cout<<"qusi"<<endl;
}
}
}else{
cout<<"wansi"<<endl;
}
}
/**************************************************************
Problem: 1534
User: admin
Language: C++
Result: Accepted
Time:48 ms
Memory:2076 kb
****************************************************************/