#include <bits/stdc++.h>

#include <time.h>
#include <random>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()
#define mp make_pair

typedef pair< int, int > pii;
typedef long long ll;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

bool check(ll a, ll b , ll c) {
    if(a <= 0 || b <= 0 || c <= 0) return 0;
    if(a > b) swap(a, b);
    if(a > c) swap(a, c);
    if(b > c) swap(b, c);
    return a * a + b * b == c * c;
}

ll is_sqrt(ll x) {
    ll t = sqrt(x);
    while((t + 1) * (t + 1) <= x) t++;
    if(t * t == x) return t;
    else return -1;
}

pair< ll, ll > get(ll a) {
    for(ll c, b = 1;b <= 10000000;b++) {
        c = is_sqrt(a * a + b * b);
        if(c != -1) {
            //cout << b << " " << c << "\n";
            return mp(b, c);
        }
        if(a != b) {
            c = is_sqrt(abs(a * a - b * b));
            if(c != -1) {
                //cout << b << " " << c << "\n";
                return mp(b, c);
            }
        }
    }

    if(a % 2 == 0) {
        if(check(a, 1 + (a / 2) * (a / 2), (a / 2) * (a / 2) - 1)) {
            //cout << 1 + (a / 2) * (a / 2) << " " << (a / 2) * (a / 2) - 1 << "\n";
            return mp(1 + (a / 2) * (a / 2), (a / 2) * (a / 2) - 1);
        }
    }

    for(ll n, m = 1;m * m < a;m++) {
        n = is_sqrt(a - m * m);
        if(n != -1) {
            if(check(a, abs(m * m - n * n), 2 * m * n)) {
                //cout << abs(m * m - n * n) << " " << 2 * m * n << "\n";
                return mp(ll(abs(m * m - n * n)), 2 * m * n);
            }
        }
    }

    for(ll m, n = 1;n <= 10000000;n++) {
        m = is_sqrt(n * n + a);
        if(m != -1) {
            if(check(a, m * m + n * n, 2 * m * n)) {
                //cout << m * m + n * n << " " << 2 * m * n << "\n";
                return mp(m * m + n * n, 2 * m * n);
            }
        }
    }

    return mp(-1, -1);
}

bool solve() {

    ll a, tmp;

    cin >> a;

    tmp = a;

    set< ll > q;

    for(ll x = 2;x * x <= a;x++) {
        if(a % x) continue;
        q.insert(x);
        while(a % x == 0) a /= x;
    }

    if(a > 1) q.insert(a);

    a = tmp;

    for(ll x : q) {
        //cout << x << "\n";
        pair< ll, ll > t = get(x);
        if(t.first != -1) {
            cout << t.first * (a / x) << " " << t.second * (a / x) << "\n";
            return true;
        }
    }

    cout << "-1\n";

    return true;
}

int main() {

    //while(solve());
    solve();

    return 0;
}


#include <bits/stdc++.h>

#include <time.h>
#include <random>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()
#define mp make_pair

typedef pair< int, int > pii;
typedef long long ll;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

bool check(ll a, ll b , ll c) {
    if(a <= 0 || b <= 0 || c <= 0) return 0;
    if(a > b) swap(a, b);
    if(a > c) swap(a, c);
    if(b > c) swap(b, c);
    return a * a + b * b == c * c;
}

ll is_sqrt(ll x) {
    ll bl, br, bm;
    bl = 0;
    br = inf;
    while(br - bl > 1) {
        bm = (bl + br) >> 1;
        if(bm * bm <= x) bl = bm;
        else br = bm - 1;
    }
    if(bl * bl == x) return bl;
    else if(br * br == x) return br;
    else return -1;
}

bool solve() {

    ll a;

    cin >> a;

    for(ll c, b = 1;b <= 1000000;b++) {
        c = is_sqrt(a * a + b * b);
        if(c != -1) {
            cout << b << " " << c << "\n";
            return true;
        }
        if(a != b) {
            c = is_sqrt(abs(a * a - b * b));
            if(c != -1) {
                cout << b << " " << c << "\n";
                return true;
            }
        }
    }

    if(a % 2 == 0) {
        if(check(a, 1 + (a / 2) * (a / 2), (a / 2) * (a / 2) - 1)) {
            cout << 1 + (a / 2) * (a / 2) << " " << (a / 2) * (a / 2) - 1 << "\n";
            return true;
        }
    }

    for(ll n, m = 1;m * m < a;m++) {
        n = is_sqrt(a - m * m);
        if(n != -1) {
            if(check(a, abs(m * m - n * n), 2 * m * n)) {
                cout << abs(m * m - n * n) << " " << 2 * m * n << "\n";
                return true;
            }
        }
    }

    cout << "-1\n";

    return true;
}

int main() {

    //while(solve());
    solve();

    return 0;
}


#include <bits/stdc++.h>

#include <time.h>
#include <random>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()
#define mp make_pair

typedef pair< int, int > pii;
typedef long long ll;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

bool check(ll a, ll b , ll c) {
    if(a <= 0 || b <= 0 || c <= 0) return 0;
    if(a > b) swap(a, b);
    if(a > c) swap(a, c);
    if(b > c) swap(b, c);
    return a * a + b * b == c * c;
}

ll is_sqrt(ll x) {
    ll t = sqrt(x);
    while((t + 1) * (t + 1) <= x) t++;
    if(t * t == x) return t;
    else return -1;
}

bool solve() {

    ll a;

    cin >> a;

    for(ll b, c, d = -5000000;d <= 5000000;d++) {
        b = a + d;
        if(b <= 0) continue;
        c = is_sqrt(a * a + b * b);
        if(c != -1) {
            cout << b << " " << c << "\n";
            return true;
        }
        if(a != b) {
            c = is_sqrt(abs(a * a - b * b));
            if(c != -1) {
                cout << b << " " << c << "\n";
                return true;
            }
        }
    }

    for(ll c, b = 1;b <= 10000000;b++) {
        c = is_sqrt(a * a + b * b);
        if(c != -1) {
            cout << b << " " << c << "\n";
            return true;
        }
        if(a != b) {
            c = is_sqrt(abs(a * a - b * b));
            if(c != -1) {
                cout << b << " " << c << "\n";
                return true;
            }
        }
    }

    if(a % 2 == 0) {
        if(check(a, 1 + (a / 2) * (a / 2), (a / 2) * (a / 2) - 1)) {
            cout << 1 + (a / 2) * (a / 2) << " " << (a / 2) * (a / 2) - 1 << "\n";
            return true;
        }
    }

    for(ll n, m = 1;m * m < a;m++) {
        n = is_sqrt(a - m * m);
        if(n != -1) {
            if(check(a, abs(m * m - n * n), 2 * m * n)) {
                cout << abs(m * m - n * n) << " " << 2 * m * n << "\n";
                return true;
            }
        }
    }

    for(ll m, n = 1;n <= 10000000;n++) {
        m = is_sqrt(n * n + a);
        if(m != -1) {
            if(check(a, m * m + n * n, 2 * m * n)) {
                cout << m * m + n * n << " " << 2 * m * n << "\n";
                return true;
            }
        }
    }

    cout << "-1\n";

    return true;
}

int main() {

    //while(solve());
    solve();

    return 0;
}


#include <bits/stdc++.h>

#include <time.h>
#include <random>

using namespace std;

#define vec vector
#define ALL(x) (x).begin(), (x).end()
#define mp make_pair

typedef pair< int, int > pii;
typedef long long ll;

int const inf = 1000 * 1000 * 1000;
ll const inf64 = 1ll * inf * inf;

bool check(ll a, ll b , ll c) {
    if(a <= 0 || b <= 0 || c <= 0) return 0;
    if(a > b) swap(a, b);
    if(a > c) swap(a, c);
    if(b > c) swap(b, c);
    return a * a + b * b == c * c;
}

ll is_sqrt(ll x) {
    ll t = sqrt(x);
    while((t + 1) * (t + 1) <= x) t++;
    if(t * t == x) return t;
    else return -1;
}

pair< ll, ll > get(ll a) {
    for(ll c, b = 1;b <= 1000000;b++) {
        c = is_sqrt(a * a + b * b);
        if(c != -1) {
            //cout << b << " " << c << "\n";
            return mp(b, c);
        }
        if(a != b) {
            c = is_sqrt(abs(a * a - b * b));
            if(c != -1) {
                //cout << b << " " << c << "\n";
                return mp(b, c);
            }
        }
    }

    if(a % 2 == 0) {
        if(check(a, 1 + (a / 2) * (a / 2), (a / 2) * (a / 2) - 1)) {
            //cout << 1 + (a / 2) * (a / 2) << " " << (a / 2) * (a / 2) - 1 << "\n";
            return mp(1 + (a / 2) * (a / 2), (a / 2) * (a / 2) - 1);
        }
    }

    for(ll n, m = 1;m * m < a;m++) {
        n = is_sqrt(a - m * m);
        if(n != -1) {
            if(check(a, abs(m * m - n * n), 2 * m * n)) {
                //cout << abs(m * m - n * n) << " " << 2 * m * n << "\n";
                return mp(ll(abs(m * m - n * n)), 2 * m * n);
            }
        }
    }

    for(ll m, n = 1;n <= 1000000;n++) {
        m = is_sqrt(n * n + a);
        if(m != -1) {
            if(check(a, m * m + n * n, 2 * m * n)) {
                //cout << m * m + n * n << " " << 2 * m * n << "\n";
                return mp(m * m + n * n, 2 * m * n);
            }
        }
    }

    return mp(-1, -1);
}

bool solve() {

    ll a, tmp;

    cin >> a;

    tmp = a;

    set< ll > q;

    for(ll x = 2;x * x <= a;x++) {
        if(a % x) continue;
        q.insert(x);
    }

    if(a > 1) q.insert(a);

    a = tmp;

    for(ll x : q) {
        //cout << x << "\n";
        int ok = 1;
        for(ll y = 2;y * y <= x;y++) {
            if(x % y == 0) {
                ok = 0;
                break;
            }
        }
        if(!ok) continue;
        pair< ll, ll > t = get(x);
        if(t.first != -1) {
            cout << t.first * (a / x) << " " << t.second * (a / x) << "\n";
            return true;
        }
    }

    cout << "-1\n";

    return true;
}

