#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, flag = 0, key = 0;
  vector<int> v;
  cin >> n;
  while (n--) {
    int a, b;
    cin >> a >> b;
    if (a != b)
      flag++;
    else {
      v.push_back(a);
    }
  }
  if (flag) {
    cout << "rated"
         << "\n";
  } else {
    for (int i = 1; i < v.size(); i++) {
      if (v[i - 1] < v[i]) {
        key++;
        break;
      } else {
        key = 0;
      }
    }
    if (!key)
      cout << "maybe"
           << "\n";
    else
      cout << "unrated"
           << "\n";
  }
  return 0;
}
