- Time limit: 1.00 s
- Memory limit: 512 MB
Given an integer, your task is to find the number, sum and product of its divisors. As an example, let us consider the number :
- the number of divisors is (they are , , , , , )
- the sum of divisors is
- the product of divisors is
Since the input number may be large, it is given as a prime factorization.
Input
The first line has an integer : the number of parts in the prime factorization.
After this, there are lines that describe the factorization. Each line has two numbers and where is a prime and is its power.
Output
Print three integers modulo : the number, sum and product of the divisors.
Constraints
- each is a distinct prime
Example
Input:
2 2 2 3 1
Output:
6 28 1728