#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> vec, v, check;
  for (int i = 0; i < (2 * n); i++) {
    int val;
    cin >> val;
    if (i % 2 == 0) {
      vec.push_back(val);
      check.push_back(val);
    } else {
      v.push_back(val);
    }
  }
  for (int i = 0; i < n; i++) {
    if (vec[i] != v[i]) {
      cout << "rated";
      return 0;
    }
  }
  sort(check.begin(), check.end(), greater<int>());
  for (int i = 0; i < n; i++) {
    if (vec[i] != check[i]) {
      cout << "unrated";
      return 0;
    }
  }
  cout << "maybe";
  return 0;
}
