1 #include <iostream>
2 #include <sstream>
3 #include <fstream>
4 #include <string>
5 #include <vector>
6 #include <deque>
7 #include <queue>
8 #include <stack>
9 #include <set>
10 #include <map>
11 #include <algorithm>
12 #include <functional>
13 #include <utility>
14 #include <bitset>
15 #include <cmath>
16 #include <cstdlib>
17 #include <ctime>
18 #include <cstdio>
19 #include <cstring>
20
21 using namespace std;
22
23
24 typedef long long int ll;
25 typedef pair<int, int> P;
26 int read() {
27 int x=0,f=1;
28 char ch=getchar();
29 while(ch<‘0‘||ch>‘9‘) {
30 if(ch==‘-‘)f=-1;
31 ch=getchar();
32 }
33 while(ch>=‘0‘&&ch<=‘9‘) {
34 x=x*10+ch-‘0‘;
35 ch=getchar();
36 }
37 return x*f;
38 }
39 const double pi=3.14159265358979323846264338327950288L;
40 const double eps=1e-10;
41 const int mod = 1e9 + 7;
42 const int INF = 0x3f3f3f3f;
43 const int INT = 0x7fffffff;
44 const int MAXN = 433;
45 const int xi[] = {0, 0, 1, -1};
46 const int yi[] = {1, -1, 0, 0};
47
48
49 int main() {
50 int n, m, t;
51 scanf("%d", &t);
52 while(t--){
53 scanf("%d%d", &n, &m);
54 if(n < m) swap(n, m);
55 int Stan = 1;
56 while(n/m == 1 && n%m){
57 int t = n%m;
58 n = m;
59 m = t;
60 Stan = -Stan;
61 }
62 if(Stan == 1) printf("Stan wins\n");
63 else printf("Ollie wins\n");
64 }
65 return 0;
66 }