unittest
{
	assert( [ "5", "1 1 2 2" ].parse.expand.solve == "2\n2\n0\n0\n0" );
	assert( [ "10", "1 1 1 1 1 1 1 1 1" ].parse.expand.solve == "9\n0\n0\n0\n0\n0\n0\n0\n0\n0" );
	assert( [ "7", "1 2 3 4 5 6" ].parse.expand.solve == "1\n1\n1\n1\n1\n1\n0" );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	input.popFront;
	auto as = input.front.split.to!( long[] );
	as[] -= 1;
	return tuple( as );
}

auto solve( long[] as )
{
	auto anss = new long[ 1 + as.length ];
	foreach( a; as )
	{
		anss[ a ]++;
	}
	return anss.to!( string[] ).join( "\n" );
}
