#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#include <complex>
#include <cassert>
#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()

using namespace std;

constexpr int inf = 1 << 30;
constexpr long long llinf = 1LL << 62;
constexpr int mod = 1000000007;  // 998244353;
constexpr int dy[4] = {-1, 0, 1, 0}, dx[4] = {0, -1, 0, 1};

using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

int main() {
  int N;
  cin >> N;
  vector<int> used(2 * N);
  auto out = []() {
    cout << "No" << endl;
    exit(0);
  };
  REP(i, N) {
    int A, B;
    cin >> A >> B;
    if (A != -1 && B != -1 && A >= B) {
      out();
    }
    if (A != -1) {
      if (used[A - 1] != 0) out();
      used[A - 1] = i + 1;
    }
    if (B != -1) {
      if (used[B - 1] != 0) out();
      used[B - 1] = -(i + 1);
    }
  }
  vector<bool> dp(N + 1);
  dp[0] = 1;
  FOR(i, 1, N + 1) {
    REP(j, i)
    if (dp[j]) {
      bool ok = 1;
      int width = i - j;
      REP(k, width) {
        int a = used[2 * j + k], b = used[2 * j + k + width];
        if (a > 0) {
          if (b != 0 && b != -a) ok = 0;
        } else if (a < 0)
          ok = 0;
        if (b < 0) {
          if (a != 0 && a != -b) ok = 0;
        } else if (b > 0)
          ok = 0;
      }
      if (ok) {
        dp[i] = 1;
        break;
      }
    }
  }
  cout << (dp[N] ? "Yes" : "No") << endl;
  return 0;
}
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template <typename T>  using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll           long long
#define rep(i,j,n)   for(int i=j;i<n;++i)
#define scn(a)       scanf("%d",&a)
#define scns(a,b)    scanf("%d %d",&a,&b)
#define print(a)     printf("%d\n",a)
#define pb           emplace_back    
#define f            first
#define s            second
#define all(v)       v.begin(),v.end()
#define inf          1e18+7
const int mod = 1e9+7;
const int N = 5e5+5;

int n;

int main()
{
    int test; test = 1;

    for(int t = 1; t <= test; ++t)
    {
        int l,r,w; scns(l,r); scn(w);

		n = w*1000;

		if(n * (r-l) <= 1e8)
		{
			ll dp[n+1], dp1[n+1] = {}; dp[0] = 0;
	
			for(int i = 1; i <= n; ++i)
			{
				dp[i] = inf;
				
				for(int j = l; j <= r; ++j)
				if(i >= j)
				dp[i] = min(dp[i],dp[i-j] + 1);
			}
			
			for(int i = 1; i <= n; ++i)
			{
				dp1[i] = -inf;
				
				for(int j = l; j <= r; ++j)
				if(i >= j)
				dp1[i] = max(dp1[i],dp1[i-j] + 1);
			}
	
			if(dp[n] >= inf)
			puts("UNSATISFIABLE");
			else
			printf("%lld %lld\n",dp[n], dp1[n]);

			continue;
		}

		if((n > r && n < 2*l) || n < l)
		puts("UNSATISFIABLE");
		else
		printf("%lld %lld\n", (n-1)/r + 1, n/l);
    }

    return 0;
}