You are surrounded by Imperial warships and must land on a planet to escape. Your best chance is to reach the planet closest to your current location. Unfortunately the navigation system has been damaged, so you must write a program that finds the planet closest to your ship.
Space is represented by an $m \times m$ grid made up of the following four characters:
s: your shipw: an Imperial warshipp: a planet-: open spaceThe location of every object (your ship, a warship, or a planet) is its position in the grid, written as (row, column) with both indices starting at $0$; the top-left cell is $(0, 0)$. The table below shows the coordinates of every cell of a $4 \times 4$ grid.

The distance between two points $(x_1, y_1)$ and $(x_2, y_2)$ is
$$dist = \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$$
The first line contains a positive integer $n$, the number of data sets that follow. Each data set begins with a line containing a positive integer $m$, followed by $m$ lines of exactly $m$ characters each; every character is one of s, w, p, or -. Each data set contains exactly one ship s and at least one planet p.
For each data set print one line: the coordinates of your current location, a colon (:), the coordinates of the closest planet, another colon (:), and the distance to that planet rounded to two decimal places. Coordinates are printed as (row,column) with no spaces.
If several planets share the smallest distance, print the one that comes first in row-major order — the smallest row index, and among those the smallest column index.