Language: C++

import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
import std.math, std.random, std.bigint, std.datetime, std.format;
void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); } bool DEBUG = 0; 
void log(A ...)(lazy A a){ if(DEBUG) print(a); }
void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
string unsplit(T)(T xs){ return xs.array.to!(string[]).join(" "); }
string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
T scan(T)(){ return scan.to!T; } T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
T lowerTo(T)(ref T x, T y){ if(x > y) x = y; return x; } T raiseTo(T)(ref T x, T y){ if(x < y) x = y; return x; }

// ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- //

void solve(){
  int n = scan!int;
  int m = scan!int;
  int[] as = scan!int(m);
  
  int[] odds, evens;
  foreach(a; as) if(a % 2) odds ~= a; else evens ~= a;
  
  if(odds.length > 2){
    "Impossible".writeln;
    return;
  }
  
  int[] ans, bns;
  if(odds.length == 0){
    ans = evens;
    foreach(a; evens) bns ~= a;
    bns[0] -= 1;
    bns ~= 1;
  }
  else if(odds.length == 1){
    ans = odds ~ evens;
    foreach(a; evens) bns ~= a;
    if(bns.length) bns[0] += odds[0] - 1;
    else if(odds[0] > 1) bns ~= odds[0] - 1;
    else{ "Impossible".writeln; return; }
    bns ~= 1;
  }
  else if(odds.length == 2){
    ans = [odds[0]] ~ evens ~ odds[1];
    foreach(a; evens) bns ~= a;
    if(bns.length) bns[0] += odds[0] - 1;
    else if(odds[0] > 1) bns ~= odds[0] - 1;
    bns ~= odds[1] + 1;
  }
  
  print(ans.unsplit);
  print(bns.length);
  print(bns.unsplit);
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import std.stdio, std.conv, std.string, std.array, std.range, std.algorithm, std.container;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import std.math, std.random, std.bigint, std.datetime, std.format;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:6: error: variable or field 'main' declared void
    3 | void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); } bool DEBUG = 0;
      |      ^~~~
a.cc:3:11: error: 'string' was not declared in this scope
    3 | void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); } bool DEBUG = 0;
      |           ^~~~~~
a.cc:3:18: error: expected primary-expression before ']' token
    3 | void main(string[] args){ if(args.length > 1) if(args[1] == "-debug") DEBUG = 1; solve(); } bool DEBUG = 0;
      |                  ^
a.cc:4:6: error: variable or field 'log' declared void
    4 | void log(A ...)(lazy A a){ if(DEBUG) print(a); }
      |      ^~~
a.cc:4:10: error: 'A' was not declared in this scope
    4 | void log(A ...)(lazy A a){ if(DEBUG) print(a); }
      |          ^
a.cc: In function 'void print()':
a.cc:5:15: error: 'writeln' was not declared in this scope
    5 | void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
      |               ^~~~~~~
a.cc: At global scope:
a.cc:5:35: error: variable or field 'print' declared void
    5 | void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
      |                                   ^~~~~
a.cc:5:41: error: 'T' was not declared in this scope
    5 | void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
      |                                         ^
a.cc:5:69: error: variable or field 'print' declared void
    5 | void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
      |                                                                     ^~~~~
a.cc:5:75: error: 'T' was not declared in this scope
    5 | void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
      |                                                                           ^
a.cc:5:78: error: 'A' was not declared in this scope
    5 | void print(){ writeln(""); } void print(T)(T t){ writeln(t); } void print(T, A ...)(T t, A a){ write(t, " "), print(a); }
      |                                                                              ^
a.cc:6:1: error: 'string' does not name a type
    6 | string unsplit(T)(T xs){ return xs.array.to!(string[]).join(" "); }
      | ^~~~~~
