Banal Tickets

Time Limit: 10 Seconds    Memory Limit: 32768 KB

Peter is fond of number theory. That's why he is looking for interesting bus tickets.

Ticket with the number of length 2N is called interesting if the product of the first N digits of its number is equal to the product
of the last N digits. Other tickets are called banal.

Peter has found a used ticket in his pocket. Unfortunately the ticket was punched, so Peter cannot recognize some digits. He wonders whether this ticket was an interesting one. Moreover he wants to know how many different interesting and banal tickets could be punched to get this one.

Help Peter to find answers to his questions.

Input

The first line of the input contains an integer N (1 <= N <= 18). The next line contains a string representing the ticket number. If some digit is punched out it is denoted by "?"' otherwise it is denoted by itself.

Output

On the first line of the output print the number of interesting tickets. On the second line print the number of banal tickets.


This problem contains multiple test cases!

The first line of a multiple input is an integer N, then a blank line followed by N input blocks. Each input block is in the format indicated in the problem description. There is a blank line between input blocks.

The output format consists of N output blocks. There is a blank line between output blocks.

Sample Input

2
 
2
2??3

3
2?6??3

Sample Output

4
96

46
954
Submit

Source: Northeastern Europe 2003, Northern Subregion