#include <bits/stdc++.h>
using namespace std;
int primero;
int CantDigitos(int n) {
  int c = 0;
  while (n > 0) {
    c++;
    if (n < 10) {
      primero = n;
    }
    n = n / 10;
  }
  return c;
}
int main() {
  int n, ant, z, y;
  cin >> n;
  bool a = false;
  ant = 5000;
  int b[n];
  for (int i = 0; i < n; i++) {
    cin >> z >> y;
    if (z != y) {
      a = true;
      cout << "rated" << endl;
      break;
    }
    b[i] = z;
  }
  if (a == false) {
    for (int i = 0; i < n; i++) {
      if (ant < b[i]) {
        cout << "unrated" << endl;
        a = true;
        break;
      } else {
        ant = b[i];
      }
    }
  }
  if (a == false) {
    cout << "maybe" << endl;
  }
}
