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