Five pirates are shipwrecked on a desert island. They quickly determine that the only other inhabitant of the island is a monkey and that the only food is coconuts. They set about collecting as many coconuts as they can and put them all in a pile. By nightfall they are too tired to divide the harvest, so they agree to go to sleep and divvy up the coconuts the next morning.

During the night one pirate awakens, suspicious that the others might try to cheat him, and decides to take his portion then and there and not wait until morning. He divides the coconuts into five piles and finds there is one coconut left over, which he gives to the monkey. He hides one of the five piles, then puts the rest of the nuts together and returns to sleep.

About an hour later a second pirate awakens with the same suspicions and does the same thing: he divides the coconuts into five piles, leaving one extra, which he gives to the monkey. Then he hides what he thinks is his share and goes back to sleep. One after another the rest of the pirates do the same: they each take one fifth of the coconuts in the pile (after giving the extra one to the monkey) and then return to sleep.

Monkeys and coconuts.

When the pirates awaken the next morning they all notice the coconut pile is much smaller than it was the night before. But since each man is as guilty as the others, no one says anything. They divide the coconuts for the sixth (and last) time, but this time there is no coconut left for the monkey.

How many coconuts were in the original pile?

Assignment

The answer to the above puzzle is 3121. You may look ahead to the first example below to check that this is indeed the correct answer. But what if there were six pirates, or seven, or thirty? What is the correct answer in those cases? In this assignment we check how $$n$$ coconuts can be divided among $$p$$ pirates, and how many coconuts are left for the monkey, if the pirates apply the procedure as outlined in the above puzzle.

Input

The input contains the number of pirates $$p$$ and the number of coconuts $$n$$ the pirates have initially collected, each on a separate line.

Output

For each pirate, output a single line that is formatted as:

a nut(s) = b nut(s) for pirate#n and c nut(s) for the monkey

This indicates the number of coconuts the pirate takes as his share during the night, and how many nuts he gives to the monkey. The fragments in italic need to be filled up with the following values:

Use the correct singular or plural form in outputting a number of coconuts:

number of coconuts is outputted as
0 nut(s) no nuts
1 nut(s) 1 nut
n nut(s) with $$n \geq 2$$ n nuts

Finally, another line needs to be outputted that indicates how the remaining coconuts are divided among the pirates and the monkey when morning breaks. This line needs to be formatted as:

each pirate gets d nut(s) and e nut(s) for the monkey

The fragments in italic need to be filled up with the following values:

Again, in outputting a number of coconuts, the correct singular or plural form must be taken into account as indicated in the above table.

Example

This example corresponds to the puzzle as given in the introduction.

Input:

5
3121

Output:

3121 nuts = 624 nuts for pirate#1 and 1 nut for the monkey
2496 nuts = 499 nuts for pirate#2 and 1 nut for the monkey
1996 nuts = 399 nuts for pirate#3 and 1 nut for the monkey
1596 nuts = 319 nuts for pirate#4 and 1 nut for the monkey
1276 nuts = 255 nuts for pirate#5 and 1 nut for the monkey
each pirate gets 204 nuts and no nuts for the monkey

Example

Input:

4
1234

Output:

1234 nuts = 308 nuts for pirate#1 and 2 nuts for the monkey
924 nuts = 231 nuts for pirate#2 and no nuts for the monkey
693 nuts = 173 nuts for pirate#3 and 1 nut for the monkey
519 nuts = 129 nuts for pirate#4 and 3 nuts for the monkey
each pirate gets 96 nuts and 3 nuts for the monkey

Epilogue

Resources