#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n], brr[n];
  for (int i = 0; i < n; ++i) {
    cin >> arr[i] >> brr[i];
  }
  for (int i = 0; i < n; ++i) {
    if (arr[i] != brr[i]) {
      cout << "rated";
      return 0;
    }
  }
  for (int i = 0; i < n - 1; ++i) {
    if (arr[i] < arr[i + 1] && brr[i] < brr[i + 1]) {
      cout << "unrated";
      return 0;
    }
  }
  cout << "maybe";
  return 0;
}
