#include<iostream>
#include<cmath>
#include<vector>
#include<algorithm>
#include<cassert>
#include<iomanip>
#include<complex>

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS)
#define COUNTER_CLOCKWISE 1
#define CLOCKWISE -1 
#define ONLINE_BACK 2
#define ONLINE_FRONT -2
#define ON_SEGMENT 0
#define pow2(a) ((a)*(a))

using namespace std;

// ------------------------
class Point
{
  public:
  double x,y;

  Point(double x = -1,double y = -1): x(x),y(y){}

  Point operator + (Point p ){return Point(x+p.x,y+p.y);}
  Point operator - (Point p){return Point(x-p.x,y-p.y);}
  Point operator * (double a){return Point(a*x,a*y);}
  Point operator / (double a){return Point(x/a,y/a);}

  bool operator < (const Point& p) const
  { return x != p.x?x<p.x:y<p.y; }

  bool operator == (const Point& p)const
  { return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS; }

};

struct Segment
{
  Point p1,p2;
  Segment(Point p1 = Point(-1,-1),Point p2 = Point(-1,-1)):p1(p1),p2(p2){}

  bool operator == (const Segment& a)const
  {
    return p1 == a.p1 && p2 == a.p2;
  }
};

ostream& operator << (ostream& os,const Point& a)
{
  os << "(" << a.x << "," << a.y << ")";
}

ostream& operator << (ostream& os,const Segment& a)
{
  os << a.p1 << " " << a.p2;
}

typedef Point Vector;
typedef Segment Line;
typedef vector<Point> Polygon;

double dot(Point a,Point b){ return a.x*b.x + a.y*b.y; }

double cross(Point a,Point b){ return a.x*b.y - a.y*b.x; }

double norm(Point a){ return a.x*a.x+a.y*a.y; }

double abs(Point a){ return sqrt(norm(a)); }

bool pequals(Point a,Point b){ return equals(a.x,b.x) && equals(a.y,b.y); }

Point rotate(Point a,double rad){ return Point(cos(rad)*a.x - sin(rad)*a.y,sin(rad)*a.x + cos(rad)*a.y); }

double toRad(double agl){ return agl*M_PI/180.0; }

int ccw(Point p0,Point p1,Point p2)
{
  Point a = p1-p0;
  Point b = p2-p0;
  if(cross(a,b) > EPS)return COUNTER_CLOCKWISE;
  if(cross(a,b) < -EPS)return CLOCKWISE;
  if(dot(a,b) < -EPS)return ONLINE_BACK;
  if(norm(a) < norm(b))return ONLINE_FRONT;
  return ON_SEGMENT;
}

bool intersectLL(Line l, Line m) {
  return abs(cross(l.p2-l.p1, m.p2-m.p1)) > EPS || // non-parallel
         abs(cross(l.p2-l.p1, m.p1-l.p1)) < EPS;   // same line
}
bool intersectLS(Line l, Line s) {
  return cross(l.p2-l.p1, s.p1-l.p1)*       // s[0] is left of l
         cross(l.p2-l.p1, s.p2-l.p1) < EPS; // s[1] is right of l
}
bool intersectLP(Line l,Point p) {
  return abs(cross(l.p2-p, l.p1-p)) < EPS;
}
bool intersectSS(Line s, Line t) {
  return ccw(s.p1,s.p2,t.p1)*ccw(s.p1,s.p2,t.p2) <= 0 &&
         ccw(t.p1,t.p2,s.p1)*ccw(t.p1,t.p2,s.p2) <= 0;
}
bool intersectSP(Line s, Point p) {
  return abs(s.p1-p)+abs(s.p2-p)-abs(s.p2-s.p1) < EPS; // triangle inequality
}

Point projection(Line l,Point p) {
  double t = dot(p-l.p1, l.p1-l.p2) / norm(l.p1-l.p2);
  return l.p1 + (l.p1-l.p2)*t;
}
Point reflection(Line l,Point p) {
  return p + (projection(l, p) - p) * 2;
}
double distanceLP(Line l, Point p) {
  return abs(p - projection(l, p));
}
double distanceLL(Line l, Line m) {
  return intersectLL(l, m) ? 0 : distanceLP(l, m.p1);
}

double distanceLS(Line l, Line s) {
  if (intersectLS(l, s)) return 0;
  return min(distanceLP(l, s.p1), distanceLP(l, s.p2));
}
double distanceSP(Line s, Point p) {
  Point r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s.p1 - p), abs(s.p2 - p));
}

double distanceSS(Line s, Line t) {
  if (intersectSS(s, t)) return 0;
  return min(min(distanceSP(s, t.p1), distanceSP(s, t.p2)),
             min(distanceSP(t, s.p1), distanceSP(t, s.p2)));
}
Point crosspoint(Line l, Line m) {
  double A = cross(l.p2 - l.p1, m.p2 - m.p1);
  double B = cross(l.p2 - l.p1, l.p2 - m.p1);
  if (abs(A) < EPS && abs(B) < EPS) return m.p1; // same line
  if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
  return m.p1 +   (m.p2 - m.p1) * (B / A);
}



