fun main(args:Array<String>?): Unit {
    val direction = arrayOf(Point(0, -1), Point(1, 0), Point(0, 1), Point(-1, 0))
    while(true){
        val (h, w, l) = readLine()!!.trim().split(' ')
        if (h == "0" && w == "0" && l == "0") return
        val height = h.toInt()
        val width = w.toInt()
        val step = l.toLong()
        val state = Array(height){readLine()!!.trim()}
        val start = (0 until height).mapNotNull { y -> (0 until width).find{ x -> state[y][x] != '#' && state[y][x] != '.'}?.let{Point(it, y)} }.first()
        val initialDir = when(state[start.y][start.x]){
            'N' -> 0
            'E' -> 1
            'S' -> 2
            'W' -> 3
            else -> TODO()
        }
        val memo = Array(4){Array(height){IntArray(width){-1}}}
        var count = 0
        var pos = start
        var dir = initialDir
        var lastMoved = start
        var lastDir = initialDir
        while(step > count && memo[dir][pos.y][pos.x] == -1){
            memo[dir][pos.y][pos.x] = count
            val suspect = pos + direction[dir]
            if (suspect.y in state.indices && suspect.x in state[suspect.y].indices && state[suspect.y][suspect.x] != '#') {
                pos = suspect
                ++count
                lastMoved = pos
                lastDir = dir
            }else {
                dir = (dir + 1) % 4
            }
        }
        val rest = (step - count) % (count - memo[dir][pos.y][pos.x])
        pos = lastMoved
        dir = lastDir
        repeat(rest.toInt()){
            var suspect = pos + direction[dir]
            while (suspect.y !in state.indices || suspect.x !in state[suspect.y].indices || state[suspect.y][suspect.x] == '#') {
                dir = (dir + 1) % 4
                suspect = pos + direction[dir]
            }
            pos = suspect
        }
        println("${pos.y + 1} ${pos.x + 1} ${arrayOf('N', 'E', 'S', 'W')[dir]}")
    }
}
data class Point(val x: Int, val y: Int) {
    operator fun plus(that: Point): Point = Point(x + that.x, y + that.y)
}
