#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
string s1,s2;
cin>>s1>>s2;
if(s1==s2){
cout<<"same";
return 0;
}
if(s1[0]=='-'&&s2[0]!='-')t=2;
else if(s2[0]=='-'&&s1[0]!='-')t=1;
else if(s2[0]=='-'&&s1[0]=='-'){
if(s1.size()==s2.size()){
if(s2>s1)t=2;
else if(s1>s2)t=1;
}
else if(s1.size()>s2.size())t=2;
else t=2;
}else{
if(s1.size()==s2.size()){
if(s1>s2)t=1;
else if(s2>s1)t=2;
}
else if(s1.size()>s2.size())t=1;
else t=2;
}
if(t==1)cout<<"first";
else cout<<"second";
}