#include <iomanip>
#include <utility>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <iostream>
using namespace std;


bool mani(int a[12], int n)
{
	int b[12];
	fill(b, b + 12, 0);
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			if (a[i] == a[j])
				b[i]++;
	bool f = true;
	for (int i = 0; i < n; i++)
	{
		if (a[i] != b[i])
		{
			f = false;
			break;
		}
	}
	for (int i = 0; i < n; i++)
		a[i] = b[i];
	return f;
}