#include <bits/stdc++.h>
using namespace std;
long long a[1005], b[1005];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, flag = 0;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      flag = 1;
      break;
    }
  }
  if (flag)
    cout << "rated";
  else {
    long long val = 0, idx;
    for (long long i = 1; i < n; i++) {
      if (b[i] > b[i - 1]) {
        val = 1;
        break;
      }
    }
    cout << (val == 0 ? "maybe" : "unrated");
  }
  return 0;
}
