uva245測資A

Input:
On the first day of Christmas
my true love sent to me:
A Partridge in a Pear Tree

18 18 second 18 18 18
18 18 18 18 18 18:
Two Turtle Doves
and 19 21 21 3 21 21

21 21 third 21 21 21
21 21 21 21 21 21:
Three French Hens
24 24 24
24 22 24 24 3 24 24

24 24 fourth 24 24 24
24 24 24 24 24 24:
Four Calling Birds*
27 27 27
27 27 27
27 25 27 27 3 27 27

27 27 fifth 27 27 27
27 27 27 27 27 27:
Five Golden Rings
30 30 30
30 30 30
30 30 30
30 28 30 30 3 30 30

30 30 sixth 30 30 30
30 30 30 30 30 30:
Six Geese 17 Laying
33 33 33
33 33 33
33 33 33
33 33 33
33 15 33 33 3 33 33

33 33 seventh 33 33 33
33 33 33 33 33 33:
Seven Swans 17 Swimming
36 36 4 36
36 36 36
36 36 36
36 36 36
36 36 36
36 15 36 36 3 36 36

36 36 eighth 36 36 36
36 36 36 36 36 36:
Eight Maids 17 Milking
39 39 4 39
39 39 4 39
39 39 39
39 39 39
39 39 39
39 39 39
39 15 39 39 3 39 39

39 39 ninth 39 39 39
39 39 39 39 39 39:
Nine Ladies Dancing
42 42 20 42
42 42 4 42
42 42 4 42
42 42 42
42 42 42
42 42 42
42 42 42
42 15 42 42 3 42 42

42 42 tenth 42 42 42
42 42 42 42 42 42:
Ten Lords 17 Leaping
45 45 45
45 45 7 45
45 45 4 45
45 45 4 45
45 45 45
45 45 45
45 45 45
45 45 45
45 15 45 45 3 45 45

45 45 eleventh 45 45 45
45 45 45 45 45 45:
Eleven Pipers Piping
48 48 20 48
48 48 48
48 48 7 48
48 48 4 48
48 48 4 48
48 48 48
48 48 48
48 48 48
48 48 48
48 15 48 48 3 48 48

48 48 twelfth 48 48 48
48 48 48 48 48 48:
twelve Drummers Drumming
51 51 51
51 51 23 51
51 51 51
51 51 7 51
51 51 4 51
51 51 4 51
51 51 51
51 51 51
51 51 51
51 51 51
51 15 51 51 3 51 51

0
Output:
On the first day of Christmas
my true love sent to me:
A Partridge in a Pear Tree

On the second day of Christmas
my true love sent to me:
Two Turtle Doves
and a Partridge in a Pear Tree

On the third day of Christmas
my true love sent to me:
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the fourth day of Christmas
my true love sent to me:
Four Calling Birds*
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the fifth day of Christmas
my true love sent to me:
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the sixth day of Christmas
my true love sent to me:
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the seventh day of Christmas
my true love sent to me:
Seven Swans a Swimming
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the eighth day of Christmas
my true love sent to me:
Eight Maids a Milking
Seven Swans a Swimming
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the ninth day of Christmas
my true love sent to me:
Nine Ladies Dancing
Eight Maids a Milking
Seven Swans a Swimming
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the tenth day of Christmas
my true love sent to me:
Ten Lords a Leaping
Nine Ladies Dancing
Eight Maids a Milking
Seven Swans a Swimming
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the eleventh day of Christmas
my true love sent to me:
Eleven Pipers Piping
Ten Lords a Leaping
Nine Ladies Dancing
Eight Maids a Milking
Seven Swans a Swimming
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree

On the twelfth day of Christmas
my true love sent to me:
twelve Drummers Drumming
Eleven Pipers Piping
Ten Lords a Leaping
Nine Ladies Dancing
Eight Maids a Milking
Seven Swans a Swimming
Six Geese a Laying
Five Golden Rings
Four Calling Birds
Three French Hens
Two Turtle Doves
and a Partridge in a Pear Tree