#include <bits/stdc++.h>
using namespace std;
int main() {
  bool r = 0;
  int n;
  bool u = 0;
  cin >> n;
  int a[n];
  int b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i];
    if (a[i] != b[i]) r = 1;
  }
  if (r)
    cout << "rated";
  else {
    for (int i = 0; i < n - 1; i++)
      if (a[i] < a[i + 1]) u = 1;
    if (u)
      cout << "unrated";
    else
      cout << "maybe";
  }
  return 0;
}
