#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 1e6 + 6, OO = 0x3f3f3f3f;
int n, s[1005], e[1005], ans;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i] >> e[i];
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != e[i]) ans = 1;
  }
  if (ans == 1) {
    cout << "rated" << endl;
    return 0;
  }
  for (int i = 0; i < n - 1; i++) {
    if (s[i] < s[i + 1]) ans = 2;
  }
  if (ans == 2) {
    cout << "unrated" << endl;
    return 0;
  }
  cout << "maybe" << endl;
  return 0;
}
