using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var a = NList; WriteLine(string.Join(" ", Work(n, a))); } static List Work(int n, int[] _a) { var a = _a.Select((ai, id) => (ai, id)).ToList(); a.Sort((l, r) => l.ai.CompareTo(r.ai)); var first = new List(); var second = new List(); for (var i = 0; i < n; ++i) { if (i % 2 == 0) first.Add(a[i].id + 1); else second.Add(a[i].id + 1); } second.Reverse(); first.AddRange(second); var pos = first.IndexOf(1); first = first.Skip(pos).Concat(first.Take(pos)).ToList(); first.Add(1); return first; } }