// -^-^-^-^-^-^-^-^-^-^-^-^

struct Mirror
{
  Segment seg;
  int type;//0 : mirror, 1 : thief, 2 : wall
  Mirror(Segment seg=Segment(),int type=inf):seg(seg),type(type){}
};

int n;
const Point thief(0.75,0.25);

int getTheIndex(Segment beam,vector<Mirror> &vec,int stp)
{
  //cout << "index :: " << endl;
  int res = -inf;
  double mdist = inf;
  rep(i,vec.size())
    {
      if(i == 0)
	{
	  if(!intersectSP(beam,thief))continue;
	}
      else
	{ 
	  if(!intersectSS(beam,vec[i].seg))continue;
	}
      if(stp == i)continue;

      Point cp = crosspoint(beam,vec[i].seg);      
      //ut << i << " intersect !! : " << (int)(cp.x*100) << "," << (int)(cp.y*100) << endl;
      if(i == 0)cp = thief;
      double dist = sqrt(pow2(beam.p1.x-cp.x)+pow2(beam.p1.y-cp.y));
      if(!equals(mdist,dist) && mdist > dist)
	{
	  mdist = dist;
	  res = i;
	}
    }
  return res;
}

void compute(vector<Mirror> &vec)
{
  Point sp = Point(0.75,0.25);
  Point middle = Point(1,0.5) ;
  Vector vect = middle - sp;
  vect = (vect/abs(vect))*100 + sp;
  Segment beam;
  int index = 0;

  int phase = 1;
  while(true)
    {
      //cout << "phase " << phase++ << endl;

      beam = Segment(sp,vect);
      //cout << "beam : " << beam << endl;

      index = getTheIndex(beam,vec,index);

      //cout << "index : " << index << " : " << vec[index].seg << endl;

      Point cp = crosspoint(vec[index].seg,beam);
      if(index == 0)cp = thief;

      if(vec[index].type != 0)
	{
	  cout << (int)(float)(cp.x*100) << " " << (int)(float)(cp.y*100) << endl;
	  return;
	}

      sp = cp;
      //cout << "calc reflection " << vec[index].seg << " | " << vect << endl; 
      vect = reflection(vec[index].seg,vect);

      //cout << "new sp = " << sp << endl;
      //cout << "new vect = " << vect << endl;

    }

}


int main()
{
  /* 
  Point a,b;
  cin >> a.x >> a.y >> b.x >> b.y;
  Vector v = b-a;
  v = (v/abs(v))*10000;
  Segment seg(a,a+v);
  cout << "Segment( " << seg.p1 << " " << seg.p2 << " )\n";
  Point p;
  cin >> p.x >> p.y;

  cout << "Point " << p << "\n";
  cout << "intersect ? " << intersectSP(seg,p) << endl;
  cout << "reflection : " << reflection(seg,p) << endl;
  cout << "seg intersect ? " << intersectSS(seg,Segment(p,p)) << endl;
  return 0;
  */
  while(cin >> n,n != -1)
    {
      vector<Mirror> vec;
      vec.push_back(Mirror(Segment(Point(0.75,0.25),Point(0.75,0.25)),1));

      rep(i,n)
	{
	  char c;
	  double x,y;
	  cin >> c >> x >> y;
	  if(c == 'x') vec.push_back(Mirror(Segment(Point(x,y),Point(x+1,y)),0));
	  else vec.push_back(Mirror(Segment(Point(x,y),Point(x,y+1)),0));
	}

      rep(y1,9)rep(x1,9)REP(y2,y1,9)REP(x2,x1,9)
	if(abs(x1-x2) + abs(y1-y2) != 1)continue;
	else if((x1 == 0 || x1 == 8 || y1 == 0 || y1 == 8) && (x2 == 0 || x2 == 8 || y2 == 0 || y2 == 8))
	  {
	    Segment seg = Segment(Point(x1,y1),Point(x2,y2));
	    bool out = false;
	    REP(k,1,n+1)
	      if(seg == vec[k].seg)
		{
		  out = true;
		  break;
		}

	    seg = Segment(Point(x2,y2),Point(x1,y1));
	    REP(k,1,n+1)
	      if(seg == vec[k].seg)
	      {
		out = true;
		break;
	      }

	    if(!out)
	      vec.push_back(Mirror(seg,2));
	  }
      /*
      cout << "vec----" << endl;
      rep(i,vec.size())
	cout << i << " : " << vec[i].seg << endl;
      */
      compute(vec);

    }
  return 0;
}

Measured memory_bytes: 1244