a.cc:7:1: error: 'string' does not name a type
    7 | string scan(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
      | ^~~~~~
a.cc:8:1: error: 'T' does not name a type
    8 | T scan(T)(){ return scan.to!T; } T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
      | ^
a.cc:8:34: error: 'T' does not name a type
    8 | T scan(T)(){ return scan.to!T; } T[] scan(T)(int n){ return n.iota.map!(i => scan!T()).array; }
      |                                  ^
a.cc:9:1: error: 'T' does not name a type
    9 | T lowerTo(T)(ref T x, T y){ if(x > y) x = y; return x; } T raiseTo(T)(ref T x, T y){ if(x < y) x = y; return x; }
      | ^
a.cc:9:58: error: 'T' does not name a type
    9 | T lowerTo(T)(ref T x, T y){ if(x > y) x = y; return x; } T raiseTo(T)(ref T x, T y){ if(x < y) x = y; return x; }
      |                                                          ^
a.cc: In function 'void solve()':
a.cc:14:11: error: 'scan' was not declared in this scope
   14 |   int n = scan!int;
      |           ^~~~
a.cc:16:6: error: structured binding declaration cannot have type 'int'
   16 |   int[] as = scan!int(m);
      |      ^~
a.cc:16:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:16:6: error: empty structured binding declaration
a.cc:16:9: error: expected initializer before 'as'
   16 |   int[] as = scan!int(m);
      |         ^~
a.cc:18:6: error: structured binding declaration cannot have type 'int'
   18 |   int[] odds, evens;
      |      ^~
a.cc:18:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:18:6: error: empty structured binding declaration
a.cc:18:9: error: expected initializer before 'odds'
   18 |   int[] odds, evens;
      |         ^~~~
a.cc:19:11: error: 'a' was not declared in this scope
   19 |   foreach(a; as) if(a % 2) odds ~= a; else evens ~= a;
      |           ^
a.cc:19:14: error: 'as' was not declared in this scope
   19 |   foreach(a; as) if(a % 2) odds ~= a; else evens ~= a;
      |              ^~
a.cc:19:39: error: 'else' without a previous 'if'
   19 |   foreach(a; as) if(a % 2) odds ~= a; else evens ~= a;
      |                                       ^~~~
a.cc:19:44: error: 'evens' was not declared in this scope
   19 |   foreach(a; as) if(a % 2) odds ~= a; else evens ~= a;
      |                                            ^~~~~
a.cc:21:6: error: 'odds' was not declared in this scope
   21 |   if(odds.length > 2){
      |      ^~~~
a.cc:22:18: error: request for member 'writeln' in '"Impossible"', which is of non-class type 'const char [11]'
   22 |     "Impossible".writeln;
      |                  ^~~~~~~
a.cc:26:6: error: structured binding declaration cannot have type 'int'
   26 |   int[] ans, bns;
      |      ^~
a.cc:26:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:26:6: error: empty structured binding declaration
a.cc:26:9: error: expected initializer before 'ans'
   26 |   int[] ans, bns;
      |         ^~~
a.cc:27:6: error: 'odds' was not declared in this scope
   27 |   if(odds.length == 0){
      |      ^~~~
a.cc:28:5: error: 'ans' was not declared in this scope
   28 |     ans = evens;
      |     ^~~
a.cc:29:14: error: expected ')' before ';' token
   29 |     foreach(a; evens) bns ~= a;
      |            ~ ^
      |              )
a.cc:29:21: error: expected ';' before ')' token
   29 |     foreach(a; evens) bns ~= a;
      |                     ^
      |                     ;
a.cc:30:5: error: 'bns' was not declared in this scope
   30 |     bns[0] -= 1;
      |     ^~~
a.cc:31:8: error: expected ';' before '~' token
   31 |     bns ~= 1;
      |        ^~
      |        ;
a.cc:34:5: error: 'ans' was not declared in this scope
   34 |     ans = odds ~ evens;
      |     ^~~
a.cc:35:14: error: expected ')' before ';' token
   35 |     foreach(a; evens) bns ~= a;
      |            ~ ^
      |              )
a.cc:35:21: error: expected ';' before ')' token
   35 |     foreach(a; evens) bns ~= a;
      |                     ^
      |                     ;
a.cc:36:8: error: 'bns' was not declared in this scope
   36 |     if(bns.length) bns[0] += odds[0] - 1;
      |        ^~~
a.cc:37:29: error: expected ';' before '~' token
   37 |     else if(odds[0] > 1) bns ~= odds[0] - 1;
      |                             ^~
      |                             ;
a.cc:38:24: error: request for member 'writeln' in '"Impossible"', which is of non-class type 'const char [11]'
   38 |     else{ "Impossible".writeln; return; }
      |                        ^~~~~~~
a.cc:39:5: error: 'bns' was not declared in this scope
   39 |     bns ~= 1;
      |     ^~~
a.cc:42:5: error: 'ans' was not declared in this scope
   42 |     ans = [odds[0]] ~ evens ~ odds[1];
      |     ^~~
a.cc:42:16: error: expected ',' before '[' token
   42 |     ans = [odds[0]] ~ evens ~ odds[1];
      |                ^
      |                ,
a.cc:42:16: error: expected identifier before '[' token
a.cc: In lambda function:
a.cc:42:21: error: expected '{' before '~' token
   42 |     ans = [odds[0]] ~ evens ~ odds[1];
      |                     ^
a.cc: In function 'void solve()':
a.cc:43:14: error: expected ')' before ';' token
   43 |     foreach(a; evens) bns ~= a;
      |            ~ ^
      |              )
a.cc:43:21: error: expected ';' before ')' token
   43 |     foreach(a; evens) bns ~= a;
      |                     ^
      |                     ;
a.cc:44:8: error: 'bns' was not declared in this scope
   44 |     if(bns.length) bns[0] += odds[0] - 1;
      |        ^~~
a.cc:45:29: error: expected ';' before '~' token
   45 |     else if(odds[0] > 1) bns ~= odds[0] - 1;
      |                             ^~
      |                             ;
a.cc:46:5: error: 'bns' was not declared in this scope
   46 |     bns ~= odds[1] + 1;
      |     ^~~
a.cc:49:9: error: 'ans' was not declared in this scope
   49 |   print(ans.unsplit);
      |         ^~~
a.cc:50:9: error: 'bns' was not declared in this scope
   50 |   print(bns.length);
      |         ^~~