#include <bits/stdc++.h>
using namespace std;
long long int MOD = 1000000000 + 7;
long long int memo[20][3000];
long long int matrix[510][510];
long long int moves[510][510];
long long int prime[1000000];
vector<long long int> primes;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
bool IsPrime(long long int x) {
  if (x == 1) return false;
  for (long long int i = 2; i * i <= x; i++) {
    if (x % i == 0) return false;
  }
  return true;
}
void seive(long long int n) {
  prime[0] = prime[1] = 1;
  for (long long int i = 2; i * i <= n; i++)
    if (!prime[i]) {
      for (long long int j = i * i; j <= n; j += i) prime[j] = 1;
    }
}
bool sortMa7boub(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first == b.first) return (a.second < b.second);
  return (a.first > b.first);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, temp, sum(0);
  cin >> n;
  vector<pair<long long int, int>> vec(n);
  for (int i = 0; i < n; i++) {
    vec[i].second = i;
    cin >> vec[i].first >> temp;
    sum += abs(vec[i].first - temp);
  }
  sort(vec.begin(), vec.end(), sortMa7boub);
  if (!sum) {
    int f = 0;
    for (int i = 1; i < n; i++) {
      if (vec[i].second - vec[i - 1].second != 1) {
        cout << "unrated" << endl;
        f = 1;
        break;
      }
    }
    if (!f) cout << "maybe" << endl;
  } else
    cout << "rated" << endl;
  return 0;
}
