#include <bits/stdc++.h>
int main() {
  std::ios::sync_with_stdio(false);
  int n, arr[1000][2], flag = 0, count = 0;
  std::cin >> n;
  for (int i = 0; i < n; i++) {
    std::cin >> arr[i][0] >> arr[i][1];
    if (arr[i][0] != arr[i][1]) {
      flag = 1;
      break;
    }
    if (((i != 0) && (arr[i][0] <= arr[i - 1][0]))) count++;
  }
  if (flag == 1) {
    std::cout << "rated";
  } else if (count == n - 1) {
    std::cout << "maybe";
  } else {
    std::cout << "unrated";
  }
  return 0;
}
