#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

enum Type{
	Hidarishita,
	Mashita,
	Migishita,
};

struct Info{
	bool operator<(const struct Info &arg) const{
		return S < arg.S;
	}
	int S,num;
};

char table[1000][81];
bool check[1000][81];
int width[1000];
int test_case = 0;
int H;
int diff_row[3] = {1,1,1},diff_col[3] = {-1,0,1};
Type type_array[3] = {Hidarishita,Mashita,Migishita};

bool rangeCheck(int row,int col){

	if(row < 0 || row >= H)return false;

	if(col < 0 || col >= width[row])return false;

	return true;
}


void func(){

	if(test_case != 0){
		printf("----------\n");
	}
	test_case++;

	getchar();

	int length;
	for(int row = 0; row < H; row++){
		fgets(table[row],80,stdin);
		for(length = 0; table[row][length] != '\0' && table[row][length] != '\n'; length++){
			check[row][length] = false;
		}
		width[row] = length;
	}

	vector<Info> V;

	int jyoutei,katei,height,tmp_S;
	int adj_row,adj_col,hidarishita_col,migishita_col;
	Type dir;

	bool FLG;

	for(int row = 0; row < H; row++){
		for(int col = 0; table[row][col] != '\0'; col++){
			if(table[row][col] != '*' || check[row][col] == true)continue;

			jyoutei = 0,katei = 0,height = 0;

			for(int tmp_col = col; table[row][tmp_col] == '*';tmp_col++){
				check[row][tmp_col] = true;
				jyoutei++;
			}

			for(int i = 0; i < 3; i++){
				adj_row = row + diff_row[i];
				adj_col = col + diff_col[i];

				if(!rangeCheck(adj_row,adj_col))continue;

				if(table[adj_row][adj_col] == '*' && check[adj_row][adj_col] == false){
					dir = type_array[i];
					break;
				}
			}

			for(int tmp_row = row,tmp_col = col;rangeCheck(tmp_row,tmp_col) == true && table[tmp_row][tmp_col] == '*';tmp_row += diff_row[dir],tmp_col+=diff_col[dir]){
				check[tmp_row][tmp_col] = true;
				height++;
				hidarishita_col = tmp_col;
			}

			for(int i = 0; i < 3; i++){
				adj_row = row + diff_row[i];
				adj_col = (col+jyoutei-1) + diff_col[i];

				if(!rangeCheck(adj_row,adj_col))continue;

				if(table[adj_row][adj_col] == '*' && check[adj_row][adj_col] == false){
					dir = type_array[i];
					break;
				}
			}

			for(int tmp_row = row,tmp_col = col+jyoutei-1;rangeCheck(tmp_row,tmp_col) == true && table[tmp_row][tmp_col] == '*';tmp_row += diff_row[dir],tmp_col+=diff_col[dir]){
				check[tmp_row][tmp_col] = true;
				migishita_col = tmp_col;
			}

			katei = migishita_col-hidarishita_col+1;

			for(int tmp_row = row+height-1,tmp_col = hidarishita_col; tmp_col <= migishita_col; tmp_col++)check[tmp_row][tmp_col] = true;

			tmp_S = ((jyoutei+katei)*height)/2;

			FLG = true;

			for(int i = 0; i < V.size(); i++){
				if(V[i].S == tmp_S){
					V[i].num++;
					FLG = false;
					break;
				}
			}

			if(FLG){
				Info new_info;
				new_info.S = tmp_S;
				new_info.num = 1;
				V.push_back(new_info);
			}
		}
	}

	sort(V.begin(),V.end());

	for(int i = 0; i < V.size(); i++){
		printf("%d %d\n",V[i].S,V[i].num);
	}
}

int main(){

	while(true){
		scanf("%d",&H);
		if(H == 0)break;

		func();
	}

	return 0;
}

Measured memory_bytes: 3224