#include<cstdio>
#include<iostream>
using namespace std;
inline long long get();
bool mmp(long long a,long long b,int test);
long long t,a,b;
int main()
{
freopen("euclidgame.in","r",stdin);
freopen("euclidgame.out","w",stdout);
t=get();
while(t--)
{
if(!mmp(get(),get(),0))printf("Ollie wins\n");
else printf("Stan wins\n");
}
return 0;
}
bool mmp(long long a,long long b,int test)
{
if(a<b)swap(a,b);
while(true)
{
test^=1;
if(a>2*b)return test;
int t=a;a=b;b=t%b;
if(!b)return test;
}
}
inline long long get()
{
long long t=0;char c=getchar(),j=1;
while(!isdigit(c))
if(c=='-')j=-1,c=getchar();
else c=getchar();
while(isdigit(c))
t=(t<<3)+(t<<1)+c-'0',
c=getchar();
return j*t;
}