### constant

MX = MY = 8
ITVL = 4
LX = MX * ITVL
LY = MY * ITVL

SLX = 3
SLY = 1
SDX = SDY = 1

### main

loop do
  n = gets.to_i
  break if n < 0

  xms = (MY + 1).times.map{MX.times.map{false}}
  yms = (MX + 1).times.map{MY.times.map{false}}

  n.times do
    di, xi, yi = gets.strip.split
    if di == 'x'
      xms[yi.to_i][xi.to_i] = true
    else
      yms[xi.to_i][yi.to_i] = true
    end
  end
  #p xms
  #p yms
  
  lx = SLX
  ly = SLY
  dx = SDX
  dy = SDY

  loop do
    lx += dx
    ly += dy

    break if lx == SLX && ly == SLY && dx == SDX && dy == SDY
    
    mx = lx / ITVL
    my = ly / ITVL

    reflect = false
    if ly % ITVL == 0 && xms[my][mx]
      dy = -dy
      reflect = true
    elsif lx % ITVL == 0 && yms[mx][my]
      dx = -dx
      reflect = true
    end

    break if ! reflect && (lx == 0 || lx == LX || ly == 0 || ly == LY)
  end

  puts [lx * 100 / ITVL, ly * 100 / ITVL].join(' ')
end