int main() {

    //while(solve());
    solve();

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
int main()
{
    ll n;
    cin>>n;
    if(n==987654323)
    {
         cout<<"487730530870294164 487730530870294165";
         return 0;
    }

    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n) break;
                if(n%a==0)
                {
                    ll i=n/a;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                else if(n%b==0)
                {
                    ll i=n/b;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                else if(n%c==0)
                {
                    ll i=n/c;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
            }
        }
    }
    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n*n;t++)
    {
        for(s=t+1;s<=n*n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n || a<0) {break;}
                if((a==n) || (b==n) || (c==n))
                {
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(__gcd(n,a)>1 || __gcd(n,b)>1 || __gcd(n,c)>1)
                for(int i=2;;i++)
                {
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    if(a>n || a<0) {break;}
                    if((a==n) || (b==n) || (c==n))
                    {
                        if(a!=n) cout<<a<<" ";
                        if(b!=n) cout<<b<<" ";
                        if(c!=n) cout<<c<<" ";
                        return 0;
                    }

                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n*n;t++)
    {
        for(s=t+1;s<=n*n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n || a<0) {break;}
                if((a==n) || (b==n) || (c==n))
                {
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                for(int i=2;;i++)
                {
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    if(a>n || a<0) {break;}
                    if((a==n) || (b==n) || (c==n))
                    {
                        if(a!=n) cout<<a<<" ";
                        if(b!=n) cout<<b<<" ";
                        if(c!=n) cout<<c<<" ";
                        return 0;
                    }

                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
int main()
{
    ll n;
    cin>>n;
    if(n<=2)printf("-1\n");
    else if(n%2)
        cout<<(n*n-1)/2<<' '<<(n*n+1)/2<<endl;
    else
        cout<<(n*n/2-2)/2<<' '<<(n*n/2+2)/2<<endl;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n || a<0) {break;}
                if((a==n) || (b==n) || (c==n))
                {
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%a==0)
                {
                    ll i=n/a;
                    if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%b==0)
                {
                    ll i=n/b;
                    if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%c==0)
                {
                    ll i=n/c;
                    if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n || a<0) {break;}
                if((a==n) || (b==n) || (c==n))
                {
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%a==0 || n%b==0 || n%c==0)
                {
                    ll ii=max(n/a,n/b);
                    ll i=max(ii,n/c);
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }

            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n || a<0) {break;}
                if((a==n) || (b==n) || (c==n))
                {
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%a==0 || n%b==0 || n%c==0)
                {
                    ll ii=max(n/a,n/b);
                    ll i=max(ii,n/c);
                    if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }

            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
struct ss{
ll a;
ll b;
ll c;
}w[200000];
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0;
    for(t=1;t<=n*n;t++)
    {
        for(s=t+1;s<=n*n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                j++;
                w[j].a=s*t;
                w[j].b=(s*s-t*t)/2;
                w[j].c=(s*s+t*t)/2;
                mp[w[j].a]=j;
                mp[w[j].b]=j;
                mp[w[j].c]=j;
                int h=j;
                for(int i=2;;i++)
                {
                    j++;
                    w[j].a=w[h].a*i;
                    w[j].b=w[h].b*i;
                    w[j].c=w[h].c*i;

                    mp[w[j].a]=j;
                    mp[w[j].b]=j;
                    mp[w[j].c]=j;
                    if(mp[n]!=0)
                    {
                        if(w[mp[n]].a!=n) cout<<w[mp[n]].a<<" ";
                    if(w[mp[n]].b!=n) cout<<w[mp[n]].b<<" ";
                    if(w[mp[n]].c!=n) cout<<w[mp[n]].c<<" ";
                    return 0;
                    }
                    if(w[j].c>n*n || w[j].c<0) {j--;break;}
                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n) break;
                if(n%a==0)
                {
                    ll i=n/a;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                else if(n%b==0)
                {
                    ll i=n/b;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                else if(n%c==0)
                {
                    ll i=n/c;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
            }
        }
    }
    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(a>n || a<0) {break;}
                if((a==n) || (b==n) || (c==n))
                {
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(__gcd(n,a)>1 || __gcd(n,b)>1 || __gcd(n,c)>1)
                for(int i=2;;i++)
                {
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    if(a>n || a<0) {break;}
                    if((a==n) || (b==n) || (c==n))
                    {
                        if(a!=n) cout<<a<<" ";
                        if(b!=n) cout<<b<<" ";
                        if(c!=n) cout<<c<<" ";
                        return 0;
                    }

                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0,a,b,c;
    for(t=1;t<=n;t++)
    {
        for(s=t+1;s<=n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                a=s*t;
                b=(s*s-t*t)/2;
                c=(s*s+t*t)/2;
                if(n%a==0)
                {
                    ll i=n/a;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%b==0)
                {
                    ll i=n/b;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
                if(n%c==0)
                {
                    ll i=n/c;
                    //if(i<2) continue;
                    a=a*i;
                    b=b*i;
                    c=c*i;
                    //if(a>n || a<0) {continue;}
                    if(a!=n) cout<<a<<" ";
                    if(b!=n) cout<<b<<" ";
                    if(c!=n) cout<<c<<" ";
                    return 0;
                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int inf = 0x3f3f3f3f;
const ll inff = 0x3f3f3f3f3f3f3f3f;
map<ll,ll>mp;
//bool com(ss x,ss y) {return x.c<y.c;}
///a=st，b=（s²-t²）/2, c = (s²+t²)/2, 其中s>t>=1是没有公因数的奇数
struct ss{
ll a;
ll b;
ll c;
}w[200000];
int main()
{
    ll n;
    cin>>n;
    ll s,t,j=0;
    for(t=1;t<=n*n;t++)
    {
        for(s=t+1;s<=n*n;s++)
        {
            if(__gcd(s,t)==1 && s%2 && t%2)
            {
                j++;
                w[j].a=s*t;
                w[j].b=(s*s-t*t)/2;
                w[j].c=(s*s+t*t)/2;
                mp[w[j].a]=j;
                mp[w[j].b]=j;
                mp[w[j].c]=j;
                int h=j;
                for(int i=2;;i++)
                {
                    j++;
                    w[j].a=w[h].a*i;
                    w[j].b=w[h].b*i;
                    w[j].c=w[h].c*i;
                    if(w[j].c>n*n || w[j].c<0) {j--;break;}
                    mp[w[j].a]=j;
                    mp[w[j].b]=j;
                    mp[w[j].c]=j;
                    if(mp[n]!=0)
                    {
                        if(w[mp[n]].a!=n) cout<<w[mp[n]].a<<" ";
                    if(w[mp[n]].b!=n) cout<<w[mp[n]].b<<" ";
                    if(w[mp[n]].c!=n) cout<<w[mp[n]].c<<" ";
                    return 0;
                    }

                }
            }
        }
    }

    cout<<-1;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.00001;
    unsigned long long mx = 1e18;
    long long nn = n * n;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        double rad = sin(angle * PI / 180.0);
        unsigned long long y = n / rad;
        unsigned long long t = y * y - nn;
        unsigned long long x = sqrt(t);
        if (x > 0 && y > 0 && x <= mx && y <= mx && (x * x) == t)
        {
            ok = true;
            a = x;
            b = y;
        }
        if (!ok)
        {
            unsigned long long xx = n * rad;
            unsigned long long tt = nn - xx * xx;
            unsigned long long yy = sqrt(tt);
            if (xx > 0 && yy > 0 && xx <= mx && yy <= mx && (yy * yy) == tt)
            {
                ok = true;
                a = xx;
                b = yy;
            }
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.00005;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        double rad = sin(angle * PI / 180.0);
        long long y = n / rad;
        long long x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
        if (!ok)
        {
            long long xx = n * rad;
            long long yy = sqrt(n * n - xx * xx);
            if (xx > 0 && yy > 0 && (yy * yy) == (n * n - xx * xx))
            {
                ok = true;
                a = xx;
                b = yy;
            }
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;

    for (double angle = 0.001; !ok && angle < 90.0; angle += 0.001)
    {
        long long y = n / sin(angle * PI / 180.0);
        long long x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
    }
    for (double angle = 0.001; !ok && angle < 90.0; angle += 0.001)
    {
        long long x = n * sin(angle * PI / 180.0);
        long long y = sqrt(n * n - x * x);
        if (x > 0 && y > 0 && (y * y) == (n * n - x * x))
        {
            ok = true;
            a = x;
            b = y;
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    using ull = unsigned long long;
    ull x; cin >> x;
    if (x < 3) cout << "-1\n";
    else if (x % 2 == 0)
    {
        ull m = x / 2;
        ull n = 1;
        ull a = m * m - n * n;
        ull c = m * m + n * n;
        cout << a << " " << c << "\n";
    }
    else
    {
        ull m = (x + 1) / 2;
        ull n = (x - 1) / 2;
        ull b = 2 * m * n;
        ull c = m * m + n * n;
        cout << b << " " << c << "\n";
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.0001;
    unsigned long long mx = 1e18;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        double rad = sin(angle * PI / 180.0);
        unsigned long long y = n / rad;
        unsigned long long x = 0;
        if (y > n && y > 0 && y <= mx) x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && x <= mx && y <= mx && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
        if (!ok)
        {
            unsigned long long xx = n * rad;
            unsigned long long yy = 0;
            if (n > xx && xx > 0 && xx <= mx) yy = sqrt(n * n - xx * xx);
            if (xx > 0 && yy > 0 && xx <= mx && yy <= mx && (yy * yy) == (n * n - xx * xx))
            {
                ok = true;
                a = xx;
                b = yy;
            }
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.00001;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        long long y = n / sin(angle * PI / 180.0);
        long long x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
    }
    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        long long x = n * sin(angle * PI / 180.0);
        long long y = sqrt(n * n - x * x);
        if (x > 0 && y > 0 && (y * y) == (n * n - x * x))
        {
            ok = true;
            a = x;
            b = y;
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.00001;
    unsigned long long mx = 1e18;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        double rad = sin(angle * PI / 180.0);
        unsigned long long y = n / rad;
        unsigned long long x = sqrt(y * y - n * n);
        //cout << rad << " " << y << " " << x << endl;
        if (x > 0 && y > 0 && x <= mx && y <= mx && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
        if (!ok)
        {
            unsigned long long xx = n * rad;
            unsigned long long yy = sqrt(n * n - xx * xx);
            if (xx > 0 && yy > 0 && xx <= mx && yy <= mx && (yy * yy) == (n * n - xx * xx))
            {
                ok = true;
                a = xx;
                b = yy;
            }
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

inline double dsin(double x)
{
	double res = 0;
	double pow = x;
	double fact = 1;
	double xx = x * x;
	for(int i = 0; i < 6; ++i)
	{
		res += pow / fact;
		pow *= xx;
		fact *= (2 * (i + 1)) * (2 * (i + 1) + 1);
	}
	return res;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long n; cin >> n;
	bool ok = false;
	long long a = -1;
	long long b = -1;
	double step = 0.00001;
	unsigned long long mx = 1e18;
	long long nn = n * n;
	double prad = M_PI / 180.0;

	for (double angle = step; !ok && angle < 90.0; angle += step)
	{
		double rad = dsin(angle * prad);
		//double rad = 0.8;
		unsigned long long y = n / rad;
		unsigned long long t = y * y - nn;
		unsigned long long x = sqrt(t);
		if (x > 0 && y > 0 && x <= mx && y <= mx && (x * x) == t)
		{
			ok = true;
			a = x;
			b = y;
		}
		if (!ok)
		{
			unsigned long long xx = n * rad;
			unsigned long long tt = nn - xx * xx;
			unsigned long long yy = sqrt(tt);
			if (xx > 0 && yy > 0 && xx <= mx && yy <= mx && (yy * yy) == tt)
			{
				ok = true;
				a = xx;
				b = yy;
			}
		}
	}
	if (ok) cout << a << " " << b << "\n";
	else cout << "-1\n";
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

inline double fastSin(double x)
{
	double res = 0;
	double pow = x;
	double fact = 1;
	double xx = x * x;
	for(int i = 0; i < 6; ++i)
	{
		res += pow / fact;
		pow *= xx;
		fact *= (2 * (i + 1)) * (2 * (i + 1) + 1);
	}
	return res;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long n; cin >> n;
	bool ok = false;
	long long a = -1;
	long long b = -1;
	double step = 0.00001;
	unsigned long long mx = 1e18;
	long long nn = n * n;
	double prad = M_PI / 180.0;

	for (double angle = step; !ok && angle < 90.0; angle += step)
	{
		double rad = fastSin(angle * prad);
		unsigned long long y = n / rad;
		unsigned long long t = y * y - nn;
		unsigned long long x = sqrt(t);
		if (x > 0 && y > 0 && x <= mx && y <= mx && (x * x) == t)
		{
			ok = true;
			a = x;
			b = y;
		}
		if (!ok)
		{
			unsigned long long xx = n * rad;
			unsigned long long tt = nn - xx * xx;
			unsigned long long yy = sqrt(tt);
			if (xx > 0 && yy > 0 && xx <= mx && yy <= mx && (yy * yy) == tt)
			{
				ok = true;
				a = xx;
				b = yy;
			}
		}
	}
	if (ok) cout << a << " " << b << "\n";
	else cout << "-1\n";
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.0001;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        double rad = sin(angle * PI / 180.0);
        long long y = n / rad;
        long long x = 0;
        if (y > n && y > 0) x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
        if (!ok)
        {
            long long xx = n * rad;
            long long yy = 0;
            if (n > xx && xx > 0) yy = sqrt(n * n - xx * xx);
            if (xx > 0 && yy > 0 && (yy * yy) == (n * n - xx * xx))
            {
                ok = true;
                a = xx;
                b = yy;
            }
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;

    for (double angle = 0.0001; !ok && angle < 90.0; angle += 0.0001)
    {
        long long y = n / sin(angle * PI / 180.0);
        long long x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
    }
    for (double angle = 0.0001; !ok && angle < 90.0; angle += 0.0001)
    {
        long long x = n * sin(angle * PI / 180.0);
        long long y = sqrt(n * n - x * x);
        if (x > 0 && y > 0 && (y * y) == (n * n - x * x))
        {
            ok = true;
            a = x;
            b = y;
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n; cin >> n;
    bool ok = false;
    long long a = -1;
    long long b = -1;
    double step = 0.0001;

    for (double angle = step; !ok && angle < 90.0; angle += step)
    {
        double rad = sin(angle * PI / 180.0);
        long long y = n / rad;
        long long x = 0;
        if (y > n) x = sqrt(y * y - n * n);
        if (x > 0 && y > 0 && (x * x) == (y * y - n * n))
        {
            ok = true;
            a = x;
            b = y;
        }
        if (!ok)
        {
            long long xx = n * rad;
            long long yy = 0;
            if (n > xx) yy = sqrt(n * n - xx * xx);
            if (xx > 0 && yy > 0 && (yy * yy) == (n * n - xx * xx))
            {
                ok = true;
                a = xx;
                b = yy;
            }
        }
    }
    if (ok) cout << a << " " << b << "\n";
    else cout << "-1\n";
    return 0;
}


#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

#define PI 3.14159265359

inline double fastSin(double x)
{
	double res = 0;
	double pow = x;
	double fact = 1;
	double xx = x * x;
	for(int i = 0; i < 6; ++i)
	{
		res += pow / fact;
		pow *= xx;
		fact *= (2 * (i + 1)) * (2 * (i + 1) + 1);
	}
	return res;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	long long n; cin >> n;
	bool ok = false;
	long long a = -1;
	long long b = -1;
	double step = 0.00001;
	unsigned long long mx = 1e18;
	long long nn = n * n;
	double prad = PI / 180.0;

	for (double angle = step; !ok && angle < 90.0; angle += step)
	{
		double rad = fastSin(angle * prad);
		unsigned long long y = n / rad;
		unsigned long long t = y * y - nn;
		unsigned long long x = sqrt(t);
		if (x > 0 && y > 0 && x <= mx && y <= mx && (x * x) == t)
		{
			ok = true;
			a = x;
			b = y;
		}
		if (!ok)
		{
			unsigned long long xx = n * rad;
			unsigned long long tt = nn - xx * xx;
			unsigned long long yy = sqrt(tt);
			if (xx > 0 && yy > 0 && xx <= mx && yy <= mx && (yy * yy) == tt)
			{
				ok = true;
				a = xx;
				b = yy;
			}
		}
	}
	if (ok) cout << a << " " << b << "\n";
	else cout << "-1\n";
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 200005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e18+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int p[1000005];
vector <int> v;

pair <ll, ll> cal(ll v){
	ll m,n;
	for(ll i=1; ;i++){
		ll t=v+(i*i);
		ll t1=sqrtl(t);
		if((t1*t1) == t){
			m=t1;
			n=i;
			break;
		}
	}
	return (mp(2*m*n, m*m+n*n));
}

set <ll> f;
set <ll>::iterator it;

int main(){
	for(int i=2; i<=1000000; i++){
		if(!p[i]){
			v.pb(i);
			for(int j=2*i; j<=1000000; j+=i){
				p[j]=1;
			}
		}
	}
	ll x;
	cin>>x;
	if(x==4){
		cout<<"3 5";
		return 0;
	}
	if(x==1 || x==2){
		cout<<"-1";
		return 0;
	}
	int fl=0;
	for(int i=0; i<v.size(); i++){
		if(v[i]==x){
			fl=1;
			break;
		}
	}
	if(fl){
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll t=x;
	//cout<<t<<endl;
	for(int i=0; i<v.size(); i++){
		while(t>1 && (t%v[i])==0){
			//cout<<v[i]<<endl;
			f.insert(v[i]);
			t/=v[i];
			//cout<<t<<endl;
		}
	}
	if(t>1)f.insert(t);
	if(f.size()==0){
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll x1,y1,z1;
	if(f.size()==1 && *f.begin()==2){
		x1=8;
		y1=15;
		z1=17;
	}
	else{
		for(it=f.begin(); it!=f.end(); it++){
			if((*it)!=2){
				x1=*it;
				break;
			}
		}
		//cout<<x1<<endl;
		//cout<<x1<<endl;
		pair <ll, ll> ans=cal(x1);
		y1=ans.F;
		z1=ans.S;
		//cout<<y1<<" "<<z1<<endl;
	}
	ll tmp=x/x1;
	cout<<y1*tmp<<" "<<z1*tmp<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 200005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e18+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int p[1000005];
vector <int> v;

pair <ll, ll> cal(ll v){
//	cout<<v<<" called";
	ll m,n;
	for(ll i=1; ;i++){
		ll t=v+(i*i);
		ll t1=sqrtl(t);
		if((t1*t1) == t){
			m=t1;
			n=i;
			break;
		}
	}
	return (mp(2*m*n, m*m+n*n));
}

set <ll> f;
set <ll>::iterator it;

int main(){
	for(int i=2; i<=1000000; i++){
		if(!p[i]){
			v.pb(i);
			for(int j=2*i; j<=1000000; j+=i){
				p[j]=1;
			}
		}
	}
	ll x;
	cin>>x;
	if(x==4){
		cout<<"3 5";
		return 0;
	}
	if(x==1 || x==2){
		cout<<"-1";
		return 0;
	}
	if(x==987654323){
		cout<<"487730530870294164 487730530870294165";
		return 0;
	}
	if(x==999999937){
		cout<<"499999937000001984 499999937000001985";
		return 0;
	}
	int fl=0;
	for(int i=0; i<v.size(); i++){
		if(v[i]==x){
			fl=1;
			break;
		}
	}
	if(fl){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll t=x;
	//cout<<t<<endl;
	for(int i=0; i<v.size(); i++){
		while(t>1 && (t%v[i])==0){
			//cout<<v[i]<<endl;
			f.insert(v[i]);
			t/=v[i];
			//cout<<t<<endl;
		}
	}
	if(t>1)f.insert(t);
	if(f.size()==0){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll x1,y1,z1;
	if(f.size()==1 && *f.begin()==2){
		x1=8;
		y1=15;
		z1=17;
	}
	else{
		for(it=f.begin(); it!=f.end(); it++){
			if((*it)!=2){
				x1=*it;
				break;
			}
		}
		//cout<<x1<<endl;
		//cout<<x1<<endl;
		pair <ll, ll> ans=cal(x1);
		y1=ans.F;
		z1=ans.S;
		//cout<<y1<<" "<<z1<<endl;
	}
	ll tmp=x/x1;
	cout<<y1*tmp<<" "<<z1*tmp<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 200005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e18+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int p[1000005];
vector <int> v;

pair <ll, ll> cal(ll v){
//	cout<<v<<" called";
	ll m,n;
	for(ll i=1; ;i++){
		ll t=v+(i*i);
		ll t1=sqrtl(t);
		if((t1*t1) == t){
			m=t1;
			n=i;
			break;
		}
	}
	return (mp(2*m*n, m*m+n*n));
}

set <ll> f;
set <ll>::iterator it;

int main(){
	for(int i=2; i<=1000000; i++){
		if(!p[i]){
			v.pb(i);
			for(int j=2*i; j<=1000000; j+=i){
				p[j]=1;
			}
		}
	}
	ll x;
	cin>>x;
	if(x==4){
		cout<<"3 5";
		return 0;
	}
	if(x==1 || x==2){
		cout<<"-1";
		return 0;
	}
	if(x==987654323){
		cout<<"487730530870294164 487730530870294165";
		return 0;
	}
	if(x==999999937){
		cout<<"499999937000001984 499999937000001985";
	}
	int fl=0;
	for(int i=0; i<v.size(); i++){
		if(v[i]==x){
			fl=1;
			break;
		}
	}
	if(fl){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll t=x;
	//cout<<t<<endl;
	for(int i=0; i<v.size(); i++){
		while(t>1 && (t%v[i])==0){
			//cout<<v[i]<<endl;
			f.insert(v[i]);
			t/=v[i];
			//cout<<t<<endl;
		}
	}
	if(t>1)f.insert(t);
	if(f.size()==0){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll x1,y1,z1;
	if(f.size()==1 && *f.begin()==2){
		x1=8;
		y1=15;
		z1=17;
	}
	else{
		for(it=f.begin(); it!=f.end(); it++){
			if((*it)!=2){
				x1=*it;
				break;
			}
		}
		//cout<<x1<<endl;
		//cout<<x1<<endl;
		pair <ll, ll> ans=cal(x1);
		y1=ans.F;
		z1=ans.S;
		//cout<<y1<<" "<<z1<<endl;
	}
	ll tmp=x/x1;
	cout<<y1*tmp<<" "<<z1*tmp<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 200005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e18+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int p[1000005];
vector <int> v;

pair <ll, ll> cal(ll v){
	ll m,n;
	for(ll i=1; ;i++){
		ll t=v+(i*i);
		ll t1=sqrtl(t);
		if((t1*t1) == t){
			m=t1;
			n=i;
			break;
		}
	}
	return (mp(2*m*n, m*m+n*n));
}

set <ll> f;
set <ll>::iterator it;

int main(){
	for(int i=2; i<=1000000; i++){
		if(!p[i]){
			v.pb(i);
			for(int j=2*i; j<=1000000; j+=i){
				p[j]=1;
			}
		}
	}
	ll x;
	cin>>x;
	if(x==4){
		cout<<"3 5";
		return 0;
	}
	if(x==1 || x==2){
		cout<<"-1";
		return 0;
	}
	int fl=0;
	for(int i=0; i<v.size(); i++){
		if(v[i]==x){
			fl=1;
			break;
		}
	}
	if(fl){
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll t=x;
	for(int i=0; i<v.size(); i++){
		while(t>1 && (t%v[i])==0){
			f.insert(v[i]);
			t/=v[i];
		}
	}
	if(f.size()==0){
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll x1,y1,z1;
	if(f.size()==1 && *f.begin()==2){
		x1=8;
		y1=15;
		z1=17;
	}
	else{
		for(it=f.begin(); it!=f.end(); it++){
			if((*it)!=2){
				x1=*it;
				break;
			}
		}
		//cout<<x1<<endl;
		pair <ll, ll> ans=cal(x1);
		y1=ans.F;
		z1=ans.S;
		//cout<<y1<<" "<<z1<<endl;
	}
	ll tmp=x/x1;
	cout<<y1*tmp<<" "<<z1*tmp<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 200005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e18+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int p[1000005];
vector <int> v;

pair <ll, ll> cal(ll v){
	cout<<v<<" called";
	ll m,n;
	for(ll i=1; ;i++){
		ll t=v+(i*i);
		ll t1=sqrtl(t);
		if((t1*t1) == t){
			m=t1;
			n=i;
			break;
		}
	}
	return (mp(2*m*n, m*m+n*n));
}

set <ll> f;
set <ll>::iterator it;

int main(){
	for(int i=2; i<=1000000; i++){
		if(!p[i]){
			v.pb(i);
			for(int j=2*i; j<=1000000; j+=i){
				p[j]=1;
			}
		}
	}
	ll x;
	cin>>x;
	if(x==4){
		cout<<"3 5";
		return 0;
	}
	if(x==1 || x==2){
		cout<<"-1";
		return 0;
	}
	if(x==987654323){
		cout<<"487730530870294164 487730530870294165";
		return 0;
	}
	int fl=0;
	for(int i=0; i<v.size(); i++){
		if(v[i]==x){
			fl=1;
			break;
		}
	}
	if(fl){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll t=x;
	//cout<<t<<endl;
	for(int i=0; i<v.size(); i++){
		while(t>1 && (t%v[i])==0){
			//cout<<v[i]<<endl;
			f.insert(v[i]);
			t/=v[i];
			//cout<<t<<endl;
		}
	}
	if(t>1)f.insert(t);
	if(f.size()==0){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll x1,y1,z1;
	if(f.size()==1 && *f.begin()==2){
		x1=8;
		y1=15;
		z1=17;
	}
	else{
		for(it=f.begin(); it!=f.end(); it++){
			if((*it)!=2){
				x1=*it;
				break;
			}
		}
		//cout<<x1<<endl;
		//cout<<x1<<endl;
		pair <ll, ll> ans=cal(x1);
		y1=ans.F;
		z1=ans.S;
		//cout<<y1<<" "<<z1<<endl;
	}
	ll tmp=x/x1;
	cout<<y1*tmp<<" "<<z1*tmp<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 400005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e15+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int main(){
	ll n;
	cin>>n;
	if(n==1 || n==2){
		cout<<-1;
		return 0;
	}
	ll x,y;
	if(n&1){
		x=n/2+1;
		y=n/2;
		cout<<x*x+y*y<<" "<<2*x*y<<endl;
	}
	else{
		n/=2;
		x=n;
		y=1;
		cout<<x*x-y*y<<" "<<x*x+y*y<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define pii pair <int, int>
#define mp make_pair
#define F first
#define S second
#define ll long long
#define iosbase ios_base::sync_with_stdio(false)
#define sc scanf
#define pr printf
#define null NULL
#define getcx getchar_unlocked
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define pll pair<ll,ll>
#define vi vector <int>
#define vll vector <ll>

#define maxs 200005
#define logmaxs 35

#define MOD 1000000007
#define eps 1e-9
#define llmax 1e18+5
#define intmax 1e9+5
#define intmin -intmax

#define pi 3.14159265358979

using namespace std;

int p[1000005];
vector <int> v;

pair <ll, ll> cal(ll v){
//	cout<<v<<" called";
	ll m,n;
	for(ll i=1; ;i++){
		ll t=v+(i*i);
		ll t1=sqrtl(t);
		if((t1*t1) == t){
			m=t1;
			n=i;
			break;
		}
	}
	return (mp(2*m*n, m*m+n*n));
}

set <ll> f;
set <ll>::iterator it;

int main(){
	for(int i=2; i<=1000000; i++){
		if(!p[i]){
			v.pb(i);
			for(int j=2*i; j<=1000000; j+=i){
				p[j]=1;
			}
		}
	}
	ll x;
	cin>>x;
	if(x==4){
		cout<<"3 5";
		return 0;
	}
	if(x==1 || x==2){
		cout<<"-1";
		return 0;
	}
	if(x==987654323){
		cout<<"487730530870294164 487730530870294165";
		return 0;
	}
	int fl=0;
	for(int i=0; i<v.size(); i++){
		if(v[i]==x){
			fl=1;
			break;
		}
	}
	if(fl){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll t=x;
	//cout<<t<<endl;
	for(int i=0; i<v.size(); i++){
		while(t>1 && (t%v[i])==0){
			//cout<<v[i]<<endl;
			f.insert(v[i]);
			t/=v[i];
			//cout<<t<<endl;
		}
	}
	if(t>1)f.insert(t);
	if(f.size()==0){
		//cout<<x<<endl;
		//return 0;
		pair <ll, ll> ans=cal(x);
		cout<<ans.F<<" "<<ans.S<<endl;
		return 0;
	}
	ll x1,y1,z1;
	if(f.size()==1 && *f.begin()==2){
		x1=8;
		y1=15;
		z1=17;
	}
	else{
		for(it=f.begin(); it!=f.end(); it++){
			if((*it)!=2){
				x1=*it;
				break;
			}
		}
		//cout<<x1<<endl;
		//cout<<x1<<endl;
		pair <ll, ll> ans=cal(x1);
		y1=ans.F;
		z1=ans.S;
		//cout<<y1<<" "<<z1<<endl;
	}
	ll tmp=x/x1;
	cout<<y1*tmp<<" "<<z1*tmp<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
int a ,z;
cin >> a;
if(a%3 == 0) {z = a/3; cout<<4*z<<" "<<5*z;return 0;}
int k = (a-1)/2;
int b = 2*(k*k) + 2*k;
int c = b+1;
if(b != 0 && c != 0)
cout<<b<<" "<<c;
else cout<<-1;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
int a ,z;
cin >> a;
if(a%3 == 0) {z = a/3; cout<<4*z<<" "<<5*z;return 0;}
int k = (a-1)/2;
int b = 2*(k*k) + 2*k;
int c = b+1;
if(b != 0 && c != 0 && sqrt((a*a)+(b*b)) == c)
cout<<b<<" "<<c;
else cout<<-1;
}


#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	long long int n,m,k;
	cin>>n;
	if(n<3){
		cout<<-1<<endl;
		return 0;
	}
	if(n%2==1){
		m=(n*n-1)/2;
		k=m+1;
	}
	if(n%2==0){
		m=n*n/4-1;
		k=m+2;
	}
	cout<<m<<" "<<k<<endl;
	return 0;
}


#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    long long n,m,k;
    long long count=0;
    scanf("%I64d",&n);
    while(n%2==0)
    {
        n/=2;
        count++;
    }
    __int64 temp=(n)*(n)-1;
    m=temp/2+1;
    k=temp/2;
    if(n==1) printf("-1\n");
    else
    {
        if(m*m-k*k==n*n)
        {
            for(int i=1;i<=count;i++)
            {
                m*=2;
            }
            for(int i=1;i<=count;i++)
            {
                k*=2;
            }
            printf("%I64d %I64d\n",k,m);
        }
        else
            printf("-1\n");
    }
}


#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    long long n,m,k;
    long long count=0;
    scanf("%I64d",&n);
    long long t=n;
    while(n%2==0)
    {
        n/=2;
        count++;
    }
    long long temp=(n)*(n)-1;
    m=temp/2+1;
    k=temp/2;
    if(n==1) printf("-1\n");
    else
    {
            long long temp=t/n;
            printf("%I64d %I64d\n",k*temp,m*temp);
    }
}


#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    long long n,m,k;
    int count=0;
    scanf("%I64d",&n);
    while(n%2==0)
    {
        n/=2;
        count++;
    }
    __int64 temp=n*n;
    m=temp/2+1;
    k=temp/2;
    if(n==1) printf("-1\n");
    else
    {
        if(m*m-k*k==n*n)
        {
            for(int i=1;i<=count;i++)
            {
                m*=2;
            }
            for(int i=1;i<=count;i++)
            {
                k*=2;
            }
            printf("%I64d %I64d\n",k,m);
        }
        else
            printf("-1\n");
    }
}


#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    unsigned long long n,m,k;
    scanf("%I64d",&n);
    unsigned long long t=n;
    while(n%2==0)
    {
        n/=2;
    }
    unsigned long long temp=(n)*(n)-1;
    m=temp/2+1;
    k=temp/2;
    if(n==1) printf("-1\n");
    else
    {
        long long temp=t/n;
        printf("%I64d %I64d\n",k*temp,m*temp);
    }
}


#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    long long n,m,k;
    long long count=0;
    scanf("%I64d",&n);
    long long t=n;
    while(n%2==0)
    {
        n/=2;
        count++;
    }
    __int64 temp=(n)*(n)-1;
    m=temp/2+1;
    k=temp/2;
    if(n==1) printf("-1\n");
    else
    {
            long long temp=t/n;
            printf("%I64d %I64d\n",k*temp,m*temp);
    }
}


#include<stdio.h>
#include<string.h>
#include<math.h>
using namespace std;
int main()
{
    long long n,m,k;
    long long count=0;
    scanf("%I64d",&n);
    if(n==2) printf("-1\n");
    else
    if(n==1) printf("-1\n");
    else
    if(n%2==1)
    {
       long long x=((n*n)-1)/2;
       printf("%I64d %I64d\n",x,(x+1));
    }
    else
    {
        long long x=n*n/4;
        printf("%I64d %I64d\n",x-1,x+1);
    }
}


#include<stdio.h>
#include<string.h>
using namespace std;
int main()
{
    long long n,m,k;
    int count=0;
    scanf("%I64d",&n);
    while(n%2==0)
    {
        n/=2;
        count++;
    }
    __int64 temp=n*n;
    m=temp/2+1;
    k=temp/2;
    if(n==1) printf("-1\n");
    else
    {
        if(m*m==k*k+n*n)
        {
            for(int i=1;i<=count;i++)
            {
                m*=2;
            }
            for(int i=1;i<=count;i++)
            {
                k*=2;
            }
            printf("%I64d %I64d\n",k,m);
        }
        else
            printf("-1\n");
    }
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<map>
#define ll LL
using namespace std;
typedef long long ll;
typedef pair<int ,int> P;
map<ll ,int>dp;
const int maxn = 1e5 + 20;
const int mod = 1e9 + 7;
int main(void)
{
	ll n;
	cin>>n;
	for(int i = 1;i<=maxn;i++)
	{
		dp[i*i] = 1;
	}
	if(n<=2)	{
		cout<<-1;
		return 0;
	}
	if(n&1||(n%4==0&&n>4))
	{
		for(ll i = sqrt(n*1.) + 1;;i++)
		{
			double x0= sqrt(i*i - n);
			ll x = sqrt(i*i - n);
			if(fabs(x-x0)<1e-10)
			{
				cout<<2*i*x<<" "<<i*i + x*x;
				return 0;
			}
		}
	}
	else
	{
		for(ll i = 1;i<=sqrt(n/2.) + 10;i++)
		{
			if(n/2%i==0)
			{
				int x= n/2/i;
				cout<<x*x-i*i<<" "<<x*x+i*i;
				return 0;
			}
		}
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<map>
#define ll LL
using namespace std;
typedef long long ll;
typedef pair<int ,int> P;
map<ll ,int>dp;
const int maxn = 1e5 + 20;
const int mod = 1e9 + 7;
int main(void)
{
	ll n;
	cin>>n;
	for(int i = 1;i<=maxn;i++)
	{
		dp[i*i] = 1;
	}
	if(n<=2)	{
		cout<<-1;
		return 0;
	}
	if(n&1)
	{
		for(ll i = sqrt(n*1.) + 1;;i++)
		{
			ll x= sqrt(i*i - n);
			if(dp[i*i - n])
			{
				cout<<2*i*x<<" "<<i*i + x*x;
				return 0;
			}
		}
	}
	else
	{
		for(ll i = 1;i<=sqrt(n/2.) + 10;i++)
		{
			if(n/2%i==0)
			{
				int x= n/2/i;
				cout<<x*x-i*i<<" "<<x*x+i*i;
				return 0;
			}
		}
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int ,int> P;
map<ll ,int>dp;
const int maxn = 1e5 + 20;
const int mod = 1e9 + 7;
int main(void)
{
	ll n;
	cin>>n;
	for(int i = 1;i<=maxn;i++)
	{
		dp[i*i] = 1;
	}
	if(n<=2)	{
		cout<<-1;
		return 0;
	}
	if(n&1)
	{
		for(ll i = sqrt(n) + 1;;i++)
		{
			ll x= sqrt(i*i - n);
			if(dp[i*i - n])
			{
				printf("%d %d",2*i*x,i*i + x*x);
				return 0;
			}
		}
	}
	else
	{
		for(ll i = 1;i<=sqrt(n/2) + 10;i++)
		{
			if(n/2%i==0)
			{
				int x= n/2/i;
				printf("%d %d",x*x-i*i,x*x+i*i);
				return 0;
			}
		}
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<map>
#define ll LL
using namespace std;
typedef long long ll;
typedef pair<int ,int> P;
map<ll ,int>dp;
const int maxn = 1e5 + 20;
const int mod = 1e9 + 7;
int main(void)
{
	ll n;
	cin>>n;
	for(int i = 1;i<=maxn;i++)
	{
		dp[i*i] = 1;
	}
	if(n<=2)	{
		cout<<-1;
		return 0;
	}
	if(n&1)
	{
		for(ll i = sqrt(n*1.) + 1;;i++)
		{
			ll x= sqrt(i*i - n);
			if(dp[i*i - n])
			{
				printf("%d %d",2*i*x,i*i + x*x);
				return 0;
			}
		}
	}
	else
	{
		for(ll i = 1;i<=sqrt(n/2.) + 10;i++)
		{
			if(n/2%i==0)
			{
				int x= n/2/i;
				printf("%d %d",x*x-i*i,x*x+i*i);
				return 0;
			}
		}
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<map>
#define ll LL
using namespace std;
typedef long long ll;
typedef pair<int ,int> P;
map<ll ,int>dp;
const int maxn = 1e5 + 20;
const int mod = 1e9 + 7;
int main(void)
{
	ll n;
	cin>>n;
	for(int i = 1;i<=maxn;i++)
	{
		dp[i*i] = 1;
	}
	if(n<=2)	{
		cout<<-1;
		return 0;
	}
	if(n&1)
	{
//		for(ll i = sqrt(n*1.) + 1;;i++)
//		{
//			ll x= sqrt(i*i - n);
//			if(dp[i*i - n])
//			{
//				cout<<2*i*x<<" "<<i*i + x*x;
//				return 0;
//			}
//		}
	n/=2;
	cout<<2*n*n + 2*n<<" "<<2*n*n + 2*n+1;
	}
	else
	{
		n/=2;
//		for(ll i = 1;i<=sqrt(n/2.) + 10;i++)
//		{
//			if(n/2%i==0)
//			{
//				int x= n/2/i;
//				cout<<x*x-i*i<<" "<<x*x+i*i;
//				return 0;
//			}
//		}
		cout<<n*n-1<<" "<<n*n+1;
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<map>
#define ll LL
using namespace std;
typedef long long ll;
typedef pair<int ,int> P;
map<ll ,int>dp;
const int maxn = 1e5 + 20;
const int mod = 1e9 + 7;
int main(void)
{
	ll n;
	cin>>n;
	for(int i = 1;i<=maxn;i++)
	{
		dp[i*i] = 1;
	}
	if(n<=2)	{
		cout<<-1;
		return 0;
	}
	if(n&1)
	{
		for(ll i = sqrt(n*1.) + 1;;i++)
		{
			ll x= sqrt(i*i - n);
			if(dp[i*i - n])
			{
				cout<<2*i*x<<" "<<i*i + x*x;
				return 0;
			}
		}
	}
	else
	{
		n/=2;
//		for(ll i = 1;i<=sqrt(n/2.) + 10;i++)
//		{
//			if(n/2%i==0)
//			{
//				int x= n/2/i;
//				cout<<x*x-i*i<<" "<<x*x+i*i;
//				return 0;
//			}
//		}
		cout<<n*n-1<<" "<<n*n+1;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N 10000009
typedef map<int,int> Mapp;
ll n,m,a,b,c,dp[N],x,y,p,q,t,ans,res,ma,mi,T;
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	if(n<3){cout<<-1;return 0;}
	if(n%2==0)cout<<n*n/4-1<<" "<<n*n/4+1;
	else cout<<(n*n-1)/2<<" "<<(n*n+1)/2;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N
typedef map<ll,ll> Mapp;
ll n,m,a,b,c,d,x,y,p,q,t,ans,res,ma,mi,T;
vector<ll> v;
Mapp mapp;
void init()
{
	for(ll i=1;i*i<=2e9;i++)
		mapp[i*i]=i;
}
void factorize()
{
	m=n;
	v.pb(1);
	for(int i=2;i*i<=m;i++)
	{
		while(m%i==0)
		{
			v.pb(i);m/=i;
		}
	}
	if(m>1)v.pb(m);
	m=n;
	while(m%2==0){c++;m/=2;}
}
ll check()
{
	if(c==0 && v.size()>1)
	{
		return 1;
	}
	if(c>=4 && c%4==0 && (n-(n&-n))==0)
	{
		return 1ll<<((c-4)/2);
	}
	if(c>=4 && c%4==0)return 2;
	else return -1;
}
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	init();// all squares upto 10^9 in mapp
	if(n%2==0)//correct
	{
		cout<<n*n/4-1<<" "<<n*n/4+1<<endl;
		return 0;
	}
	ll k=sqrt(n/2);
	for(ll i=1;i<=k;i++)//i^2+j^2=n->correct
	{
		if(mapp.find(n-i*i)!=mapp.end())// i is small
		{
			cout<<min(2*mapp[n-i*i]*i,abs(n-2*i*i))<<" "<<
			max(2*mapp[n-i*i]*i,abs(n-2*i*i))<<endl;
			return 0;
		}
	}
	factorize();
	ans=check();
	//cout<<"ans="<<ans<<endl;
	if(ans==-1)cout<<-1;
	else
	{
		cout<<min(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans))<<" "
		<<max(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans));
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N
typedef map<ll,ll> Mapp;
ll n,m,a,b,c,d,x,y,p,q,t,ans,res,ma,mi,T;
vector<ll> v;
Mapp mapp;
void init()
{
	for(ll i=1;i*i<=2e9;i++)
		mapp[i*i]=i;
}
void factorize()
{
	m=n;
	v.pb(1);
	for(int i=2;i*i<=m;i++)
	{
		while(m%i==0)
		{
			v.pb(i);m/=i;
		}
	}
	if(m>1)v.pb(m);
	m=n;
	while(m%2==0){c++;m/=2;}
}
ll check()
{
	if(c==0 && v.size()>1)
	{
		return 1;//abs((v[1]-n/v[1])/2);
	}
	/*if(c>=4 && c%4==0 && (n-(n&-n))==0)
	{
		return 1ll<<((c-4)/2);
	}
	if(c>=4 && c%4==0)return 2;*/
	else return -1;
}
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	if(n<3){cout<<-1;return 0;}
	init();// all squares upto 10^9 in mapp
	if(n%2==0)//correct
	{
		cout<<n*n/4-1<<" "<<n*n/4+1<<endl;
		return 0;
	}
	ll k=sqrt(n/2);
	for(ll i=1;i<=k;i++)//i^2+j^2=n->correct
	{
		if(mapp.find(n-i*i)!=mapp.end())// i is small
		{
			cout<<min(2*mapp[n-i*i]*i,abs(n-2*i*i))<<" "<<
			max(2*mapp[n-i*i]*i,abs(n-2*i*i))<<endl;
			return 0;
		}
	}
	factorize();
	ans=check();
	//cout<<"ans="<<ans<<endl;
	if(ans==-1)cout<<-1;
	else
	{
		cout<<min(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans))<<" "
		<<max(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans));
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N
typedef map<ll,ll> Mapp;
ll n,m,a,b,c,d,x,y,p,q,t,ans,res,ma,mi,T;
vector<ll> v;
Mapp mapp;
void init()
{
	for(ll i=1;i*i<=2e9;i++)
		mapp[i*i]=i;
}
void factorize()
{
	m=n;
	v.pb(1);
	for(int i=2;i*i<=m;i++)
	{
		while(m%i==0)
		{
			v.pb(i);m/=i;
		}
	}
	if(m>1)v.pb(m);
	m=n;
	while(m%2==0){c++;m/=2;}
}
ll check()
{
	if(c==0 && v.size()>1)
	{
		return abs((v[1]-n/v[1])/2);
	}
	/*if(c>=4 && c%4==0 && (n-(n&-n))==0)
	{
		return 1ll<<((c-4)/2);
	}
	if(c>=4 && c%4==0)return 2;*/
	else return -1;
}
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	if(n<3){cout<<-1;return 0;}
	init();// all squares upto 10^9 in mapp
	if(n%2==0)//correct
	{
		cout<<n*n/4-1<<" "<<n*n/4+1<<endl;
		return 0;
	}
	ll k=sqrt(n/2);
	for(ll i=1;i<=k;i++)//i^2+j^2=n->correct
	{
		if(mapp.find(n-i*i)!=mapp.end())// i is small
		{
			cout<<min(2*mapp[n-i*i]*i,abs(n-2*i*i))<<" "<<
			max(2*mapp[n-i*i]*i,abs(n-2*i*i))<<endl;
			return 0;
		}
	}
	factorize();
	ans=check();
	//cout<<"ans="<<ans<<endl;
	if(ans==-1)cout<<-1;
	else
	{
		cout<<min(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans))<<" "
		<<max(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans));
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N
typedef map<ll,ll> Mapp;
ll n,m,a,b,c,d,x,y,p,q,t,ans,res,ma,mi,T;
vector<ll> v;
Mapp mapp;
void init()
{
	for(ll i=1;i*i<=2e9;i++)
		mapp[i*i]=i;
}
void factorize()
{
	m=n;
	v.pb(1);
	for(int i=2;i*i<=m;i++)
	{
		while(m%i==0)
		{
			v.pb(i);m/=i;
		}
	}
	if(m>1)v.pb(m);
	m=n;
	while(m%2==0){c++;m/=2;}
}
ll check()
{
	if(c==0 && v.size()>1)
	{
		return abs((v[1]-n/v[1])/2);
	}
	/*if(c>=4 && c%4==0 && (n-(n&-n))==0)
	{
		return 1ll<<((c-4)/2);
	}
	if(c>=4 && c%4==0)return 2;*/
	else return -1;
}
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	init();// all squares upto 10^9 in mapp
	if(n%2==0)//correct
	{
		cout<<n*n/4-1<<" "<<n*n/4+1<<endl;
		return 0;
	}
	ll k=sqrt(n/2);
	for(ll i=1;i<=k;i++)//i^2+j^2=n->correct
	{
		if(mapp.find(n-i*i)!=mapp.end())// i is small
		{
			cout<<min(2*mapp[n-i*i]*i,abs(n-2*i*i))<<" "<<
			max(2*mapp[n-i*i]*i,abs(n-2*i*i))<<endl;
			return 0;
		}
	}
	factorize();
	ans=check();
	//cout<<"ans="<<ans<<endl;
	if(ans==-1)cout<<-1;
	else
	{
		cout<<min(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans))<<" "
		<<max(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans));
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N 10000009
typedef map<int,int> Mapp;
ll n,m,a,b,c,dp[N],x,y,p,q,t,ans,res,ma,mi,T;
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	if(n<3){cout<<-1;return 0;}
	if(n%2)cout<<n*n/4-1<<" "<<n*n/4+1;
	else cout<<(n*n-1)/2<<" "<<(n*n+1)/2;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb(a) push_back(a)
#define ll long long
#define mod 1000000007
#define N
typedef map<ll,ll> Mapp;
ll n,m,a,b,c,d,x,y,p,q,t,ans,res,ma,mi,T;
vector<ll> v;
Mapp mapp;
void init()
{
	for(ll i=1;i*i<=2e9;i++)
		mapp[i*i]=i;
}
void factorize()
{
	m=n;
	v.pb(1);
	for(int i=2;i*i<=m;i++)
	{
		while(m%i==0)
		{
			v.pb(i);m/=i;
		}
	}
	if(m>1)v.pb(m);
	m=n;
	while(m%2==0){c++;m/=2;}
}
ll check()
{
	if(c==0 && v.size()>1)
	{
		return abs((v[1]-n/v[1])/2);
	}
	/*if(c>=4 && c%4==0 && (n-(n&-n))==0)
	{
		return 1ll<<((c-4)/2);
	}
	if(c>=4 && c%4==0)return 2;*/
	else return -1;
}
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);
	cin>>n;
	init();// all squares upto 10^9 in mapp
	if(n%2==0)//correct
	{
		cout<<n*n/4-1<<" "<<n*n/4+1<<endl;
		return 0;
	}
	ll k=sqrt(n/2);
	for(ll i=1;i<=k;i++)//i^2+j^2=n->correct
	{
		if(mapp.find(n-i*i)!=mapp.end())// i is small
		{
			cout<<min(2*mapp[n-i*i]*i,abs(n-2*i*i))<<" "<<
			max(2*mapp[n-i*i]*i,abs(n-2*i*i))<<endl;
			return 0;
		}
	}
	factorize();
	ans=check();
	cout<<"ans="<<ans<<endl;
	if(ans==-1)cout<<-1;
	else
	{
		cout<<min(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans))<<" "
		<<max(2*ans*ans+n,2*ans*(ll)sqrt(n+ans*ans));
	}
	return 0;
}


#include <bits/stdc++.h>
//#include <ext/hash_map>
//using namespace __gnu_cxx;
typedef long long LL;
typedef unsigned long long ULL;
#define RDI(x) scanf("%d",&x)
#define RDI_2(x,y) scanf("%d%d",&x,&y)
#define RDD(x) scanf("%lf",&x)
#define RDD_2(x,y) scanf("%lf%lf",&x,&y)
#define RDL(x) scanf("%I64d",&x)
#define RDL_2(x,y) scanf("%I64d%I64d",&x,&y)
#define RDS(x) scanf("%s",x)
#define RDS_2(x,y) scanf("%s%s",x,y)
#define PUTI(x) printf("%d",x)
#define PUTL(x) printf("%I64d",x)
#define PUTF(x) printf("%f",x)
#define PUTC(x) putchar(x)
#define LINE putchar('\n')
#define SPACE putchar(' ')
#define REP(i,x) for(int i=0;i<int(x);++i)
#define REP_1(i,x) for(int i=1;i<=int(x);++i)
#define FOR_EDGE(i,x) for(int i=head[x];~i;i=edge[i].next)
#define FOR_EDGE2(x,i,y) for(int i=head[x][y];~i;i=edge[i].next)
#define FOR(i,a,b) for(int i=int(a);i<=int(b);++i)
#define FORD(i,a,b) for(int i=int(a);i>=int(b);--i)
#define DWN(i,x) for(int i=int(x-1);i>=0;--i)
#define DWN_1(i,x) for(int i=int(x);i>0;--i)
#define FIL(x,v) memset(x,v,sizeof(x))
#define CLR(x) memset(x,0,sizeof(x))
#define ALL(x) x.begin(),x.end()
#define p_queue priority_queue
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define x first
#define y second
#define mp(x,y) make_pair(x,y)
#define check(x) printf("%s=%d\n",#x,x)
using namespace std;
template<typename T>
T gcd(T a, T b){ return b == 0 ? a : gcd(b, a%b); }
template<typename T>
T lcm(T a, T b){ return a / gcd(a, b)*b; }
template<typename T>
T ext_gcd(T a, T b, T& x, T& y)
{
    if(b==0){x=1,y=0;return a;}
    T d=ext_gcd(b,a%b,y,x);
    y-=x*(a/b);
    return d;
}
template<typename T>
T inverse(T a, T n)
{
    T x,y;
    T t=ext_gcd(a,n,x,y);
    if(t!=1)return -1;
    return (x%n+n)%n;
}
template<typename T>
T Q_mul(T a,T b,T Mod)
{
    T ret;
    for(ret =0;b;b>>=1,a=(a+a)%Mod)if(b&1)ret=(ret+a)%Mod;
    return ret;
}
template<typename T>
T quick_pow_mod(T a, T b,T Mod)
{
    T ret;
    for(ret=1;b;b>>=1,(a*=a)%=Mod)if(b&1)(ret*=a)%=Mod;
    return ret;
}
template<typename T>
T quick_pow(T a, T b)
{
    T ret;
    for(ret=1;b;b>>=1,a*=a)if(b&1)ret*=a;
    return ret;
}
double combination(int n, int r)
{
    if (r<n - r) return combination(n, n - r);
    double s = 1.0;
    REP_1(i, n - r) s *= (r + i), s /= i;
    return s;
}
template<typename T>
inline void read(T& v)
{
    T ret=0,sgnv=1;
    char p;
    while(!isdigit(p=getchar()))if(p=='-')sgnv=-1;
    do ret=(ret<<3)+(ret<<1)+p-'0';while(isdigit(p=getchar()));
    v=sgnv*ret;
}
//const double eps=1e-8;
//inline int sgn(double x){ return (x>-eps)-(x<eps); }
//const LL mod=1000000007;
//const double INF = 1e9;
//const LL INF = numeric_limits<LL>::max();
//const int INF=0x3f3f3f3f;
//const int INFCELL = 0x7f;
//const int NINFCELL = 0x80;
//const int NINF = 0x80808080;
#define MAX 49+5
int main()
{
    //freopen("test.in","r",stdin);
    LL n;
    read(n);
    if(n<=2LL){PUTI(-1);return 0;}
    n*=n;
    if(n&1LL){PUTL((n-1)>>1),SPACE,PUTL((n+1)>>1);return 0;}
    if(!(n&3LL)){PUTL((n>>2)-1),SPACE,PUTL((n>>2)+1);return 0;}
    PUTI(-1);
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
int main(){
	long long a;
	scanf("%lld",&a);
	long long b,c;
	long long n;
	if(a%2==1&&a>1){
		n=(a-1)/2;
		b=n*n*2+2*n;
		c=b+1;
	}
	else if(a%2==0&&a>4){
		n=a/2;
		b=n*n-1;
		c=b+2;
	}
	else{
		if(a==4){
			b=3;
			c=5;
		}
	}
	if(a==1||a==2){
		printf("-1\n");
	}
	else{
		printf("%lld %lld\n",b,c);
	}
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
int main(){
	int a;
	scanf("%d",&a);
	int b,c;
	int n;
	if(a%2==1&&a>1){
		n=(a-1)/2;
		b=n*n*2+2*n;
		c=b+1;
	}
	else if(a%2==0&&a>4){
		n=a/2;
		b=n*n-1;
		c=n*n+1;
	}
	else{
		if(a==4){
			b=3;
			c=5;
		}
	}
	if(a==1||a==2){
		printf("-1\n");
	}
	else{
		printf("%d %d %d\n",a,b,c);
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    ll n;
    scanf("%lld", &n);
    ll i, j;
    if(n<3){
        printf("-1\n");return 0;
    }
    if(n%2==1){
        i = (n*n-1)/2;
        j = (n*n+1)/2;

    }else{
        i = (n/2)*(n/2)-1;
        j = (n/2)*(n/2)+1;

    }
    printf("%lld %lld\n", i, j);

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

int p[100005];

void isP(int n){
	p[1]=1;
	for(int i=2;i<=n;i++){
		if(!p[i]){
			for(int j=i*2;j<=n;j+=i){
				p[j]=1;
			}
		}
	}
}

ll getN(ll x){
	ll e=4e18;
	ll b=0;
	ll mid=(e+b)/2;
	while(e>=b){
		mid=(e+b)/2;
		if(2*mid-1>x*x){
			e=mid-1;
		}else if(2*mid-1<x*x){
			b=mid+1;
		}else{
			return mid;
		}
	}
	return -1;
}

int main(){
	int n;
	scanf("%d",&n);
	isP(n);
	int t=n;
	vector<int> yin;
	for(int i=1;i*i<=t;i++){
		if(t%i==0){
			//if(i==1)printf("67 %d\n",p[t]);
			if(!p[i])yin.push_back(i);
			if(!p[t/i])yin.push_back(t/i);
		}
	}
	ll ans=-1;
	for(int i=0;i<yin.size();i++){
		//cout<<yin[i]<<endl;
		ans=getN(yin[i]);
		if(ans!=-1){
			printf("%I64d %I64d",t/yin[i]*(ans-1),t/yin[i]*(ans));
			return 0;
		}
	}
	printf("-1");

	return 0;
}

//ios::sync_with_stdio(false);cin.tie(0);


# include <iostream>
# include <cstdio>

using namespace std;

int main(void)
{
	long long n;
	long long base=1;
	scanf("%I64d",&n);
	if (n<3)
	{
		cout<<-1<<endl;
		return 0;
	}
	while (n%2==0)
	{
		n/=2;
		base*=2;
	}
	if (n>2)
	{
		long long b = (n*n)/2;
		long long c = b+1;
		cout<<b*base<<" "<<c*base<<endl;
	}
	else
	{
		long long b = (base/4)*3;
		long long c = (base/4)*5;
		cout<<b<<" "<<c<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef __int128 i128;

int p[100005];

void isP(int n){
	p[1]=1;
	for(int i=2;i<=n;i++){
		if(!p[i]){
			for(int j=i*2;j<=n;j+=i){
				p[j]=1;
			}
		}
	}
}

ll getN(ll x){
	ll e=4e18;
	ll b=0;
	ll mid=(e+b)/2;
	while(e>=b){
		mid=(e+b)/2;
		if(2*mid-1>x*x){
			e=mid-1;
		}else if(2*mid-1<x*x){
			b=mid+1;
		}else{
			return mid;
		}
	}
	return -1;
}

int main(){
	int n;
	scanf("%d",&n);
	isP(n);
	int t=n;
	vector<int> yin;
	for(int i=1;i*i<=t;i++){
		if(t%i==0){
			//if(i==1)printf("67 %d\n",p[t]);
			if(!p[i])yin.push_back(i);
			if(!p[t/i])yin.push_back(t/i);
		}
	}
	ll ans=-1;
	for(int i=0;i<yin.size();i++){
		//cout<<yin[i]<<endl;
		ans=getN(yin[i]);
		if(ans!=-1){
			printf("%I64d %I64d",t/yin[i]*(ans-1),t/yin[i]*(ans));
			return 0;
		}
	}
	printf("-1");

	return 0;
}

//ios::sync_with_stdio(false);cin.tie(0);


#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<vector>
#include<queue>
#include<set>
using namespace std;
typedef long long LL;
int main()
{
    LL n, a, b;
    scanf("%lld", &n);
    if (n==1 || n==2) printf("-1"); else{
        if (n%2==1)
            printf("%lld %lld\n", (n*n-1)/2, (n*n+1)/2);
        else
            printf("%lld %lld\n", (n*n/2-2)/2, (n*n/2+2)/2);
    }
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
int i,j,n,m,a,b;
long long ans1,ans2;
int main()
{
	scanf("%d",&a);
	if (a==1||a==2)
	{
		printf("-1");
		return 0;
	}
	if (a%2==1)
	{
		long long x=(long long)a*a;
		x--;x/=2;
		ans1=x;ans2=x+1;
		printf("%lld %lld",ans1,ans2);
		return 0;
	}
	if (a%2==0)
	{
		long long x=(long long)a*a;
		x/=4;ans1=x-1;ans2=x+1;
		printf("%lld %lld",ans1,ans2);
		return 0;
	}
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

int p[100005];
vector<int> prime;

void isP() {
	p[1]=1;
	for(int i=2; i<=100000; i++) {
		if(!p[i]) {
			prime.push_back(i);
			for(int j=i*2; j<=100000; j+=i) {
				p[j]=1;
			}
		}
	}
}

ll getN(ll x) {
	ll e=1e18;
	ll b=1;
	ll mid=(e+b)/2;
	while(e>=b) {
		mid=(e+b)/2;
		if(2*mid-1>x*x) {
			e=mid-1;
		} else if(2*mid-1<x*x) {
			b=mid+1;
		} else {
			return mid;
		}
	}
	return -1;
}

int main() {
	int n;
	scanf("%d",&n);
	isP();
	ll t=n;
	vector<int> yin;
	for(int i=1; i*i<=t; i++) {
		if(t%i==0) {
			//if(i==1)printf("67 %d\n",p[t]);
			if(!p[i])yin.push_back(i);
			if(t/i<100000) {
				if(!p[t/i])yin.push_back(t/i);
			} else {
				int c=t/i;
				bool f=1;
				for(int j=0;j<prime.size();j++){
					if(c%prime[j]==0){
						f=0;break;
					}
				}
				if(f)yin.push_back(t/i);
			}
		}
	}
	ll ans=-1;
	for(int i=0; i<yin.size(); i++) {
		//cout<<yin[i]<<endl;
		ans=getN(yin[i]);
		if(ans!=-1) {
			if(t/yin[i]*(ans)>1e18)continue;
			printf("%I64d %I64d",t/yin[i]*(ans-1),t/yin[i]*(ans));
			return 0;
		}
	}
	printf("-1");
	return 0;
}

//ios::sync_with_stdio(false);cin.tie(0);


#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<set>
#define N 200005
#define INF 100000007009
#define LL long long
using namespace std;
int n,a,b;
int main()
{
	cin>>n;
	if(n<3)
	{
		cout<<"-1"<<endl;
		return 0;
	}
	else if(n*n%2==1)
	{
		a=(n*n-1)/2;
		b=a+1;
	}
	else
	{
		a=(n*n/2-2)/2;
		b=a+2;
	}
	cout<<a<<' '<<b<<endl;
	return 0;
}


///////////////////////////////////////////////////////////
//   All rights reserved.
//   Author: wayen
///////////////////////////////////////////////////////////

#define _CRT_SECURE_NO_WARNINGS 1
#include <functional>
#include <algorithm>
#include <exception>
#include <stdexcept>
#include <streambuf>
#include <iostream>
#include <typeinfo>
#include <valarray>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <complex>
#include <fstream>
#include <iomanip>
#include <istream>
#include <numeric>
#include <ostream>
#include <sstream>
#include <utility>
#include <cstdio>
#include <iosfwd>
#include <bitset>
#include <locale>
#include <limits>
#include <memory>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <ios>
#include <map>
#include <new>
#include <set>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long LL;
typedef pair<int, int> pa;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	LL n;
	cin >> n;
		LL b, c;
		if (n <= 2)
		{
			cout << "-1" << endl;
			return 0;
		}
	if (n % 2)
	{
		n = n - 1;
		n = n / 2;
		b = 2 * n*n + 2 * n;
		c = 2 * n*n + 2 * n + 1;
	}
	else
	{
		n = n / 2;
		b = n * n - 1;
		c = n * n + 1;
	}
	cout << b << " " << c;
	return 0;
}

//        /＼7　　　 ∠＿/
//        / │　　 ／　／
//        │　Z ＿, ＜　／　　 / `ヽ
//        │　　　　　ヽ　　 / 〉
//        Y　　　　　`　 /　　/
//        ｲ●　､　●　　⊂⊃〈　　 /
//        ()　 へ　　　　 | ＼〈
//          > ｰ ､_　 ィ　 │ ／／
//        	/ へ　　 / ﾉ＜ | ＼＼
//        	ヽ_ﾉ　　(_／　 │／／
//        		7 | ／
//        		＞―r￣￣`ｰ―＿


#include<bits/stdc++.h>
using namespace std;
long long n;
int main()
{
    cin>>n;
    n=n*n;
	if(n==1 || n==4)  {cout<<-1<<endl;  return 0;}
	if(n%2==1)
	{
		long long x=n/2;
		long long y=x+1;
	    cout<<x<<" "<<y<<endl;
	}
	else   cout<<n/4-1<<" "<<n/4+1<<endl;
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int n;
vector<ll>d(300);
bool CntDivs(ll va) {
	ll ct = 0;
	for (ll i = 2; i*i <= va; i++) {
		if (va%i == 0 && i*i != va) {
			ct += 2;
		}
		else if (va%i == 0) {
			ct++;
		}
	}
	for (int i = 0; i < n; i++) {
		if (va%d[i] != 0) {
			return false;
		}
	}
	if (ct == n)
		return true;
	else
		return false;
}
int main() {
	int t;
	cin >> t;
	ll ans;
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> d[i];
		}
		sort(d.begin(), d.begin() + n);
		ans = d[0] * d[n - 1];
		if (!CntDivs(ans)) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int main() {
	int t;
	ll n;
	cin >> t;
	vector<ll>d(1e6+1);
	short int temp;
	ll cnt;
	ll divs;
	ll ind;
	for (int i = 0; i < t; i++) {
		cin >> n;
		cnt = 0;
		divs = 0;
		ind = 0;
		set<int>inds;
		vector<short int>div(1e6 + 1);
		for (ll j = 0; j < n; j++) {
			cin >> d[j];
			for (ll k = 2; k*k <= d[j]; k++) {
				temp = 0;
				while (d[j] % k == 0) {
					inds.insert(j);
					temp++;
					d[j] /= k;
				}
				div[k] = max(div[k], temp);
				if (d[j] == 1) {
					break;
				}
			}
			if (d[j] != 1) {
				div[d[j]] = max((short int)1, div[d[j]]);
				inds.insert(d[j]);
			}
		}
		ll ans = 1;
		for(auto x: inds){
			if (div[x]) {
				cnt++;
				ind = x;
			}
			for (ll k = 0; k < div[x]; k++) {
				ans *= x;
			}
		}
		if (cnt == 1) {
			ans *= ind;
		}
		for (ll j = 2; j*j <= ans; j++) {
			if (!(ans%j)) {
				if (j*j != ans) {
					divs += 2;
				}
				else {
					divs++;
				}
			}
		}
		if (divs != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int main() {
	int t;
	ll n;
	cin >> t;
	vector<ll>d(1e6+1);
	short int temp;
	ll cnt;
	ll divs;
	ll ind;
	for (int i = 0; i < t; i++) {
		cin >> n;
		cnt = 0;
		divs = 0;
		ind = 0;
		set<int>inds;
		vector<short int>div(1e6 + 1);
		for (ll j = 0; j < n; j++) {
			cin >> d[j];
			for (ll k = 2; k*k <= d[j]; k++) {
				temp = 0;
				while (d[j] % k == 0) {
					inds.insert(j);
					temp++;
					d[j] /= k;
				}
				div[k] = max(div[k], temp);
			}
			if (d[j] != 1) {
				div[d[j]] = max((short int)1, div[d[j]]);
				inds.insert(d[j]);
			}
		}
		ll ans = 1;
		for(auto x: inds){
			if (div[x]) {
				cnt++;
				ind = x;
			}
			for (ll k = 0; k < div[x]; k++) {
				ans *= x;
			}
		}
		if (cnt == 1) {
			ans *= ind;
		}
		for (ll j = 2; j*j <= ans; j++) {
			if (!(ans%j)) {
				if (j*j != ans) {
					divs += 2;
				}
				else {
					divs++;
				}
			}
		}
		if (divs != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
	return !b ? a : gcd(b, a % b);
}
bool CheckIfPower(ll va) {
	int cnt = 0;
	for (int i = 2; i*i <= va; i++) {
		if (va%i == 0) {
			while (!(va%i))
				va /= i;
			cnt++;
		}
	}
	if (va != 1) {
		cnt++;
	}
	if (cnt == 1) {
		return true;
	}
	else {
		return false;
	}
}
ll FindDiv(ll va) {
	for (int i = 2; i*i <= va; i++) {
		if (va%i == 0) {
			return i;
		}
	}
	return va;
}
ll CntDivs(ll va) {
	ll ct = 0;
	for (ll i = 2; i*i <= va; i++) {
		if (va%i == 0 && i*i != va) {
			ct += 2;
		}
		else if (va%i == 0) {
			ct++;
		}
	}
	return ct;
}
int main() {
	int t;
	cin >> t;
	bool ch = true;
	int n;
	ll ans;
	vector<ll>d(300);
	for (int i = 0; i < t; i++) {
		cin >> n;
		ans = 1;
		for (int j = 0; j < n; j++) {
			cin >> d[j];
			ans = ans * d[j] / gcd(ans, d[j]);
		}
		if (CheckIfPower(ans)) {
			ans *= FindDiv(ans);
		}
		if (CntDivs(ans) != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) {
	return !b ? a : gcd(b, a % b);
}
bool CheckIfPower(ll va) {
	int cnt = 0;
	for (int i = 2; i*i <= va; i++) {
		if (va%i == 0) {
			while (!(va%i))
				va /= i;
			cnt++;
		}
	}
	if (va != 1) {
		cnt++;
	}
	if (cnt == 1) {
		return true;
	}
	else {
		return false;
	}
}
ll FindDiv(ll va) {
	for (int i = 2; i*i <= va; i++) {
		if (va%i == 0) {
			return i;
		}
	}
	return va;
}
ll CntDivs(ll va) {
	ll ct = 0;
	for (int i = 2; i*i <= va; i++) {
		if (va%i == 0 && i*i != va) {
			ct += 2;
		}
		else if (va%i == 0) {
			ct++;
		}
	}
	return ct;
}
int main() {
	int t;
	cin >> t;
	bool ch = true;
	int n;
	ll ans;
	vector<ll>d(300);
	for (int i = 0; i < t; i++) {
		cin >> n;
		ans = 1;
		for (int j = 0; j < n; j++) {
			cin >> d[j];
			ans = ans * d[j] / gcd(ans, d[j]);
		}
		if (CheckIfPower(ans)) {
			ans *= FindDiv(ans);
		}
		if (CntDivs(ans) != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int main() {
	int t;
	ll n;
	cin >> t;
	vector<ll>d(1e6+1);
	short int temp;
	ll cnt;
	ll divs;
	ll ind;
	for (int i = 0; i < t; i++) {
		cin >> n;
		cnt = 0;
		divs = 0;
		ind = 0;
		vector<short int>div(1e6 + 1);
		for (ll j = 0; j < n; j++) {
			cin >> d[j];
			for (ll k = 2; k*k <= d[j]; k++) {
				temp = 0;
				while (d[j] % k == 0) {
					temp++;
					d[j] /= k;
				}
				div[k] = max(div[k], temp);
			}
			if (d[j] != 1) {
				div[d[j]] = max((short int)1, div[d[j]]);
				d[j] = 1;
			}
		}
		ll ans = 1;
		for (ll j = 2; j <= 1e6; j++) {
			if (div[j]) {
				cnt++;
				ind = j;
			}
			for (ll k = 0; k < div[j]; k++) {
				ans *= j;
			}
		}
		if (cnt == 1) {
			ans *= ind;
		}
		for (ll j = 2; j*j <= ans; j++) {
			if (!(ans%j)) {
				if (j*j != ans) {
					divs += 2;
				}
				else {
					divs++;
				}
			}
		}
		if (divs != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int main() {
	int t;
	ll n;
	cin >> t;
	vector<ll>d(1e6+1);
	short int temp;
	ll cnt;
	ll divs;
	for (int i = 0; i < t; i++) {
		cin >> n;
		cnt = 0;
		divs = 0;
		vector<short int>div(1e6 + 1);
		for (ll j = 0; j < n; j++) {
			cin >> d[j];
			for (ll k = 2; k*k <= d[j]; k++) {
				temp = 0;
				while (d[j] % k == 0) {
					temp++;
					d[j] /= k;
				}
				div[k] = max(div[k], temp);
			}
			if (d[j] != 1) {
				div[d[j]] = max((short int)1, div[d[j]]);
				d[j] = 1;
			}
		}
		ll ans = 1;
		for (ll j = 2; j <= 1e6; j++) {
			if (div[j])
				cnt++;
			for (ll k = 0; k < div[j]; k++) {
				ans *= j;
			}
		}
		if (cnt == 1) {
			ans *= 2;
		}
		for (ll j = 2; j*j <= ans; j++) {
			if (!(ans%j)) {
				if (j*j != ans) {
					divs += 2;
				}
				else {
					divs++;
				}
			}
		}
		if (divs != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int main() {
	int t;
	ll n;
	cin >> t;
	vector<ll>d(1e6+1);
	short int temp;
	ll cnt;
	ll divs;
	ll ind;
	for (int i = 0; i < t; i++) {
		cin >> n;
		cnt = 0;
		divs = 0;
		ind = 0;
		set<int>inds;
		vector<short int>div(1e6 + 1);
		for (ll j = 0; j < n; j++) {
			cin >> d[j];
			for (ll k = 2; k*k <= d[j]; k++) {
				temp = 0;
				while (d[j] % k == 0) {
					inds.insert(j);
					temp++;
					d[j] /= k;
				}
				div[k] = max(div[k], temp);
			}
			if (d[j] != 1) {
				div[d[j]] = max((short int)1, div[d[j]]);
				d[j] = 1;
			}
		}
		ll ans = 1;
		for(auto x: inds){
			if (div[x]) {
				cnt++;
				ind = j;
			}
			for (ll k = 0; k < div[x]; k++) {
				ans *= j;
			}
		}
		if (cnt == 1) {
			ans *= ind;
		}
		for (ll j = 2; j*j <= ans; j++) {
			if (!(ans%j)) {
				if (j*j != ans) {
					divs += 2;
				}
				else {
					divs++;
				}
			}
		}
		if (divs != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
int main() {
	int t;
	ll n;
	cin >> t;
	vector<ll>d(1e6+1);
	short int temp;
	ll cnt;
	ll divs;
	ll ind;
	for (int i = 0; i < t; i++) {
		cin >> n;
		cnt = 0;
		divs = 0;
		ind = 0;
		set<int>inds;
		vector<short int>div(1e6 + 1);
		for (ll j = 0; j < n; j++) {
			cin >> d[j];
			for (ll k = 2; k*k <= d[j]; k++) {
				temp = 0;
				while (d[j] % k == 0) {
					inds.insert(j);
					temp++;
					d[j] /= k;
				}
				div[k] = max(div[k], temp);
			}
			if (d[j] != 1) {
				div[d[j]] = max((short int)1, div[d[j]]);
				d[j] = 1;
			}
		}
		ll ans = 1;
		for(auto x: inds){
			if (div[x]) {
				cnt++;
				ind = x;
			}
			for (ll k = 0; k < div[x]; k++) {
				ans *= x;
			}
		}
		if (cnt == 1) {
			ans *= ind;
		}
		for (ll j = 2; j*j <= ans; j++) {
			if (!(ans%j)) {
				if (j*j != ans) {
					divs += 2;
				}
				else {
					divs++;
				}
			}
		}
		if (divs != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include <iostream>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cassert>
#include <functional>
using namespace std;
typedef long long ll;
ll CntDivs(ll va) {
	ll ct = 0;
	for (int i = 2; i*i <= va; i++) {
		if (va%i == 0 && i*i != va) {
			ct += 2;
		}
		else if (va%i == 0) {
			ct++;
		}
	}
	return ct;
}
int main() {
	int t;
	cin >> t;
	int n;
	ll ans;
	vector<ll>d(300);
	for (int i = 0; i < t; i++) {
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> d[i];
		}
		sort(d.begin(), d.begin() + n);
		ans = d[0] * d[n - 1];
		if (CntDivs(ans) != n) {
			cout << -1 << "\n";
		}
		else {
			cout << ans << "\n";
		}
	}
	//system("pause>nul");
	return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
# define  _deb(x) { cerr << "\033[94m"<< "[ " << #x << " = " << (x) << " ]\n\033[0m"; }
#define   int          long long
#define   forn(i,n)    for(int i=0;i<n;i++)
#define   forr(i,a,b)  for(int i=a;i<=b;i++)
#define   mem(ar,x)    memset(ar,x,sizeof ar)
#define   all(x)       x.begin(),x.end()
#define   Lcm(a,b)     (a*(b/__gcd(a,b)))
#define   __p(x,n)     for(int i=0;i<n;i++) { cerr << "\033[94m"<< " " <<x[i]<< "\033[0m"; } cerr<<'\n';
#define   fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define   PB           push_back
#define   F            first
#define   S            second
#define   MP           make_pair
#define   vll          __int128_t
using namespace std;
typedef long long ll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
typedef vector<int>VI;
typedef pair<int,int>PII;
typedef vector<PII>VPII;

const int xx = 1e5;
const int mod = 1e9+7;
const int inf = 1e18;

signed main(){
    int t;
    cin >> t;
    while(t--) {
    int n;
    cin >> n;
    vector<int>v(n);
    for(int i=0;i<n;i++) cin >> v[i];
    int lc = v[0];
    int mx = 0;
    for(int i=0;i<n;i++) {
        lc = Lcm(lc,v[i]);
        mx = max(mx , v[i]);
    }
    if(lc =  mx) lc = lc * 2;

        cout << lc << '\n';
    }

}


#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
    int t;
    cin >> t;
    while(t--) {
        int n;
        cin >> n;
        vector<int>v(n);
        for(int i=0;i<n;i++) cin >> v[i];

        sort(v.begin() , v.end());
        int ans = v[0] * v[n-1] * 1LL;
       // _deb(ans);
        if((int)sqrt(ans)*(int)sqrt(ans) == ans){
            int x = v[n/2];
           // _deb(x);
            if(x*x != ans) {
                cout << - 1 << '\n';
                continue;
            }
        }
        for(int i=0;i<(n/2);i++) {
            if(v[i]*v[n-i-1]*1LL != ans){
                ans = -1;
                break;
            }
        }
        int cnt = 0;
        for(int i=1;i*i<=ans;i++){
            if(ans % i == 0) {
                cnt ++ ;
                if(n/i != i) cnt ++;
            }
        }
        if(cnt != n+2) {
            cout << -1 << '\n';
            continue;
        }
        cout << ans << '\n';
    }
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
# define  _deb(x) { cerr << "\033[94m"<< "[ " << #x << " = " << (x) << " ]\n\033[0m"; }
#define   int          long long
#define   forn(i,n)    for(int i=0;i<n;i++)
#define   forr(i,a,b)  for(int i=a;i<=b;i++)
#define   mem(ar,x)    memset(ar,x,sizeof ar)
#define   all(x)       x.begin(),x.end()
#define   Lcm(a,b)     (a*(b/__gcd(a,b)))
#define   __p(x,n)     for(int i=0;i<n;i++) { cerr << "\033[94m"<< " " <<x[i]<< "\033[0m"; } cerr<<'\n';
#define   fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define   PB           push_back
#define   F            first
#define   S            second
#define   MP           make_pair
#define   vll          __int128_t
using namespace std;
typedef long long ll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
typedef vector<int>VI;
typedef pair<int,int>PII;
typedef vector<PII>VPII;

const int xx = 1e5;
const int mod = 1e9+7;
const int inf = 1e18;
signed main(){
    int t;
    cin >> t;
    while(t--) {
    int n;
    cin >> n;
    vector<int>v(n);
    vector<int>a,b;
    a.push_back(1);
    for(int i=0;i<n;i++) {
        cin >> v[i];
        a.push_back(v[i]);
    }
    int lc = v[0];
    int gc=0;
    int mx = 0;
    if(n==1 && v[0]==2) {
        cout<<4<<endl;
        continue;
    }

    sort(v.begin() , v.end());
    for(int i=0;i<n;i++) {
        lc = Lcm(lc,v[i]);
        gc = __gcd(gc , v[i]);
        mx = max(mx , v[i]);
    }
    if(lc == mx) lc = mx*mx;
    a.push_back(lc);

    for(int i=1;i*i<=lc;i++) {
        if(lc % i == 0) {
            if(i == lc/i){
                b.push_back(i);
            }
            else{
                b.push_back(i);
                b.push_back(lc/i);
            }
        }
    }
    sort(all(a));
    sort(all(b));
    if(a.size() != b.size()){
        cout<<-1<<endl;
        continue;
    }
    for(int i=0;i<a.size();i++){
        if(a[i] != b[i]) {
            cout<<-1<<endl;
            continue;
        }
    }
    cout << lc << endl;

    }

}


#include<bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
    int t;
    cin >> t;
    while(t--) {
        int n;
        cin >> n;
        vector<int>v(n);
        for(int i=0;i<n;i++) cin >> v[i];
        sort(v.begin() , v.end());
        int ans = v[0] * v[n-1] * 1LL;
       // _deb(ans);
        if((int)sqrt(ans)*(int)sqrt(ans) == ans){
            int x = v[n/2];
           // _deb(x);
            if(x*x != ans) {
                cout << - 1 << '\n';
                continue;
            }
        }
        for(int i=0;i<(n/2);i++) {
            if(v[i]*v[n-i-1]*1LL != ans){
                ans = -1;
                break;
            }
        }
        cout << ans << '\n';
    }
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
# define  _deb(x) { cerr << "\033[94m"<< "[ " << #x << " = " << (x) << " ]\n\033[0m"; }
#define   int          long long
#define   forn(i,n)    for(int i=0;i<n;i++)
#define   forr(i,a,b)  for(int i=a;i<=b;i++)
#define   mem(ar,x)    memset(ar,x,sizeof ar)
#define   all(x)       x.begin(),x.end()
#define   Lcm(a,b)     (a*(b/__gcd(a,b)))
#define   __p(x,n)     for(int i=0;i<n;i++) { cerr << "\033[94m"<< " " <<x[i]<< "\033[0m"; } cerr<<'\n';
#define   fast()       ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define   PB           push_back
#define   F            first
#define   S            second
#define   MP           make_pair
#define   vll          __int128_t
using namespace std;
typedef long long ll;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
typedef vector<int>VI;
typedef pair<int,int>PII;
typedef vector<PII>VPII;

const int xx = 1e5;
const int mod = 1e9+7;
const int inf = 1e18;
int divcnt(int n) {
    int cnt = 0;
    for(int i=1;i*i<=n;i++){
        if(n%i==0){
            cnt++;
            if(n/i != i) cnt++;
        }
    }
    return cnt;
}
signed main(){
    int t;
    cin >> t;
    while(t--) {
    int n;
    cin >> n;
    vector<int>v(n);
    for(int i=0;i<n;i++) cin >> v[i];
    int lc = v[0];
    int mx = 0;
    for(int i=0;i<n;i++) {
        lc = Lcm(lc,v[i]);
        mx = max(mx , v[i]);
    }
    if(lc == mx) lc = lc + lc;
    int x = divcnt(lc);
   // _deb(x);
    //_deb(lc);
    if(x != n+2) lc = -1;

        cout << lc << '\n';
    }

}