Combines all items

For each line that starts with the same number I want to combine its contents

Input

1 2472
1 664
2 2600
10 4135
10 5606
...

Output

1 2472 664
2 2600
10 4135 5606
...