#include <bits/stdc++.h>
using namespace std;
int before[1010], after[1010];
int main(void) {
  int n;
  cin >> n;
  bool rated = true;
  int prev_b = 5000, prev_a = 5000;
  for (int i = 0; i < n; i++) {
    cin >> before[i] >> after[i];
    if (before[i] != after[i]) {
      cout << "rated" << endl;
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (prev_b < before[i] or prev_a < after[i]) {
      cout << "unrated" << endl;
      return 0;
    }
    prev_b = before[i];
    prev_a = after[i];
  }
  cout << "maybe" << endl;
}
