#C12325. Separate Evens and Odds
Separate Evens and Odds
Separate Evens and Odds
This problem requires you to separate a list of integers into two groups: even and odd numbers. Given an input of n integers, you need to maintain the original order and print all even numbers on the first line and all odd numbers on the second line.
An integer a is even if and only if $$a\mod 2 = 0$$; otherwise, it is odd. If there are no even or odd numbers, simply output a blank line for that group.
inputFormat
The first line contains an integer n representing the number of elements. The second line contains n space-separated integers.
outputFormat
Print two lines: the first line contains all even numbers separated by a single space, and the second line contains all odd numbers separated by a single space. If a group is empty, output an empty line for that group.
## sample6
1 2 3 4 5 6
2 4 6
1 3 5
</p>