#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, flag = 0;
  cin >> n;
  int *rate1 = new int[n];
  int *rate2 = new int[n];
  for (i = 0; i < n; i++) cin >> rate1[i] >> rate2[i];
  for (i = 0; i < n; i++) {
    if (rate1[i] != rate2[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 1) {
    cout << "rated";
    return 0;
  }
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (rate1[i] < rate1[j]) {
        flag = 2;
        break;
      }
    }
  }
  if (flag == 0)
    cout << "maybe";
  else if (flag == 2)
    cout << "unrated";
  return 0;
}
