#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, sum = 0, sum1 = 0;
  vector<int> vec;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    if (x != y) {
      cout << "rated";
      return 0;
    } else {
      vec.push_back(x);
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = i; j < n; j++) {
      if (vec[i] < vec[j]) {
        cout << "unrated";
        return 0;
      }
    }
  }
  cout << "maybe";
}
