func_code_string: #include <bits/stdc++.h>   using namespace std;   void fre() {     freopen( c://test//input.in ,  r , stdin);     freopen( c://test//output.out ,  w , stdout);   }   template <class T1, class T2>   inline void gmax(T1 &a, T2 b) {     if (b > a) a = b;   }   template <class T1, class T2>   inline void gmin(T1 &a, T2 b) {     if (b < a) a = b;   }   const int N = 1010, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;   int n;   int a[N], b[N];   int main() {     while (~scanf( %d , &n)) {       for (int i = 1; i <= n; ++i) scanf( %d , &a[i]);       sort(a + 1, a + n + 1);       int p = 1;       for (int i = 1; i <= n; i += 2) {         b[i] = a[p++];       }       for (int i = 2; i <= n; i += 2) {         b[i] = a[p++];       }       bool flag = 1;       for (int i = 1; i <= n; i += 2) {         if (i < n) {           if (b[i] > b[i + 1]) flag = 0;         }         if (i > 1) {           if (b[i] > b[i - 1]) flag = 0;         }       }       if (!flag)         puts( Impossible );       else {         for (int i = 1; i <= n; ++i) printf( %d  , b[i]);         puts(  );       }     }     return 0;   }   