#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int n1, n2, n3 = 0;
  bool flagm = true, flagr = true;
  while (n--) {
    cin >> n1 >> n2;
    if (n3 < n2 && n3 != 0) flagm = false;
    if (n1 != n2) flagr = false;
    n3 = n2;
  }
  if (!flagr)
    cout << "rated";
  else if (flagr && !flagm)
    cout << "unrated";
  else
    cout << "maybe";
}
