#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, test = 0, test2 = 0;
  cin >> x;
  int a[x][2];
  for (int i = 0; i < x; i++) {
    cin >> a[i][0] >> a[i][1];
    if (a[i][0] != a[i][1]) test++;
  }
  if (test != 0)
    cout << "rated" << endl;
  else {
    for (int k = 1; k < x; k++) {
      if (a[k][0] > a[k - 1][0]) test2++;
    }
    if (test2 == 0)
      cout << "maybe" << endl;
    else if (test2 != 0)
      cout << "unrated" << endl;
  }
  return 0;
}
