#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> b[i] >> a[i];
  }
  bool f = false;
  for (int i = 0; i < n; i++) {
    if (a[i] != b[i]) {
      f = true;
      break;
    }
  }
  if (f)
    cout << "rated" << endl;
  else {
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        if (a[i] < a[j]) {
          f = true;
          break;
        }
      }
      if (f) {
        break;
      }
    }
    if (f)
      cout << "unrated" << endl;
    else
      cout << "maybe" << endl;
  }
}
