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