#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 0, i, m1, m2, n1, n2, max;
  cin >> n;
  for (i = 0; i < n; i++) {
    if (i == 0) {
      cin >> m1 >> m2;
      if (m1 != m2) {
        cout << "rated";
        x = 0;
        break;
      } else
        max = m1;
    } else {
      cin >> n1 >> n2;
      if (n1 != n2) {
        cout << "rated";
        x = 0;
        break;
      } else {
        if (n1 > max) {
          x = 1;
        }
        max = n1;
      }
    }
  }
  if (n == i) {
    if (x)
      cout << "unrated";
    else
      cout << "maybe";
  }
  return 0;
}
