#include<bits/stdc++.h>
using namespace std;
stack<int>st;
queue<int>q;
vector<long long int >v;
set<long long int>stt;
set<long long int>::iterator set_it;
map<long long int,long long int>mp;
//initialy map er all index er value zero thake;
//map er jonno this pointer(->) use korte hoy
//akta value dakhar jonno staristics pointer(*) use  korte hoy
// one more value print korar jonno this pointer(->) use korte hoy (must be)
map<string,int>::iterator map_it;
long long int a[20007];
long long int i,j,k,l,m,n,flag=0,cnt=0,sum=0,mx=0,mn=0;
string s1,s2;
int main()
{
    long long  int tc,a,b,d,e,s,w;
    //char c;
    cin>>tc;
    while(tc--)
    {
        cin>>s>>w;
        if(s>=w)
        {
            cout<<"unsafe"<<endl;
        }
        else
        {
            cout<<"safe"<<endl;
        }
       
    }
    return 0;

}




