#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, mn = int(1e9 + 7);
  bool chan = 0, ok = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    int a, b;
    cin >> a >> b;
    if (mn < a) ok = 1;
    mn = min(mn, a);
    if (a != b) chan = 1;
  }
  if (chan)
    cout << "rated";
  else if (!chan && ok)
    cout << "unrated";
  else
    cout << "maybe";
  return 0;
}
