14716 - Odd and even separation   

Description

This program reads an integer n, followed by a sequence of n integers.
The task is to separate the numbers into odd and even numbers.

Output two lines:

  • The first line contains all odd numbers in the sequence, separated by spaces.

  • The second line contains all even numbers in the sequence, separated by spaces.

Input

  • The first line contains one integer n, where 0<n≤100.

  • The second line contains n integers.

Output

Two lines:

  • Line 1: all odd numbers separated by spaces. A space must also follow the last number, before the newline.

  • Line 2: all even numbers separated by spaces. A space must also follow the last number, before the newline.

Ensure that the output, including formatting, exactly matches the provided samples.

Sample Input  Download

Sample Output  Download

Tags

11410EE 231002



Discuss