#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> v1;
  vector<int> v2;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int t1;
    int t2;
    cin >> t1;
    cin >> t2;
    v1.push_back(t1);
    v2.push_back(t2);
  }
  for (int i = 0; i < n; i++) {
    if (v1[i] - v2[i] != 0) {
      cout << "rated" << endl;
      exit(0);
    } else {
      continue;
    }
  }
  int iter = ((int)((v1).size()));
  for (int j = 0; j < iter - 1; j++) {
    for (int z = j + 1; z < iter; z++) {
      if (v1[j] < v1[z]) {
        cout << "unrated" << endl;
        exit(0);
      } else {
        continue;
      }
    }
  }
  cout << "maybe" << endl;
  return 0;
}
