#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  bool changed = false;
  bool sorted = true;
  int n, prev, temp, a, b;
  std::cin >> n;
  std::cin >> prev >> temp;
  if (temp != prev) changed = true;
  for (int i = 1; i < n; i++) {
    std::cin >> a >> b;
    if (a != b) {
      changed = true;
      break;
    } else if (a > prev) {
      sorted = false;
    }
    prev = a;
  }
  if (changed)
    std::cout << "rated";
  else if (sorted)
    std::cout << "maybe";
  else
    std::cout << "unrated";
  return 0;
}
