#include <bits/stdc++.h>
using namespace std;
long long n, x[1001], y[1002], f[1001], ok, k;
set<int> s;
int main() {
  cin >> n;
  int m = n;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    f[i] = x[i];
    if (x[i] != y[i]) ok++;
  }
  sort(f, f + n);
  for (int i = n - 1, j = 0; i >= 0; i--, j++)
    if (f[j] != x[i]) k++;
  if (ok)
    cout << "rated\n";
  else if (!k)
    cout << "maybe\n";
  else
    cout << "unrated\n";
  return 0;
}
