【POJ】[1409]

Description

Input

Output

Sample Input

Sample Output