#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n;
  int m;
  int bufn, bufm;
  string ext = "maybe";
  int count;
  cin >> count;
  for (int i = 0; i < count; i++) {
    cin >> n >> m;
    if (m > n | m < n) {
      ext = "rated";
      break;
    }
    if (n > bufn && m > bufm && n == m && i > 0) {
      ext = "unrated";
    }
    bufn = n;
    bufm = m;
  }
  cout << ext;
  return EXIT_SUCCESS;
}
