#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0 ; i < (n); i++)
using namespace std;

int main() {
	int n; cin >> n;
	int a[n], b[n];
	REP(i, n) cin >> a[i] >> b[i];
	int res = 1e6+1;
	REP(i, n) REP(j, n)
		res = min(res, (i==j) ? a[i]+b[j] : max(a[i],b[j]));
	cout << res << '\n';
	return 0;
}

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<stack>
#include<queue>
#include<string>
#include<cmath>
#include<vector>
#include<map>
#include<cstdio>

#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
const int maxN = 1e6 + 1;
const int mod = 1e9 + 7;
ll a, b, w;
inline void FastInput()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}
void ReadInput()
{
    cin >> a >> b >> w;
}
void Solve()
{
    w *= 1000;
    if(w % b == 0) cout << w / b << " ";
    else
    {
        int r = b * (w / b + 1) - w;
        int mul = w / b + 1;
        int diff = b - a;
        if(r <= mul * diff) cout << w / b + 1 << " ";
        else
        {
            cout << "UNSATISFIABLE";
            return;
        }
    }
    if(w % a == 0) cout << w / a;
    else
    {
        int r = w - (a * w / a);
        int mul = w / a;
        int diff = b - a;
        if(r <= mul * diff) cout << w / a << " ";
        else
        {
            cout << "UNSATISFIABLE";
            return;
        }
    }
}
int main()
{
    FastInput();
    ReadInput();
    Solve();

}


