#include #include #include #include #include #include #define MAX(x, y) ((x < y) ? y : x) #define MIN(x, y) ((x < y) ? x : y) typedef long long ll; typedef unsigned char byte; FILE* in = fopen("add.in", "rt"); FILE* out = fopen("add.out", "wt"); #define MAXN 1024 #define MAXM 1000004 int arr[1024]; int main() { int n, m; fscanf(in, "%d%d", &n, &m); for (int i = 0; i < n; ++i) fscanf(in, "%d", &arr[i]); int cnt = 0; for (int i = 0; i < n; ++i) { for (int j = i + 1; j < n; ++j) { if (arr[i] > arr[j]) ++cnt; } } if (cnt > m) { fprintf(out, "Impossible\n"); } else { arr[n] = n + 1; for (int i = n - 1; i >= 0; --i) { if (cnt < m) { std::swap(arr[i], arr[i + 1]); ++cnt; } } for (int i = 0; i <= n; ++i) { fprintf(out, "%d ", arr[i]); } fprintf(out, "\n"); } return 0; }