#include<iostream>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<algorithm>
using namespace std;
typedef struct node
{
int b,e;
char c;
}Node;
Node s[2001],r[20001];
int n,r_size,mx,ans_b,ans_e;
/**//*
bool cmp(Node aa,Node bb)
{
return aa.b > bb.b;
}*/
int cmp ( const void *a, const void *b )
{
Node *A, *B;
A = ( Node * ) a, B = ( Node * ) b ;
return A->b > B->b ? 1 : -1;
}
int gt(int a,int b)
{
return a > b ? a : b;
}
void init()
{
int i;
r_size = 0;
mx = 0;
for(i = 0;i < n;i++)
{
scanf("%d %d %c",&s[i].b,&s[i].e,&s[i].c);
}
memset(r,0,sizeof(r));
}
void dis()
{
int i,k;
for(i = 0;i < n;i++)
{
if(s[i].c == 'w')
{
r[r_size].b = s[i].b;
r[r_size].e = s[i].e;
r_size++;
}
else if(s[i].c == 'b')
{
int t_size = r_size;
//有四种情况需要考虑
for(k = 0;k < t_size;k++)
{
if(s[i].b<= r[k].b && s[i].e >= r[k].b && s[i].e < r[k].e)//黑的在白的一个区间里
{
r[k].b = s[i].e + 1;
}
else if(s[i].e >= r[k].e && s[i].b <= r[k].e && s[i].b > r[k].b)//黑的在白的交叉
{
r[k].e = s[i].b - 1;
}
else if(s[i].b <= r[k].b && s[i].e >= r[k].e)//
{
r[k].b = r[k].e = -1;
}
else if( s[i].b > r[k].b && s[i].e < r[k].e)//不包括临界点
{
r[r_size].e = r[k].e;
r[r_size].b = s[i].e + 1;
r[k].e = s[i].b - 1;
r_size ++;
}
}
}
}
//sort(r, r + r_size, cmp) ;
qsort ( r, r_size, sizeof ( Node ), cmp );
int size , t_b = -1 , t_e = -2;
//临时保存开始和结尾t_b与t_e,线性算法,和求最大字串和类似
//设初始为-1-(-2)+1 = 0
for(i = 0;i < r_size;i++)
{
if(r[i].b != -1)
{
if(r[i].b > t_e + 1)
{
size = t_e - t_b + 1;
if(size > mx)
{
mx = size;
ans_b = t_b;
ans_e = t_e;
}
t_b = r[i].b;
t_e = r[i].e;
}
else
{
t_e = gt(r[i].e,t_e);
}
}
}
size = t_e - t_b + 1;
if(size > mx)
{
mx = size;
ans_b = t_b;
ans_e = t_e;
}
}
void print()
{
if(mx == 0)
{ //Oh, my god
printf("Oh, my god\n");
}
else
{
printf("%d %d\n",ans_b,ans_e);
}
}
int main()
{
while(cin>>n)
{
init();
dis();
print();
}
return 0;
}