#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.tie(0);
  int n;
  std::cin >> n;
  bool check = true;
  bool check2 = true;
  int tp = INT_MAX;
  for (int i = 0, a, b; i < n; ++i) {
    std::cin >> a >> b;
    if (a != b) check = false;
    if (a > tp) check2 = false;
    tp = a;
  }
  if (!check)
    std::cout << "rated";
  else if (!check2)
    std::cout << "unrated";
  else
    std::cout << "maybe";
}
