#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
#include <time.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


enum DIR{
	right_UP,
	left_UP,
	left_DOWN,
	right_DOWN,
};

enum DIR2{
	TATE,
	YOKO,
};

struct Info{
	char ch;
};

int N;

bool check_tate[9][9],check_yoko[9][9];

void func(){

	for(int row = 0; row < 9; row++){
		for(int col = 0; col < 9; col++){
			check_tate[row][col] = false;
			check_yoko[row][col] = false;
		}
	}

	char buf[2];
	int x,y;

	for(int loop = 0; loop < N; loop++){
		scanf("%s %d %d",buf,&x,&y);
		if(buf[0] == 'y'){
			check_tate[x][y] = true;
		}else{
			check_yoko[x][y] = true;
		}
	}

	int current_x = 100,current_y = 50;
	DIR dir = right_UP;

	bool LOOP_FLG = false,MIRROR_FLG,FINISH_FLG = false;
	DIR2 mirror_dir;

	while(true){

		MIRROR_FLG = false;

		if(current_x%100 == 0){

			mirror_dir = TATE;

			x = current_x/100;
			for(y = 0; y <= 7; y++){
				if(y*100 < current_y && (y+1)*100 > current_y){
					break;
				}
			}

			if(check_tate[x][y]){
				MIRROR_FLG = true;
			}
		}else{

			mirror_dir = YOKO;

			y = current_y/100;
			for(x = 0; x <= 7; x++){
				if(x*100 < current_x && (x+1)*100 > current_x){
					break;
				}
			}

			if(check_yoko[x][y]){
				MIRROR_FLG = true;
			}
		}

		if(MIRROR_FLG){

			if(mirror_dir == TATE){

				switch(dir){
				case right_UP:
					current_x -= 50;
					current_y += 50;
					dir = left_UP;
					break;
				case left_UP:
					current_x += 50;
					current_y += 50;
					dir = right_UP;
					break;
				case left_DOWN:
					current_x += 50;
					current_y -= 50;
					dir = right_DOWN;
					break;
				case right_DOWN:
					current_x -= 50;
					current_y -= 50;
					dir = left_DOWN;
					break;
				}

			}else{ //mirror_dir == YOKO

				switch(dir){
				case right_UP:
					current_x += 50;
					current_y -= 50;
					dir = right_DOWN;
					break;
				case left_UP:
					current_x -= 50;
					current_y -= 50;
					dir = left_DOWN;
					break;
				case left_DOWN:
					current_x -= 50;
					current_y += 50;
					dir = left_UP;
					break;
				case right_DOWN:
					if(current_x == 50 && current_y == 0){
						LOOP_FLG = true;
						break;
					}
					current_x += 50;
					current_y += 50;
					dir = right_UP;
					break;
				}

			}
		}else{

			if((mirror_dir == TATE && (x == 0 || x == 8)) || (mirror_dir == YOKO && (y == 0 || y == 8))){
				FINISH_FLG = true;
			}else{
				switch(dir){
				case right_UP:
					current_x += 50;
					current_y += 50;
					break;
				case left_UP:
					current_x -= 50;
					current_y += 50;
					break;
				case left_DOWN:
					current_x -= 50;
					current_y -= 50;
					break;
				case right_DOWN:
					current_x += 50;
					current_y -= 50;
					break;
				}
			}
		}
		if(LOOP_FLG == true || FINISH_FLG == true)break;
	}

	if(LOOP_FLG){
		printf("75 25\n");
	}else{
		printf("%d %d\n",current_x,current_y);
	}
}


int main(){

	while(true){
		scanf("%d",&N);
		if(N == -1)break;

		func();
	}

	return 0;
}

Measured memory_bytes: 3144