#include <bits/stdc++.h>
using namespace std;
pair<int, int> road[1003];
int main() {
  bool win = false;
  bool r = true;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> road[i].first >> road[i].second;
    if (road[i].first != road[i].second) win = true;
  }
  if (win) {
    cout << "rated" << endl;
  } else {
    for (int i = 1; i < n; i++) {
      if (road[i].first > road[i - 1].first) {
        r = false;
        break;
      }
    }
    if (r)
      cout << "maybe" << endl;
    else
      cout << "unrated" << endl;
  }
  return 0;
}
