#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool ans = false;
  int arr[n], brr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i] >> brr[i];
    if (arr[i] != brr[i]) {
      ans = true;
    }
  }
  if (ans) {
    cout << "rated" << endl;
  } else {
    sort(arr, arr + n);
    reverse(arr, arr + n);
    for (int i = 0; i < n; i++) {
      if (arr[i] != brr[i]) {
        ans = true;
        break;
      }
    }
    if (ans)
      cout << "unrated" << endl;
    else
      cout << "maybe" << endl;
  }
  return 0;
}
