#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n, cnt = 0, x, y;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(x);
    if (x == y) cnt++;
  }
  if (cnt == n) {
    for (int i = n - 2; i >= 0; i--) {
      if (v[i] < v[i + 1]) {
        cout << "unrated";
        return 0;
      }
    }
    cout << "maybe";
    return 0;
  }
  cout << "rated";
  return 0;
}
