#include <bits/stdc++.h>
using namespace std;
vector<string> split(string s) {
  istringstream buf(s);
  istream_iterator<string> beg(buf), end;
  vector<string> list(beg, end);
  return list;
}
bool isvowel(char c) {
  string s = "aeiou";
  if (find(s.begin(), s.end(), c) != s.end()) return true;
  return false;
}
void solve() {
  int n;
  cin >> n;
  vector<pair<int, int> > v(n), w(n);
  for (int i = 0; i < n; i++) cin >> v[i].first >> v[i].second;
  w = v;
  for (auto i : v)
    if (i.first != i.second) {
      cout << "rated";
      return;
    }
  sort(v.rbegin(), v.rend());
  v == w ? cout << "maybe" : cout << "unrated";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  for (int test_case = 1; test_case <= t; test_case++) solve();
  return 0;
}
