using System.Collections.Generic;
public static void Main()
int n = int.Parse(Console.ReadLine());
Stack<int> st = new Stack<int>();
for (int i = 0; i < n; i++)
st.Push(int.Parse(Console.ReadLine()));
List<int> even = new List<int>();
List<int> odd = new List<int>();
Console.Write(string.Join(" ", even));
Console.Write(string.Join(" ", odd));