#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int flag = 0;
  int min = 4126;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    if (flag == 1) continue;
    if (a > min) flag = -1;
    if (a != b) flag = 1;
    min = a;
  }
  if (flag == 0) cout << "maybe";
  if (flag == 1) cout << "rated";
  if (flag == -1) cout << "unrated";
}
