#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int r = 0;
  int rr = 0;
  int prev = 10000;
  while (n--) {
    int a, b;
    cin >> a >> b;
    if (a != b)
      r = 1;
    else {
      if (a > prev) rr = 1;
    }
    prev = a;
  }
  if (r == 1)
    cout << "rated" << endl;
  else {
    if (rr == 0)
      cout << "maybe" << endl;
    else
      cout << "unrated" << endl;
  }
  return 0;
}
