#include<bits/stdc++.h>
using namespace std;
long long t,n,m,k,of,xf,osum,xsum;
char mat[1005][1005];
void work1(){
osum=0;
xsum=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(mat[i][j]=='o'){
xsum=0;
osum++;
}
else if(mat[i][j]=='x'){
osum=0;
xsum++;
}
if(osum>=k){
of++;
return ;
}
if(xsum>=k){
xf++;
return ;
}
}
osum=0;
xsum=0;
}
}
void work2(){
osum=0;
xsum=0;
for(int i=0;i<n;i++){
for(int j=0;j<m;j++){
if(mat[j][i]=='o'){
xsum=0;
osum++;
}
else if(mat[j][i]=='x'){
osum=0;
xsum++;
}
if(osum>=k){
of++;
return ;
}
if(xsum>=k){
xf++;
return ;
}
}
osum=0;
xsum=0;
}
}
void work3(){//左扫
osum=0;
xsum=0;
for(int i=0;i<n;i++){
int j=0;
int t=i;
for(int l=0;l<m;l++){
if((t<0||j>=n)){
osum=0;
xsum=0;
break;
}
else{
if(mat[t][j]=='o'){
xsum=0;
osum++;
}
else if(mat[t][j]=='x'){
osum=0;
xsum++;
}
if(osum>=k){
of++;
return ;
}
if(xsum>=k){
xf++;
return ;
}
t--;
j++;
}
}
continue;
}
}
void work4(){//右扫
osum=0;
xsum=0;
for(int i=0;i<n;i++){
int j=n-1;
int t=i;
for(int l=0;l<m;l++){
if((t<0||j>=n)){
osum=0;
xsum=0;
break;
}
else{
if(mat[t][j]=='o'){
xsum=0;
osum++;
}
else if(mat[t][j]=='x'){
osum=0;
xsum++;
}
if(osum>=k){
of++;
return ;
}
if(xsum>=k){
xf++;
return ;
}
t--;
j--;
}
}
continue;
}
}
int main(){
cin>>t;
for(int i=1;i<=t;i++){
memset(mat,'.',sizeof(mat));
cin>>n>>m>>k;
for(int i=0;i<m;i++){
for(int j=0;j<n;j++){
cin>>mat[i][j];
}
}
work1();
work2();
work3();
work4();
}
printf("%d:%d",xf,of);
}
WA了