#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; int main() { int t,n,m; int i,j,k; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&m); if(n%(m+1)!=0) { printf("first "); } else printf("second "); } return 0; }