Back

Sorted Odds

Worth 4 point(s) - Runtime Limit: 1 seconds

Introduction

Given a list of integers, sort the odd numbers while leaving the even numbers in place.

Sample Input

Each test case consists of a line of space separated integers. Assume that none of the numbers will be negative and nonzero.

7 1 2 2 3 7 9 8
9 10 2 8 8 7 3 9 3
6 3 7 7 4
2 9 6 5 10 5 2 6 4
7 2 10 1 4 6 5

Sample Output

1 3 2 2 7 7 9 8
3 10 2 8 8 3 7 9 9
6 3 7 7 4
2 5 6 5 10 9 2 6 4
1 2 10 5 4 6 7