#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  for (auto &x : v) cin >> x.first >> x.second;
  if (is_sorted(v.rbegin(), v.rend())) {
    bool ok = true;
    for (auto x : v)
      if (x.first != x.second) ok = false;
    if (ok) {
      cout << "maybe\n";
      return 0;
    }
  }
  for (auto x : v)
    if (x.first != x.second) {
      cout << "rated\n";
      return 0;
    }
  cout << "unrated\n";
  return 0;
}
