using System; using System.Linq; class Program { static void Main() { // Input the 10 numbers int[] beads = new int[10]; for (int i = 0; i < 10; i++) { beads[i] = int.Parse(Console.ReadLine()); } // Separate the even (blue) and odd (red) beads var blueBeads = beads.Where(x => x % 2 == 0).OrderBy(x => x).ToList(); var redBeads = beads.Where(x => x % 2 != 0).OrderBy(x => x).ToList(); // Combine blue beads (left) and red beads (right) var necklace = blueBeads.Concat(redBeads).ToList(); // Output the necklace Console.WriteLine(string.Join(" ", necklace)); } }