#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (long long i = 0; i < (long long)(n); i++)
typedef long long  ll;
const long long MOD=1e9+7;
int main(){
    int n;
    cin>>n;
    n*=108;
    n/=100;
    if(n<206)cout<<"Yay!"<<endl;
    else if(n==206)cout<<"so-so"<<endl;
    else cout<<":("<<endl;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<pll> vpll;
typedef vector<bool> vbl;
typedef vector<vector<bool>> vvbl;

void INX(){}
template<typename Head, typename... Tail>
void INX(Head&& head, Tail&&... tail)
{
    cin >> head;
    INX(forward<Tail>(tail)...);
}
void OUTX(){}
template<typename Head, typename... Tail>
void OUTX(Head&& head, Tail&&... tail)
{
    cout << head << endl;
    OUTX(forward<Tail>(tail)...);
}

#define ADD emplace_back
#define MP make_pair
#define VVEC(type) vector<vector<type>>

//#define MOD 1000000007 // 10^9 + 7
//setprecision(10)

ll EuclideanAlgorithm(ll A, ll B)
{
    if(A > B) swap(A, B);

    ll r = 0;
    while(true)
    {
        r = B % A;
        if(r == 0)
        {
            return A; //このときのAが最大公約数
        }
        else
        {
            B = A;
            A = r;
        }
    }
}

ll modinv(ll a, ll m)
{
    ll b = m, u = 1, v = 0;
    while(b)
    {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }

    u %= m;
    if(u < 0) u += m;
    return u;
}

int main()
{
    ll T;
    INX(T);
    
    for (ll query = 0; query < T; query++)
    {
        ll N, S, K;
        INX(N, S, K);

        // S + Kx ≡ 0 mod N
        // Kx ≡ N - S mod N
        // A = K, B = N - S, M = N

        // Ax ≡ B mod M
        // d = gcd(A, B, M)
        // A = A / d, B = B / d, M = M / d
        // if gcd(A, M) != 1 then 解なし
        // else (if gcd(A, M) == 1) then x = A^(-1) * B

        ll A = K;
        ll B = N - S;
        ll M = N;

        ll d = EuclideanAlgorithm(EuclideanAlgorithm(A, B), M);
        A /= d;
        B /= d;
        M /= d;

        if(EuclideanAlgorithm(A, M) != 1)
        {
            OUTX(-1);
        }
        else
        {
            //Aの逆元とそこから答えを計算
            ll result = modinv(A, M) * B;
            result %= M;
            OUTX(result);
        }
    }
    
    return 0;
}
