#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
using namespace std;
const double EPS = 1e-10;
const double INF = 1e12;
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}

P projection(const L& l, const P& p) {
    double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
    return l[0] + t*(l[0]-l[1]);
}
P reflection(const L& l, const P& p) {
    return p + 2.0*(projection(l, p) -p);
}

bool intersectLS(const L& l, const L& s){
    return cross(l[1]-l[0], s[0]-l[0])*
        cross(l[1]-l[0], s[1]-l[0]) < EPS;
}
bool intersectSP(const L& s, const P &p){
    return abs(cross(s[0]-p, s[1]-p))<EPS  && dot(s[0]-p, s[1]-p)<EPS;
}
P crosspointLL(const L &l, const L &m) {
  double A = cross(l[1]-l[0], m[1]-m[0]);
  double B = cross(l[1]-l[0], l[1]-m[0]);
  return m[0] + B/A *(m[1]-m[0]);
}

int main(){
    while(1){
        int n;
        cin >> n;
        if(n==-1) break;

        VP sq{P(0,0), P(800,0), P(800,800), P(0,800)};
        vector<L> wall(4);
        for(int i=0; i<4; i++){
            wall[i] = L(sq[i], sq[(i+1)%4]);
        }
        vector<L> mirror(n);
        for(int i=0; i<n; i++){
            char d;
            int x,y;
            cin >> d >> x >> y;
            x*=100; y*=100;
            if(d == 'x'){
                mirror[i] = L(P(x, y), P(x+100, y));
            }else{
                mirror[i] = L(P(x, y), P(x, y+100));
            }
        }

        P dir(1, 1);
        P pos(75, 25);
        int ansx=-1, ansy=-1;
        while(ansx == -1){
            P ref(INF, INF);
            L ray(pos, pos+dir);
            for(int i=0; i<n; i++){
                if(intersectLS(ray, mirror[i])){
                    P cp = crosspointLL(ray, mirror[i]);
                    if(dot(cp -pos, dir) > EPS && abs(cp -pos) < abs(ref -pos)){
                        ref = cp;
                    }
                }
            }
            if(ref.X == INF){
                for(int i=0; i<4; i++){
                    if(intersectLS(ray, wall[i])){
                        P cp = crosspointLL(ray, wall[i]);
                        if(dot(cp -pos, dir) > EPS){
                            ansx = cp.X +EPS;
                            ansy = cp.Y +EPS;
                            break;
                        }
                    }
                }
            }else{
                if(intersectSP(L(pos, ref), P(75,25)) && pos!=P(75,25)){
                    ansx = 75;
                    ansy = 25;
                }
                P to;
                if((int)(ref.X+EPS)%100 == 0){
                    to = reflection(L(ref, ref +P(1,0)), pos);
                }else{
                    to = reflection(L(ref, ref +P(0,1)), pos);
                }
                dir = to-ref;
                pos = ref;
            }
        }
        cout << ansx << " " << ansy << endl;
    }
    return 0;
}


Measured memory_bytes: 3112