Drawing a Picture

Paste the same N by M clipboard picture T times with its top-left corner at (i,i) for each second i, then count red, green, and blue pixels remaining.

Medium7MatrixMathPrefix sumNo attempts yetTime limit2sMemory limit512 MB

Problem

Yeongseon draws a picture with a very simple graphics editor.

The editor works like this.

  • The canvas is an infinite two dimensional grid of pixels.
  • There are four colors, red, green, blue, and transparent, written as 'R', 'G', 'B', and '.' in that order.
  • The editor has a clipboard that stores one rectangular picture.
  • The user can paste the clipboard picture onto the canvas, and the user picks the cell where the top left corner of the picture lands.
  • When the picture is pasted, a red, green, or blue pixel overwrites the canvas pixel under it, and a transparent cell leaves the canvas pixel as it was.

The canvas starts out fully transparent, and Yeongseon has already copied a finished picture into the clipboard.

Yeongseon pastes the picture for TT seconds. At second ii she pastes it so that its top left cell is at (i,i)(i, i).

Given the clipboard picture and TT, write a program that counts the red pixels, the green pixels, and the blue pixels left on the canvas after TT seconds.

Input

The first line contains the number of rows NN and the number of columns MM of the clipboard picture, and TT. (1N,M501 \le N, M \le 50, 1T1091 \le T \le 10^9)

Each of the next NN lines contains the clipboard picture, one row per line. Each row is a string of length MM made only of 'R', 'G', 'B', and '.'.

Output

Print the number of red pixels on the first line, the number of green pixels on the second line, and the number of blue pixels on the third line.