import java.io.*;
import java.util.*;

public class parade_sm_greed2 {

    ArrayList<Integer> findMaxIncrease(int[] h, boolean eq) {
        int n = h.length;
        int[] maxLenInc = new int[n];
        int[] fromMaxLenInc = new int[n];
        int max = 0;
        int maxi = -1;
        for (int i = 0; i < n; i++) {
            maxLenInc[i] = 1;
            fromMaxLenInc[i] = -1;
            for (int j = 0; j < i; j++) {
                if (h[j] < h[i] && (maxLenInc[j] + 1 > maxLenInc[i] || (eq && maxLenInc[j] + 1 == maxLenInc[i]))) {
                    maxLenInc[i] = maxLenInc[j] + 1;
                    fromMaxLenInc[i] = j;
                }
            }
            if (maxLenInc[i] > max) {
                max = maxLenInc[i];
                maxi = i;
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        int x = maxi;
        while (x != -1) {
            ans.add(x);
            x = fromMaxLenInc[x];
        }
        Collections.reverse(ans);
        return ans;
    }


    ArrayList<Integer> findMaxDecrease(int[] h, boolean eq) {
        int n = h.length;
        int[] maxLenInc = new int[n];
        int[] fromMaxLenInc = new int[n];
        int max = 0;
        int maxi = -1;
        for (int i = 0; i < n; i++) {
            maxLenInc[i] = 1;
            fromMaxLenInc[i] = -1;
            for (int j = 0; j < i; j++) {
                if (h[j] > h[i] && (maxLenInc[j] + 1 > maxLenInc[i] || (eq && maxLenInc[j] + 1 == maxLenInc[i]))) {
                    maxLenInc[i] = maxLenInc[j] + 1;
                    fromMaxLenInc[i] = j;
                }
            }
            if (maxLenInc[i] > max) {
                max = maxLenInc[i];
                maxi = i;
            }
        }
        ArrayList<Integer> ans = new ArrayList<Integer>();
        int x = maxi;
        while (x != -1) {
            ans.add(x);
            x = fromMaxLenInc[x];
        }
        Collections.reverse(ans);
        return ans;
    }

    ArrayList<Integer> solveIncrease(int[] h, boolean eq) {
        ArrayList<Integer> ans = findMaxIncrease(h, eq);
        ArrayList<Integer> oth = negate(ans, h.length);
        for (int i = 1; i < oth.size(); i++) {
            if (h[oth.get(i - 1)] <= h[oth.get(i)]) {
                return null;
            }
        }
        return ans;
    }

    ArrayList<Integer> solveDecrease(int[] h, boolean eq) {
        ArrayList<Integer> ans = findMaxDecrease(h, eq);
        ArrayList<Integer> oth = negate(ans, h.length);
        for (int i = 1; i < oth.size(); i++) {
            if (h[oth.get(i - 1)] >= h[oth.get(i)]) {
                return null;
            }
        }
        return oth;
    }


    void solve() {
        int n = in.nextInt();
        in.nextLine();
        assert 1 <= n && n <= 100000;
        int[] h = new int[n];
        for (int i = 0; i < h.length; i++) {
            h[i] = in.nextInt();
            assert 1 <= h[i] && h[i] <= 1e9;
        }

        for (boolean eq : new boolean[]{true, false}) {
            ArrayList<Integer> ans = solveIncrease(h, eq);
            if (ans != null) {
                if (ans.size() == n) {
                    ans.remove(0);
                }
                out.println(ans.size());
                for (int i : ans) {
                    out.print((i + 1) + " ");
                }
                return;
            }
        }
        for (boolean eq : new boolean[]{true, false}) {
            ArrayList<Integer> ans = solveDecrease(h, eq);
            if (ans != null) {
                if (ans.size() == n) {
                    ans.remove(0);
                }
                out.println(ans.size());
                for (int i : ans) {
                    out.print((i + 1) + " ");
                }
                return;
            }
        }
        out.println("Impossible");
    }

    ArrayList<Integer> negate(Collection<Integer> col, int max) {
        TreeSet<Integer> ts = new TreeSet<Integer>();
        for (int i = 0; i < max; i++) {
            ts.add(i);
        }
        ts.removeAll(col);
        return new ArrayList<Integer>(ts);
    }

    boolean check(int[] h, int mask, int sign) {
        int prev = -1;
        for (int i = 0; i < h.length; i++) {
            if ((mask & (1 << i)) > 0) {
                if (prev != -1) {
                    if (h[prev] * sign >= h[i] * sign) {
                        return false;
                    }
                }
                prev = i;
            }
        }
        return true;
    }


    Scanner in;
    PrintWriter out;

    void run() throws IOException {
        in = new Scanner(new File("parade.in"));
        out = new PrintWriter("parade.out");
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new parade_sm_greed2().run();
    }


//----------------- just for validation ------------------

    /**
     * Strict scanner to veryfy 100% correspondence between input files and input file format specification.
     * It is a drop-in replacement for {@link java.util.Scanner} that could be added to a soulution source
     * (cut-and-paste) without breaking its ability to work with {@link java.util.Scanner}.
     */
    private static class Scanner {
        private final BufferedReader in;
        private String line = "";
        private int pos;
        private int lineNo;
        private boolean localeset;

        public Scanner(File source) throws FileNotFoundException {
            in = new BufferedReader(new FileReader(source));
            nextLine();
        }

        public Scanner(InputStream inputStream) throws FileNotFoundException {
            in = new BufferedReader(new InputStreamReader(inputStream));
            nextLine();
        }

        public void close() {
            assert line == null : "Extra data at the end of file";
            try {
                in.close();
            } catch (IOException e) {
                throw new AssertionError("Failed to close with " + e);
            }
        }

        public void nextLine() {
            assert line != null : "EOF";
            assert pos == line.length() : "Extra characters on line " + lineNo;
            try {
                line = in.readLine();
            } catch (IOException e) {
                throw new AssertionError("Failed to read line with " + e);
            }
            pos = 0;
            lineNo++;
        }

        public String next() {
            assert line != null : "EOF";
            assert line.length() > 0 : "Empty line " + lineNo;
            if (pos == 0)
                assert line.charAt(0) > ' ' : "Line " + lineNo + " starts with whitespace";
            else {
                assert pos < line.length() : "Line " + lineNo + " is over";
                assert line.charAt(pos) == ' ' : "Wrong whitespace on line " + lineNo;
                pos++;
                assert pos < line.length() : "Line " + lineNo + " is over";
                assert line.charAt(0) > ' ' : "Line " + lineNo + " has double whitespace";
            }
            StringBuilder sb = new StringBuilder();
            while (pos < line.length() && line.charAt(pos) > ' ')
                sb.append(line.charAt(pos++));
            return sb.toString();
        }

        public int nextInt() {
            String s = next();
            assert s.length() == 1 || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
            assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
            try {
                return Integer.parseInt(s);
            } catch (NumberFormatException e) {
                throw new AssertionError("Malformed number " + s + " on line " + lineNo);
            }
        }

        public long nextLong() {
            String s = next();
            assert s.length() == 1 || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
            assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
            try {
                return Long.parseLong(s);
            } catch (NumberFormatException e) {
                throw new AssertionError("Malformed number " + s + " on line " + lineNo);
            }
        }

        public double nextDouble() {
            assert localeset : "Locale must be set with useLocale(Locale.US)";
            String s = next();
            assert s.length() == 1 || s.startsWith("0.") || s.charAt(0) != '0' : "Extra leading zero in number " + s + " on line " + lineNo;
            assert s.charAt(0) != '+' : "Extra leading '+' in number " + s + " on line " + lineNo;
            // at most two digits
            assert s.indexOf('.') < 0 || s.indexOf('.') >= s.length() - 3;
            try {
                return Double.parseDouble(s);
            } catch (NumberFormatException e) {
                throw new AssertionError("Malformed number " + s + " on line " + lineNo);
            }
        }

        public void useLocale(Locale locale) {
            assert locale == Locale.US;
            localeset = true;
        }
    }

}
