#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x[200001], y[200001], n, i, j, ans = 0, cnt = 0, cur = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    if (x[i] == y[i]) {
      ans++;
    }
  }
  if (ans != n) {
    cout << "rated";
  } else {
    for (i = 1; i < n; i++) {
      if (x[i - 1] >= x[i]) {
        cur++;
      }
    }
    if (cur == n - 1) {
      cout << "maybe";
    } else {
      cout << "unrated";
    }
  }
  return 0;
}
