#include <climits>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;

#define REP(i, a, b) for(int i = (a); i < int(b); ++i)
#define rep(i, n) REP(i, 0, n)

struct point {
	long long x, y;
	explicit point(long long x_ = 0, long long y_ = 0):x(x_), y(y_) {}

	inline point operator+(const point &p) const {
		return point(x + p.x, y + p.y);
	}

	inline point operator-(const point &p) const {
		return point(x - p.x, y - p.y);
	}

	inline point operator*(long long s) const {
		return point(x * s, y * s);
	}

	inline point operator/(long long s) const {
		return point(x / s, y / s);
	}

	inline bool operator==(const point &p) const {
		return x == p.x && y == p.y;
	}
};

struct segment {
	point a, b;
	segment(const point &a_, const point &b_):a(a_), b(b_) {}
};

struct line {
	point a, b;
	line(const point &a_, const point &b_):a(a_), b(b_) {}
};

typedef vector<point> polygon;

inline point rotate90(const point &p) {
	return point(-p.y, p.x);
}

inline long long norm(const point &p) {
	return p.x * p.x + p.y * p.y;
}

inline long long dot(const point &a, const point &b) {
	return a.x * b.x + a.y * b.y;
}

inline long long cross(const point &a, const point &b) {
	return a.x * b.y - a.y * b.x;
}

inline long long ccw(const point &a, point b, point c) {
	b = b - a;
	c = c - a;
	const long long t = cross(b, c);
	if(t > 0) return 1;
	if(t < 0) return -1;
	if(dot(b, c) < 0) return 2;
	if(norm(b) < norm(c)) return -2;
	return 0;
}

inline bool intersect(const segment &s, const point &p) {
	return !(s.a == p) && !(s.b == p) && ccw(s.a, s.b, p) == 0;
}

inline bool intersect(const segment &s, const segment &t) {
	return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) < 0
		&& ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) < 0;
}

inline bool intersect(const line &l, const segment &s) {
	return cross(l.b - l.a, s.a - l.a) * cross(l.b - l.a, s.b - l.a) <= 0;
}

inline bool orthogonal(const line &l, const line &m) {
	if(l.a == l.b || m.a == m.b) return false;
	return dot(l.a - l.b, m.a - m.b) == 0;
}

inline point crosspoint(const segment &s, const segment &t) {
	const long long tmp = cross(s.b - s.a, t.b - t.a);
	if(tmp == 0) {
		if(intersect(s, t.a)) return t.a;
		if(intersect(s, t.b)) return t.b;
		if(intersect(t, s.a)) return s.a;
		return s.b;
	}
	return t.a + (t.b - t.a) * cross(s.b - s.a, s.b - t.a) / tmp;
}

point solve(vector<segment> &mirrors) {
	const point thief(75, 25);
	const point direction(1, 1);
	const polygon wall{point(0, 0), point(800, 0), point(800, 800), point(0, 800)};

	const int n = mirrors.size();
	segment sight_line(thief, thief + direction * 5000);

	while(true) {
		int idx = -1;
		point next;
		long long min_dist = LLONG_MAX;

		if(intersect(sight_line, thief)) {
			next = thief;
			min_dist = norm(thief - sight_line.a);
		}

		rep(i, n) {
			if(intersect(sight_line, mirrors[i])) {
				const point cp = crosspoint(sight_line, mirrors[i]);
				const long long d = norm(cp - sight_line.a);

				if(d < min_dist) {
					next = cp;
					min_dist = d;
					idx = i;
				}
			}
		}

		rep(i, 4) {
			const segment s(wall[i], wall[(i + 1) % 4]);
			if(intersect(sight_line, s)) {
				const point cp = crosspoint(sight_line, s);
				const long long d = norm(cp - sight_line.a);

				if(d < min_dist) {
					next = cp;
					min_dist = d;
				}
			}
		}

		if(idx == -1) return next;

		point next_toward = sight_line.b;
		do {
			next_toward = rotate90(next_toward - next) + next;
		} while(!orthogonal(line(mirrors[idx].a, mirrors[idx].b), line(sight_line.b, next_toward)));

		sight_line.a = next;
		sight_line.b = next_toward;
	}
}

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	for(int n; cin >> n && n >= 0;) {
		vector<segment> mirrors;
		mirrors.reserve(n);

		rep(i, n) {
			char d;
			int x, y;
			cin >> d >> x >> y;

			if(d == 'x') {
				mirrors.emplace_back(point(x * 100, y * 100), point((x + 1) * 100, y * 100));
			}
			else {
				mirrors.emplace_back(point(x * 100, y * 100), point(x * 100, (y + 1) * 100));
			}
		}

		const point ans = solve(mirrors);
		cout << ans.x << " " << ans.y << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1200