Block Game#10557

Block Game

1 second
128 megabytes
Easy

Farmer John is trying to teach his cows to read by giving them a set of spelling boards typically used with preschoolers. Each board has a word and a corresponding image on each side. For example, one side might have the word '' along with a picture of a cat, while the other side might have the word '' along with a picture of a dog. When all the boards are lying on the ground, exactly words are visible. By flipping some of the boards over, a different set of words can be revealed.

To help the cows with their spelling, Farmer John wants to make a collection of wooden blocks, each embossed with a single letter of the alphabet. He wants to have enough blocks of each letter so that, regardless of which set of words is visible on the upward-facing sides of the boards, the cows can spell all of those words using the blocks.

For example, if n = 3 and the words '', '', and '' are facing upward, the cows would need at least one '' block, one '' block, one '' block, two '' blocks, two '' blocks, one '' block, and one '' block.

Please help Farmer John determine the minimum number of blocks for each letter of the alphabet that he needs to provide so that, regardless of which side of each board is facing upward, the cows can spell all visible words.

Input

The first line contains the integer n~(1 \le n \le 100).

The next lines each contain two words, representing the words on the two opposite sides of a board. Each word consists of at most lowercase letters.

Output

Print lines. The first line should contain the number of copies of the '' block needed. The next line should contain the number of '' blocks needed, and so on through ''.

Examples

In this example, there are n = 3 boards, giving 2^3 = 8 possible sets of upward-facing words:

fox dog car
fox dog bus
fox cat car
fox cat bus
box dog car
box dog bus
box cat car
box cat bus

We need enough blocks of each letter of the alphabet to spell all three words, regardless of which of these eight scenarios occurs.

Example 1

Loading
Loading