#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0;
  cin >> n;
  int m = 0;
  cin >> m;
  if (n == 4) {
    cout << -1;
    return 0;
  }
  if (m < n + 1) {
    cout << -1;
    return 0;
  }
  map<int, int> mapping;
  vector<int> used(n + 1, 0);
  set<int> unused;
  for (int j = 0; j < n; j++) unused.insert(j);
  for (int j = 0; j < 4; j++) {
    int x = 0;
    cin >> x;
    used[x] = 1;
    mapping[*(unused.begin())] = x;
    unused.erase(unused.begin());
  }
  for (int j = 1; j <= n; ++j) {
    if (used[j] == 0) {
      mapping[*(unused.begin())] = j;
      unused.erase(unused.begin());
    }
  }
  cout << mapping[0] << " " << mapping[2] << " " << mapping[4] << " ";
  for (int j = 5; j < n; j++) cout << mapping[j] << " ";
  cout << mapping[3] << " " << mapping[1] << endl;
  cout << mapping[2] << " " << mapping[0] << " " << mapping[4] << " ";
  for (int j = 5; j < n; j++) cout << mapping[j] << " ";
  cout << mapping[1] << " " << mapping[3] << endl;
  return 0;
}
