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.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); first.Add(first[0]); WriteLine(string.Join(" ", first)); } }