#include <bits/stdc++.h>
using namespace std;
int ai[1050];
int bi[1050];
int main() {
  int n, sum = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ai[i] >> bi[i];
  }
  for (int i = 0; i < n; i++) {
    if (ai[i] == bi[i]) sum++;
  }
  int ans = 0;
  if (sum == n) {
    for (int i = 0; i < n; i++) {
      if (ai[i] < ai[i + 1]) ans++;
    }
    if (ans > 0)
      cout << "unrated\n";
    else
      cout << "maybe\n";
  } else
    cout << "rated\n";
  return 0;
}
