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