#include <bits/stdc++.h>
using namespace std;
struct p {
  int a, b;
};
p point[1005];
int main() {
  int t;
  while ((scanf("%d", &t) != -1)) {
    int flag = 0;
    int ta, tb;
    for (int i = 0; i < t; i++) {
      scanf("%d %d", &point[i].a, &point[i].b);
      if (point[i].a != point[i].b)
        flag = 1;
      else if (i != 0 && flag == 0 && point[i].a > ta)
        flag = 2;
      ta = point[i].a;
      tb = point[i].b;
    }
    if (flag == 2)
      cout << "unrated" << endl;
    else if (flag == 1)
      cout << "rated" << endl;
    else
      cout << "maybe" << endl;
  }
}
