uses
  Math;

const
  inf = 2000000000;
  maxn = 100000;
  maxv = 1000000000;

var
  n, i, cnt, pos : integer;
  lasta, lastb, x, a, b : array[0..maxn] of integer;
  used : array[0..maxn] of boolean;

begin
  reset(input, 'parade.in');
  rewrite(output, 'parade.out');
  read(n);
  assert((1 <= n) and (n <= maxn));
  for i := 1 to n do begin
    read(x[i]);
    assert((1 <= x[i]) and (x[i] <= maxv));
    a[i] := -1;
    b[i] := inf;
  end;
  if (n = 1) then begin
    writeln('Impossible');
    halt;
  end;
  a[0] := inf;
  b[0] := -1;
  lasta[0] := 0;
  lastb[0] := 0;
  for i := 1 to n do begin
    if (i = 1) or (x[i] > x[i - 1]) then begin
      a[i] := a[i - 1];
      lasta[i] := lasta[i - 1];
    end;
    if (i > 0) and (x[i] > b[i - 1]) and (x[i - 1] > a[i]) then begin
      a[i] := x[i - 1];
      lasta[i] := i - 1;
    end;
    if (i = 1) or (x[i] < x[i - 1]) then begin
      b[i] := b[i - 1];
      lastb[i] := lastb[i - 1];
    end;
    if (i > 0) and (x[i] < a[i - 1]) and (x[i - 1] < b[i]) then begin
      b[i] := x[i - 1];
      lastb[i] := i - 1;
    end;
  end;
  if (a[n] = -1) and (b[n] = inf) then begin
    writeln('Impossible');
    halt(0);
  end;
  cnt := 0;
  pos := n;
  while (pos > 0) and (a[pos] = -1) do
    pos := pos - 1;
  while (pos > 0) do begin
    i := lasta[pos];
    while (pos > i) do begin
      cnt := cnt + 1;
      used[pos] := true;
      pos := pos - 1;
    end;
    i := lastb[pos];
    while (pos > i) do begin
      pos := pos - 1;
    end;
  end;
  if (cnt = 0) then begin
    cnt := 1;
    used[1] := true;
  end;
  if (cnt = n) then begin
    cnt := cnt - 1;
    used[1] := false;
  end;
  writeln(cnt);
  for i := 1 to n do
    if (used[i]) then
      write(i, ' ');
end.