#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, f[1001], l[1001];
  bool rated = false;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> f[i] >> l[i];
    if (f[i] != l[i]) {
      rated = true;
      cout << "rated" << endl;
      return 0;
    }
  }
  if (!rated) {
    for (i = 1; i < n; i++) {
      if (l[i] > l[i - 1]) {
        cout << "unrated" << endl;
        return 0;
      }
    }
  }
  cout << "maybe" << endl;
  return 0;
}
