#include <bits/stdc++.h>
using namespace std;
pair<int, int> a[1002];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  int k = 0;
  for (int i = 0; i < n; i++) {
    if (a[i].first != a[i].second) {
      k = 1;
      break;
    }
  }
  if (k != 1) {
    for (int i = 1; i < n; i++) {
      if (a[i].first > a[i - 1].first || a[i].second > a[i - 1].second) {
        k = 2;
        break;
      }
    }
  }
  if (k == 1)
    cout << "rated";
  else if (k == 2)
    cout << "unrated";
  else
    cout << "maybe";
  return 0;
}
