#include <bits/stdc++.h>
using namespace std;
int main() {
  int nom1, nom2, nom3;
  bool maybe = true;
  int size;
  cin >> size;
  cin >> nom1;
  for (int i = 0; i < size; i++) {
    cin >> nom2 >> nom3;
    if (nom1 != nom2) {
      std::cout << "rated" << std::endl;
      return 0;
    } else if (nom3 > nom1) {
      maybe = false;
    }
    nom1 = nom3;
  }
  if (maybe) {
    std::cout << "maybe" << std::endl;
  } else {
    std::cout << "unrated" << std::endl;
  }
  return 0;
}
