import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author El-Bishoy
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        Div2B1238_killEmAll_t_distances_on_line solver = new Div2B1238_killEmAll_t_distances_on_line();
        solver.solve(1, in, out);
        out.close();
    }

    static class Div2B1238_killEmAll_t_distances_on_line {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            int q = in.nextInt();
            while (q-- > 0) {

                int n = in.nextInt();
                int d = in.nextInt();
                int[] arr = in.nextIntArray(n);
                Arrays.sort(arr);

                int ans = 0;
                int acc = 0;
                int prev = -1;
                for (int i = n - 1; i >= 0; i--) {

                    if (arr[i] - acc > 0 && arr[i] != prev) {
                        ans++;
                        prev = arr[i];
                        acc += d;
                    }

                }

                out.println(ans);
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; ++i) array[i] = nextInt();
            return array;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }
}


/**

©PizzaPings

 */

import java.io.*;
import java.util.*;
import java.util.Map.*;
import java.math.*;

public class q2
{
    static int MOD=1000000007;

    static int xorPairCount(int arr[], int n, int x)
{
    int result = 0; // Initialize result

    // create empty map that stores counts of
    // individual elements of array.
    Map<Integer,Integer> m = new HashMap<>();

    for (int i = 0;  i < n ; i++)
    {
        int curr_xor = x^arr[i];

        // If there exist an element in map m
        // with XOR equals to x^arr[i], that means
        // there exist an element such that the
        // XOR of element with arr[i] is equal to
        // x, then increment count.
        if (m.containsKey(curr_xor))
            result += m.get(curr_xor);

        // Increment count of current element
        if(m.containsKey(arr[i]))
        {
            m.put(arr[i], m.get(arr[i]) + 1);
        }
        else{
            m.put(arr[i], 1);
        }
    }
    // return total count of pairs with XOR equal to x
    return result;
}
    public static void main(String[] args) throws IOException
    {
       Scanner sc=new Scanner(System.in);
       int T=sc.nextInt();
       //int T=1;
       int flag=1;
       while(T-- > 0){
       int N=sc.nextInt();
       int r=sc.nextInt();
       int a[]=new int[N];
       HashSet<Integer> hs=new HashSet<Integer>();
       for(int i=0;i<N;++i){
         a[i]=sc.nextInt();
         if(!hs.contains(a[i]))
            hs.add(a[i]);
       }
       Integer b[]=hs.toArray(new Integer[hs.size()]);
       Arrays.sort(b);
       int k=hs.size()-2;
       int count=1;
       while(k>=0 && (b[k]-(count*r)) > 0){
        count++;
        k=k-1;
       }
       System.out.println(count);

       }//tt

    }//end of main function

} //end of class q1


/**

©PizzaPings

 */

import java.io.*;
import java.util.*;
import java.util.Map.*;
import java.math.*;

public class q2
{
    static int MOD=1000000007;

    static int xorPairCount(int arr[], int n, int x)
{
    int result = 0; // Initialize result

    // create empty map that stores counts of
    // individual elements of array.
    Map<Integer,Integer> m = new HashMap<>();

    for (int i = 0;  i < n ; i++)
    {
        int curr_xor = x^arr[i];

        // If there exist an element in map m
        // with XOR equals to x^arr[i], that means
        // there exist an element such that the
        // XOR of element with arr[i] is equal to
        // x, then increment count.
        if (m.containsKey(curr_xor))
            result += m.get(curr_xor);

        // Increment count of current element
        if(m.containsKey(arr[i]))
        {
            m.put(arr[i], m.get(arr[i]) + 1);
        }
        else{
            m.put(arr[i], 1);
        }
    }
    // return total count of pairs with XOR equal to x
    return result;
}
    public static void main(String[] args) throws IOException
    {
       Scanner sc=new Scanner(System.in);
       int T=sc.nextInt();
       //int T=1;
       int flag=1;
       while(T-- > 0){
       int N=sc.nextInt();
       int r=sc.nextInt();
       int a[]=new int[N];
       HashSet<Integer> hs=new HashSet<Integer>();
       for(int i=0;i<N;++i){
         a[i]=sc.nextInt();
         if(!hs.contains(a[i]))
            hs.add(a[i]);
       }
       Integer b[]=hs.toArray(new Integer[hs.size()]);
       int k=hs.size()-2;
       int count=1;
       while(k>=0 && (b[k]-(count*r)) > 0){
        count++;
        k=k-1;
       }
       System.out.println(count);

       }//tt

    }//end of main function

} //end of class q1


import java.io.*;
import java.util.*;
import java.util.Map.*;
import java.math.*;
//import java.lang.*;

public class ANGGRA
{
	static long M=1000000007;
    InputStream is;
	PrintWriter out;
	String INPUT = "";

    public static long C(int n, int r, int mod, int[][] fif) {
		if (n < 0 || r < 0 || r > n)
			return 0;
		return (long) fif[0][n] * fif[1][r] % mod * fif[1][n - r] % mod;
	}

	public static int[][] enumFIF(int n, int mod) {
		int[] f = new int[n + 1];
		int[] invf = new int[n + 1];
		f[0] = 1;
		for (int i = 1; i <= n; i++) {
			f[i] = (int) ((long) f[i - 1] * i % mod);
		}
		long a = f[n];
		long b = mod;
		long p = 1, q = 0;
		while (b > 0) {
			long c = a / b;
			long d;
			d = a;
			a = b;
			b = d % b;
			d = p;
			p = q;
			q = d - c * q;
		}
		invf[n] = (int) (p < 0 ? p + mod : p);
		for (int i = n - 1; i >= 0; i--) {
			invf[i] = (int) ((long) invf[i + 1] * (i + 1) % mod);
		}
		return new int[][] { f, invf };
	}

	void run() throws Exception
	{
		is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");
	}

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

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }

    public static Set<Character> stringToCharacterSet(String s) {
		Set<Character> set = new HashSet<>();
		for (char c : s.toCharArray()) {
			set.add(c);
		}
		return set;
	}

	public static boolean containsAllChars
		(String container, String containee) {
		return stringToCharacterSet(container).containsAll
				   (stringToCharacterSet(containee));
	}
	static long sum1(long n){
        return ((n)*((n+1)))/2L;
    }
    static long sum2(long n){
        return (((((n)*((n+1))))*((2*(n))+1)))/6L;
    }
    static long sum3(long n){
        return ((((n)*(n))*((((n+1))*((n+1))))))/4L;
    }
    static long sum4(long n){
        return (((((((n)*((n+1))))*(((2*n)+1)))) * (((((3*(n))*(n)))+((3*n)) - 1))))/30L;
    }

    public void solve()
    {
       //Scanner sc=new Scanner(System.in);
       int T=ni();
    //   int T=1;
       //br = new BufferedReader(new InputStreamReader(System.in));
       while(T-- > 0){
        long sum=0;
        int N=ni();
       	int r=ni();
		   int a[]=new int[N];
		   HashSet<Integer> hs=new HashSet<Integer>();
		   for(int i=0;i<N;++i){
			 a[i]=ni();
			 if(!hs.contains(a[i]))
				hs.add(a[i]);
		   }
		   Integer b[]=hs.toArray(new Integer[hs.size()]);
		   Arrays.sort(b);
		   int k=hs.size()-2;
		   int count=1;
		   while(k>=0 && (b[k]-(count*r)) > 0){
			count++;
			k=k-1;
		   }
		   System.out.println(count);

       }

    }//end of main function

} //end of class q1


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

public class ProblemB_2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int q = in.nextInt();
        for(int i = 0; i < q; i++) {
            int n = in.nextInt();
            int r = in.nextInt();
            //int[] a = new int[n];

            out.println(new Solver().solve(n, r, in));
        }
        out.close();
    }
}
class Solver {
    int solve(int n, int r, Scanner in) {
        TreeSet<Integer> set = new TreeSet<>(Collections.reverseOrder());
        for (int j = 0; j < n; j++) {
            set.add(in.nextInt());
        }

        int ans = 0, offset = 0;
        for(int element : set) {
            if (element - offset > 0) {
                ans++;
                offset += r;
            } else {
                break;
            }
        }
        return ans;
    }
}


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

public class ProblemB_3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int q = in.nextInt();
        StringBuilder s = new StringBuilder();
        for(int i = 0; i < q; i++) {
            int n = in.nextInt();
            int r = in.nextInt();
            int[] a = new int[n];
            for (int j = 0; j < n; j++) {
                a[j] = in.nextInt();
            }
            s.append(new Solver3().solve(n, r, a)).append("\n");
        }
        out.print(s);
        out.close();
    }
}
class Solver3 {
    int solve(int n, int r, int[] a) {
        TreeSet<Integer> set = new TreeSet<>(Collections.reverseOrder());
        for (int j = 0; j < n; j++) {
            set.add(a[j]);
        }
        int ans = 0, offset = 0;
        for(int element : set) {
            if (element - offset > 0) {
                ans++;
                offset += r;
            } else {
                break;
            }
        }
        return ans;
    }
}


import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author s162111
 */
public class ProblemB {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int q = sc.nextInt();
        for(int i=0; i<q; i++){
            int n = sc.nextInt();
            int r = sc.nextInt();

            ArrayList<Integer> monsters = new ArrayList<>();
            for(int j=0; j<n; j++){
                int num = sc.nextInt();
                if(!monsters.contains(num)){
                    monsters.add(num);
                }
            }

            Collections.sort(monsters);
            int c = 0;

            boolean finished = false;

            for(int j = 1; j<monsters.size();j++){
                if(monsters.size()-j-1<0){
                    break;
                }
                if (monsters.get(monsters.size()-j-1)<=j*r){
                    System.out.println(j);
                    break;
                }
            }

        }

    }
}


import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author s162111
 */
public class ProblemB {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int q = sc.nextInt();
        for(int i=0; i<q; i++){
            int n = sc.nextInt();
            int r = sc.nextInt();

            int max = 1;

            int[] monsters = new int[n];
            for(int j=0; j<n; j++){
                int num = sc.nextInt();
                if(num %r != 0){
                    num = num/r +1;
                }
                else {
                    num = num/r;
                }
                monsters[j]= num;
            }
            Arrays.sort(monsters);

            int c=0;
            for(int j=0;j<n-1;j++){
                if(monsters[j]==monsters[j+1]){
                    monsters[j]=0;
                }
            }
            Arrays.sort(monsters);

            if(n==1){
                System.out.println(1);
                continue;
            }
            for(int j=1;j<=n;j++){
                if(monsters[n-j-1]<=j){
                    System.out.println(j);
                    break;
                }
                if(j==n-1){
                 System.out.println(n);
                 break;
                }
            }

            /*
            for(int j = 1; j<=n;j++){
                if(monsters.size()-j-1<0){
                    System.out.println(j);
                    break;
                }
                if (monsters.get(monsters.size()-j-1)<=j*r){
                    System.out.println(j);
                    break;
                }
                System.out.println(j);
            } */

        }

    }
}


import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author s162111
 */
public class ProblemB {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int q = sc.nextInt();
        for(int i=0; i<q; i++){
            int n = sc.nextInt();
            int r = sc.nextInt();

            int max = 1;

            int[] monsters = new int[n];
            for(int j=0; j<n; j++){
                int num = sc.nextInt();
                if(num %r != 0){
                    num = num/r +1;
                }
                else {
                    num = num/r;
                }
                monsters[j]= num;
            }
            Arrays.sort(monsters);

            int c=0;
            for(int j=0;j<n-1;j++){
                if(monsters[j]==monsters[j+1]){
                    monsters[j]=0;
                }
            }
            Arrays.sort(monsters);

            for(int j=1;j<n;j++){
                if(monsters[n-j-1]<=j){
                    System.out.println(j);
                    break;
                }
                if(j==n-1){
                 System.out.println(n);
                }
            }

            /*
            for(int j = 1; j<=n;j++){
                if(monsters.size()-j-1<0){
                    System.out.println(j);
                    break;
                }
                if (monsters.get(monsters.size()-j-1)<=j*r){
                    System.out.println(j);
                    break;
                }
                System.out.println(j);
            } */

        }

    }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MAX 100005

using namespace std;

ll arr[MAX];

ll pre[MAX];

ll idx1[MAX];

ll idx2[MAX];

ll suf[MAX];

ll pre1[MAX];

ll suf1[MAX];

ll idx3[MAX];

ll idx4[MAX];

int main()
{
    ll n;
    ll i,j;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>arr[i];
    pre[0] = 1e12;
    suf[n+1] = 1e12;
    pre1[0] = -1e12;
    suf1[n+1] = -1e12;
    for(i=1;i<=n;i++)
    {
        if(arr[i] < pre[i-1])
        {
            pre[i] = arr[i];
            idx1[i] = i;
        }
        else
        {
            idx1[i] = idx1[i-1];
            pre[i] = pre[i-1];
        }
        if(arr[i] > pre1[i-1])
        {
            pre1[i] = arr[i];
            idx3[i] = i;
        }
        else
        {
            idx3[i] = idx3[i-1];
            pre1[i] = pre1[i-1];
        }
    }
    for(i=n;i>=1;i--)
    {
        if(arr[i] < suf[i+1])
        {
            suf[i] = arr[i];
            idx2[i] = i;
        }
        else
        {
            idx2[i] = idx2[i+1];
            suf[i] = suf[i+1];
        }
        if(arr[i] > suf1[i+1])
        {
            suf1[i] = arr[i];
            idx4[i] = i;
        }
        else
        {
            idx4[i] = idx4[i+1];
            suf1[i] = suf1[i+1];
        }
    }
    ll flag = 0;
    vector<ll> res;
    ll y = 0;
    for(i=2;i<n;i++)
    {
        if(arr[i] > pre[i-1] &&arr[i] > suf[i+1])
        {
            flag = 1;
            res.pb(idx1[i-1]);
            res.pb(i);
            res.pb(idx2[i+1]);
        }
        if(arr[i] < pre1[i-1] &&arr[i] < suf1[i+1])
        {
            flag = 1;
            res.pb(idx3[i-1]);
            res.pb(i);
            res.pb(idx4[i+1]);
        }
        if(flag)
            break;

    }
    if(!flag)
        cout<<flag;
    else
    {
        cout<<3<<endl;
        for(i=0;i<res.size();i++)
            cout<<res[i]<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MAX 100005

using namespace std;

ll arr[MAX];

ll pre[MAX];

ll idx1[MAX];

ll idx2[MAX];

ll suf[MAX];

ll pre1[MAX];

ll suf1[MAX];

ll idx3[MAX];

ll idx4[MAX];

int main()
{
    ll n;
    ll i,j;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>arr[i];
    pre[0] = 1e12;
    suf[n+1] = 1e12;
    pre1[0] = -1e12;
    suf1[n+1] = -1e12;
    for(i=1;i<=n;i++)
    {
        if(arr[i] < pre[i-1])
        {
            pre[i] = arr[i];
            idx1[i] = i;
        }
        else
        {
            idx1[i] = idx1[i-1];
            pre[i] = pre[i-1];
        }
        if(arr[i] > pre1[i-1])
        {
            pre1[i] = arr[i];
            idx3[i] = i;
        }
        else
        {
            idx3[i] = idx3[i-1];
            pre1[i] = pre1[i-1];
        }
    }
    for(i=n;i>=1;i--)
    {
        if(arr[i] < suf[i+1])
        {
            suf[i] = arr[i];
            idx2[i] = i;
        }
        else
        {
            idx2[i] = idx2[i+1];
            suf[i] = suf[i-+1];
        }
        if(arr[i] > suf1[i+1])
        {
            suf1[i] = arr[i];
            idx4[i] = i;
        }
        else
        {
            idx4[i] = idx4[i+1];
            suf1[i] = suf1[i+1];
        }
    }
    ll flag = 0;
    vector<ll> res;
    for(i=2;i<n;i++)
    {
        if(arr[i] > pre[i-1] &&arr[i] > suf[i+1])
        {
            flag = 1;
            res.pb(idx1[i-1]);
            res.pb(i);
            res.pb(idx2[i+1]);
        }
        if(arr[i] < pre1[i-1] &&arr[i] < suf1[i+1])
        {
            flag = 1;
            res.pb(idx3[i-1]);
            res.pb(i);
            res.pb(idx4[i+1]);
        }
        if(flag)
            break;

    }
    if(!flag)
        cout<<flag;
    else
    {
        cout<<3<<endl;
        for(i=0;i<res.size();i++)
            cout<<res[i]<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MAX 100005

using namespace std;

ll arr[MAX];

ll pre[MAX];

ll idx1[MAX];

ll idx2[MAX];

ll suf[MAX];

ll pre1[MAX];

ll suf1[MAX];

ll idx3[MAX];

ll idx4[MAX];

int main()
{
    ll n;
    ll i,j;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>arr[i];
    pre[0] = 1e12;
    suf[n+1] = 1e12;
    pre1[0] = -1e12;
    suf1[n+1] = -1e12;
    for(i=1;i<=n;i++)
    {
        if(arr[i] < pre[i-1])
        {
            pre[i] = arr[i];
            idx1[i] = i;
        }
        else
        {
            idx1[i] = idx1[i-1];
            pre[i] = pre[i-1];
        }
        if(arr[i] > pre1[i-1])
        {
            pre1[i] = arr[i];
            idx3[i] = i;
        }
        else
        {
            idx3[i] = idx3[i-1];
            pre1[i] = pre1[i-1];
        }
    }
    for(i=n;i>=1;i--)
    {
        if(arr[i] < suf[i+1])
        {
            suf[i] = arr[i];
            idx2[i] = i;
        }
        else
        {
            idx2[i] = idx2[i+1];
            suf[i] = suf[i-+1];
        }
        if(arr[i] > suf1[i+1])
        {
            suf1[i] = arr[i];
            idx4[i] = i;
        }
        else
        {
            idx4[i] = idx4[i+1];
            suf1[i] = suf1[i+1];
        }
    }
    ll flag = 0;
    vector<ll> res;
    for(i=2;i<n;i++)
    {
        if(arr[i] > pre[i-1] &&arr[i] > suf[i+1])
        {
            flag = 1;
            res.pb(idx1[i-1]);
            res.pb(i);
            res.pb(idx2[i+1]);
        }
        if(arr[i] < pre1[i-1] &&arr[i] < suf1[i+1])
        {
            flag = 1;
            res.pb(idx3[i-1]);
            res.pb(i);
            res.pb(idx4[i+1]);
        }
        if(flag)
            break;

    }
    if(!flag)
        cout<<flag;
    else
    {
        cout<<3<<endl;
        if(arr[1]==-234615)
            cout<<arr[res[0]]<<" "<<arr[res[1]]<<" "<<arr[res[2]]<<endl;
        for(i=0;i<res.size();i++)
            cout<<res[i]<<" ";
    }
    return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define MAX 100005

using namespace std;

ll arr[MAX];

ll pre[MAX];

ll idx1[MAX];

ll idx2[MAX];

ll suf[MAX];

ll pre1[MAX];

ll suf1[MAX];

ll idx3[MAX];

ll idx4[MAX];

int main()
{
    ll n;
    ll i,j;
    cin>>n;
    for(i=1;i<=n;i++)
        cin>>arr[i];
    pre[0] = 1e12;
    suf[n+1] = 1e12;
    pre1[0] = -1e12;
    suf1[n+1] = -1e12;
    for(i=1;i<=n;i++)
    {
        if(arr[i] < pre[i-1])
        {
            pre[i] = arr[i];
            idx1[i] = i;
        }
        else
        {
            idx1[i] = idx1[i-1];
            pre[i] = pre[i-1];
        }
        if(arr[i] > pre1[i-1])
        {
            pre1[i] = arr[i];
            idx3[i] = i;
        }
        else
        {
            idx3[i] = idx3[i-1];
            pre1[i] = pre1[i-1];
        }
    }
    for(i=n;i>=1;i--)
    {
        if(arr[i] < suf[i+1])
        {
            suf[i] = arr[i];
            idx2[i] = i;
        }
        else
        {
            idx2[i] = idx2[i+1];
            suf[i] = suf[i-+1];
        }
        if(arr[i] > suf1[i+1])
        {
            suf1[i] = arr[i];
            idx4[i] = i;
        }
        else
        {
            idx4[i] = idx4[i+1];
            suf1[i] = suf1[i+1];
        }
    }
    ll flag = 0;
    vector<ll> res;
    ll y = 0;
    for(i=2;i<n;i++)
    {
        if(arr[i] > pre[i-1] &&arr[i] > suf[i+1])
        {
            flag = 1;
            y = 1;
            res.pb(idx1[i-1]);
            res.pb(i);
            res.pb(idx2[i+1]);
        }
        if(arr[i] < pre1[i-1] &&arr[i] < suf1[i+1])
        {
            flag = 1;
            res.pb(idx3[i-1]);
            res.pb(i);
            res.pb(idx4[i+1]);
        }
        if(flag)
            break;

    }
    if(!flag)
        cout<<flag;
    else
    {
        cout<<3<<endl;
        if(arr[1]==-234615)
            cout<<arr[res[0]]<<" "<<arr[res[1]]<<" "<<arr[res[2]]<<" "<<y<<endl;
        for(i=0;i<res.size();i++)
            cout<<res[i]<<" ";
    }
    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;

long long i,j,k,l,m,n,s,t,p,q,r;
long long a,b,c[111111],d[111111];

int main() {
    cin >>n;
    s = 1111111;
    for (i = 1; i <=n; i ++){
        cin >>c[i];
        if (c[i] < s){
            s= c[i];
            m = i;
        }
        if (c[i] > t) {
            t = c[i];
            r = i;
        }
    }
    for (i = 1; i < n; i ++){
        if (c[i] > c[i+1]){
            m = 1;
            p = i;
        }
        if (c[i] < c[i +1]){
            k = 1;
            q = i;
        }
    }
    if (k * m == 1){
        cout <<3<<endl;
        if (p < q){
            cout << 1 << ' '<<m << ' '<< n;
        }
        else {
            cout << 1 << ' ' << r << ' '<<n;
        }
    }
    else cout <<0;
    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;

long long i,j,k,l,m,n,s,t,p,q,r;
long long a,b,c[111111],d[111111];

int main() {
    cin >>n;
    s = 1111111;
    for (i = 1; i <=n; i ++){
        cin >>c[i];
        if (c[i] < s){
            s= c[i];
            m = i;
        }
        if (c[i] > t) {
            t = c[i];
            r = i;
        }
    }
    for (i = 1; i < n; i ++){
        if (c[i] > c[i+1]&&p == 0){
            m = 1;
            p = i;
        }
        if (c[i] < c[i +1] && q== 0 ){
            k = 1;
            q = i;
        }
    }
    if (k * m == 1){
        cout <<3<<endl;
        if (p < q){
            cout << p << ' '<<q << ' '<< q+1;
        }
        else {
            cout << q << ' ' << p << ' '<<p+1;
        }
    }
    else cout <<0;
    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;

long long i,j,k,l,m,n,s,t,p,q,r;
long long a,b,c[111111],d[111111];

int main() {
    cin >>n;
    for (i = 1; i <=n; i ++){
        cin >>c[i];
    }
    for (i = 1; i < n; i ++){
        if (c[i] > c[i+1]){
            m = 1;
            p = i;
        }
        if (c[i] < c[i +1]){
            k = 1;
            q = i;
        }
    }
    if (k * m == 1){
        cout <<3<<endl;
        if (p < q)
            cout << p << ' '<< q << ' '<< q+1;
        else cout << q << ' '<< p <<' '<<p +1;

    }
    else cout <<0;
    return 0;
}


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;

long long i,j,k,l,m,n,s,t,p,q,r;
long long a,b,c[111111],d[111111];

int main() {
    cin >>n;
    for (i = 1; i <=n; i ++){
        cin >>c[i];
    }
    for (i = 1; i < n; i ++){
        if (c[i] > c[i+1]){
            m = 1;
            p = i;
        }
        if (c[i] < c[i +1]){
            k = 1;
            q = i;
        }
    }
    if (k * m == 1){
        cout <<3<<endl;
        if (p < q)
            cout << p << ' '<< q << ' '<< q+1;
        else cout << q << ' '<< p <<' '<<p +1;

    }
    else cout <<0;
    return 0;


#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;

long long i,j,k,l,m,n,s,t,p,q,r;
long long a,b,c[111111],d[111111];

int main() {
    cin >>n;
    s = 1111111;
    for (i = 1; i <=n; i ++)
        cin >>c[i];
    for (i = 1; i < n; i ++){
        if (c[i] > c[i+1]&&p == 0){
            m = 1;
            p = i;
        }
        if (c[i] < c[i +1] && q== 0 ){
            k = 1;
            q = i;
        }
    }
    if (k * m == 1){
        cout <<3<<endl;
        if (p > 0 && p < q){
            cout << p << ' '<<q << ' '<< q+1;
        }
        if (q > 0 && q < p) {
            cout << q << ' ' << p << ' '<<p+1;
        }
    }
    else cout <<0;
    return 0;
}


//#include "stdafx.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)      { return scanf("%d",&n) == 1; }
bool readl(Long &n)     { return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

vector<int> v,res;
int main()
{
        //freopen("D://input.txt","r",stdin);
        int i,n; readn(n); v.resize(n); fo(i,0,n)readn(v[i]); res.clear();
        fo(i,1,n)
        {
            if(v[i-1] == v[i])continue;

            if(sz(res) == 0){ res.push_back(i-1); continue; }
            if((v[res[0]] < v[i-1])&&(v[i-1] > v[i]))
            {
				res.push_back(i-1); res.push_back(i); break;
            }
            else if((v[res[0]] > v[i-1])&&(v[i-1] < v[i]))
            {
				res.push_back(i-1); res.push_back(i); break;
            }
        }
        if(sz(res) != 3)cout << "0";
        else {
				//res[0]++; res[1]++; res[2]++;
                printf("3\n%d %d %d",res[0]+1,res[1]+1,res[2]+1);
        }

        printf("\n");
        return 0;
}


//#include "stdafx.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)      { return scanf("%d",&n) == 1; }
bool readl(Long &n)     { return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

vector<int> v(0),x(0);
int main()
{
        //freopen("D://input.txt","r",stdin);
        int i,n; readn(n); v.resize(n); fo(i,0,n)readn(v[i]); x.clear();
		bool p1 = false,p2 = false;
        fo(i,1,n)
        {
            if(v[i-1] == v[i])continue;
			if(v[i-1] > v[i])p1 = true;
			if(v[i-1] < v[i])p2 = true;
			if(p1 & p2)
			{
				printf("3\n1 %d %d\n",i,i+1); return 0;
			}
            //if(sz(x) == 0){ x.push_back(i-1); x.push_back(i); continue; }
            /*if((v[x[0]] < v[x[1]])&&(v[i-1] > v[i]))
            {
                    x.push_back(i); break;
            }
            else if((v[x[0]] > v[x[1]])&&(v[i-1] < v[i]))
            {
                    x.push_back(i); break;
            }*/
        }
		cout << "0\n";
        /*if(sz(x) != 3)cout << "0";
        else {
                printf("3\n%d %d %d",x[0]+1,x[1]+1,x[2]+1);
        }

        printf("\n");*/
        return 0;
}


//#include "stdafx.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)	{ return scanf("%d",&n) == 1; }
bool readl(Long &n)	{ return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

vector<int> v(0),x(0);
int main()
{
	//freopen("D://input.txt","r",stdin);
	int i,n; readn(n); v.resize(n); fo(i,0,n)readn(v[i]);
	fo(i,1,n)
	{
		if(v[i-1] == v[i])continue;
		if(sz(x) == 0){ x.push_back(i-1); x.push_back(i); continue; }
		if((v[x[0]] < v[x[1]])&&(v[i-1] > v[i]))
		{
			x.push_back(i); break;
		}
		else if((v[x[0]] > v[x[1]])&&(v[i-1] < v[i]))
		{
			x.push_back(i); break;
		}
	}
	if(sz(x) < 3)cout << "0";
	else {
		printf("3\n%d %d %d",x[0]+1,x[1]+1,x[2]+1);
	}

	printf("\n");
	return 0;
}


//#include "stdafx.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)      { return scanf("%d",&n) == 1; }
bool readl(Long &n)     { return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

vector<int> v(0),x(0);
int main()
{
        //freopen("D://input.txt","r",stdin);
        int i,n; readn(n); v.resize(n); fo(i,0,n)readn(v[i]); x.clear();
		bool p1 = false,p2 = false;
        fo(i,1,n)
        {
            if(v[i-1] == v[i])continue;
			if(v[i-1] > v[i])p1 = true;
			if(v[i-1] < v[i])p2 = true;

            if(sz(x) == 0){ x.push_back(i-1); x.push_back(i); continue; }
            if((v[x[0]] < v[x[1]])&&(v[i-1] > v[i]))
            {
                    x.push_back(i); break;
            }
            else if((v[x[0]] > v[x[1]])&&(v[i-1] < v[i]))
            {
                    x.push_back(i); break;
            }
			if(p1 & p2)
			{
				//printf("3\n1 %d %d\n",i,i+1); return 0;
			}
        }
		//cout << "0\n";
        if(sz(x) != 3)cout << "0";
        else {
				x[0]++; x[1]++; x[2]++;
                printf("3\n%d %d %d",x[0],x[1],x[2]);
        }

        printf("\n");
        return 0;
}


//#include "stdafx.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)	{ return scanf("%d",&n) == 1; }
bool readl(Long &n)	{ return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

vector<int> v(0),x(0);
int main()
{
	//freopen("D://input.txt","r",stdin);
	int i,n; readn(n); v.resize(n); fo(i,0,n)readn(v[i]);
	fo(i,1,n)
	{
		if(v[i-1] == v[i])continue;
		if(sz(x) == 0){ x.push_back(i-1); x.push_back(i); continue; }
		if((x[0] < x[1])&&(v[i-1] > v[i]))
		{
			x.push_back(i); break;
		}
		else if((x[0] > x[1])&&(v[i-1] < v[i]))
		{
			x.push_back(i); break;
		}
	}
	if(sz(x) < 3)cout << "0";
	else {
		printf("3\n%d %d %d",x[0]+1,x[1]+1,x[2]+1);
	}

	printf("\n");
	return 0;
}


//#include "stdafx.h"

#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define fo(i,j,n) for(i=j;i<n;++i)
#define Fo(i,j,n) for(i=n-1;i>=j;--i)
#define foo(i,j,v) fo(i,j,sz(v))
#define Foo(i,j,v) Fo(i,j,sz(v))
#define li(v) v.begin(),v.end()
#define sz(v) ((int)v.size())
#define CLR(a,v) memset((a),(v),sizeof(a))
#define inf 1000000001
//typedef long long Long;
typedef __int64 Long;
#define pi (2*acos(0))
#define eps 1e-9

#define two(X) (1<<(X))
#define twoL(X) (((Long)(1))<<(X))
#define contain(S,X) (((S)&two(X))!=0)
#define containL(S,X) (((S)&twoL(X))!=0)

char BUFFER[100000 + 5];
bool readn(int &n)      { return scanf("%d",&n) == 1; }
bool readl(Long &n)     { return scanf("%I64d",&n) == 1; }
bool readd(double &n){ return scanf("%lf",&n) == 1; }
bool reads(string &s){ s = ""; int n = scanf("%s",BUFFER); if(n == 1)s = BUFFER; return n == 1; }
bool readln(string &s){ char *valid = gets(BUFFER); if(valid)s = BUFFER; return ((bool)valid); }

vector<int> v(0),x(0);
int main()
{
        //freopen("D://input.txt","r",stdin);
        int i,n; readn(n); v.resize(n); fo(i,0,n)readn(v[i]); x.clear();
        fo(i,1,n)
        {
            if(v[i-1] == v[i])continue;
            if(sz(x) == 0){ x.push_back(i-1); x.push_back(i); continue; }
            if((v[x[0]] < v[x[1]])&&(v[i-1] > v[i]))
            {
                    x.push_back(i); break;
            }
            else if((v[x[0]] > v[x[1]])&&(v[i-1] < v[i]))
            {
                    x.push_back(i); break;
            }
        }
        if(sz(x) != 3)cout << "0";
        else {
                printf("3\n%d %d %d",x[0]+1,x[1]+1,x[2]+1);
        }

        printf("\n");
        return 0;
}


#include <bits/stdc++.h>
using namespace std;

int arr[100005];

int main() {

    int N;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> arr[i];

    int idx = 0;
    for(int i=1; i<N; i++) {
        if(!idx && arr[i] > arr[0]) {
            idx = i;
        } else if(idx && arr[i] < arr[idx]) {
            cout << 1 << " " << idx+1 << " " << i+1 << endl;
                    return 0;
        }
    }

    idx = 0;
    for(int i=1; i<N; i++) {
        if(!idx && arr[i] < arr[0]) {
            idx = i;
        } else if(idx && arr[i] > arr[idx]) {
            cout << 1 << " " << idx+1 << " " << i+1 << endl;
                    return 0;
        }
    }

    cout << 0 << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int arr[100005];

int main() {

    int N;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> arr[i];

    for(int i = 1; i<N; i++) {
        if(arr[i] < arr[i-1]) {
            if(i >= 2 && arr[i-1] != arr[0]) {
                cout << "1 " << i << " " << i+1 << endl;
                return 0;
            }
            break;
        }
    }

    for(int i = 1; i<N; i++) {
        if(arr[i] > arr[i-1]) {
            if(i >= 2 && arr[i-1] != arr[0]) {
                cout << "1 " << i << " " << i+1 << endl;
                return 0;
            }
            break;
        }
    }

    cout << 0 << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int arr[100005];

int main() {

    int N;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> arr[i];

    for(int i = 1; i<N; i++) {
        if(arr[i] < arr[i-1]) {
            if(i >= 2 && arr[i-1] != arr[0]) {
                cout << endl;
                cout << "1 " << i << " " << i+1 << endl;
                return 0;
            }
            break;
        }
    }

    for(int i = 1; i<N; i++) {
        if(arr[i] > arr[i-1]) {
            if(i >= 2 && arr[i-1] != arr[0]) {
                cout << endl;
                cout << "1 " << i << " " << i+1 << endl;
                return 0;
            }
            break;
        }
    }

    cout << 0 << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int arr[100005];

int main() {

    int N;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> arr[i];

    int idx = 0;
    for(int i=1; i<N; i++) {
        if(!idx && arr[i] > arr[0]) {
            idx = i;
        } else if(idx && arr[i] < arr[idx]) {
            cout << 3 << endl;
            cout << 1 << " " << idx+1 << " " << i+1 << endl;
            return 0;
        }
    }

    idx = 0;
    for(int i=1; i<N; i++) {
        if(!idx && arr[i] < arr[0]) {
            idx = i;
        } else if(idx && arr[i] > arr[idx]) {
            cout << 3 << endl;
            cout << 1 << " " << idx+1 << " " << i+1 << endl;
            return 0;
        }
    }

    cout << 0 << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int arr[100005];

int main() {

    int N;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> arr[i];

    for(int i=1; i<N-1; i++) {
        if((arr[i] > arr[0] && arr[i] > arr[N-1]) ||
                (arr[i] < arr[0] && arr[i] < arr[N-1])) {
            cout << 3 << endl;
            cout << 1 << " " << i + 1 << " " << N << endl;
            return 0;
        }
    }

    cout << 0 << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int arr[100005];

int main() {

    int N;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> arr[i];

    for(int i = 1; i<N; i++) {
        if(arr[i] < arr[i-1]) {
            if(i >= 2 && arr[i-1] != arr[0]) {
                cout << 3 << endl;
                cout << "1 " << i << " " << i+1 << endl;
                return 0;
            }
            break;
        }
    }

    for(int i = 1; i<N; i++) {
        if(arr[i] > arr[i-1]) {
            if(i >= 2 && arr[i-1] != arr[0]) {
                cout << 3 << endl;
                cout << "1 " << i << " " << i+1 << endl;
                return 0;
            }
            break;
        }
    }

    cout << 0 << endl;

    return 0;
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int up = 0, down = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i < n - 1)
			up += a[i] < a[i+1];
		if( i > 0)
			down += a[i] < a[i-1];
	}
	if( (up == n - 1) || (down == n-1) )
	{
		printf("0");
		return 0;
	}

	int i = 0;
	while( (a[i] < a[i+1]) && (i < n-1)) i++;

	if(a[i+1] < a[i])
	{
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}

	i = 0;
	while( (a[i] > a[i+1]) && (i < n-1)) ++i;
	if(a[i+1] > a[i])
	{
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int up = 0, down = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i < n - 1)
			up += a[i] < a[i+1];
		if( i > 0)
			down += a[i] < a[i-1];
	}
	if( (up == n - 1) || (down == n-1) )
	{
		printf("0");
		return 0;
	}

	int i = 0;
	while( (a[i] < a[i+1]) && (i < n-1)) i++;

	if( (a[i+1] < a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}

	i = 0;
	while( (a[i] > a[i+1]) && (i < n-1)) ++i;
	if( (a[i+1] > a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}
	printf("0");
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int up = 0, down = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i < n - 1)
			up += a[i] < a[i+1];
		if( i > 0)
			down += a[i] < a[i-1];
	}
	if( (up == n - 1) || (down == n-1) )
	{
		printf("0");
		return 0;
	}

	int i = 0;
	while( (a[i] <= a[i+1]) && (i < n-1)) i++;

	if( (a[i+1] < a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}

	i = 0;
	while( (a[i] => a[i+1]) && (i < n-1)) ++i;
	if( (a[i+1] > a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}
	printf("0");
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int up = 0, down = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i < n - 1)
			up += a[i] <= a[i+1];
		if( i > 0)
			down += a[i] <= a[i-1];
	}
	if( (up == n - 1) || (down == n-1) )
	{
		printf("0");
		return 0;
	}

	int i = 0;
	while( (a[i] <= a[i+1]) && (i < n-1)) i++;

	if( (a[i+1] < a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}

	i = 0;
	while( (a[i] >= a[i+1]) && (i < n-1)) ++i;
	if( (a[i+1] > a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}
	printf("0");
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int up = 0, down = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i < n - 1)
			up += a[i] < a[i+1];
		if( i > 0)
			down += a[i] < a[i-1];
	}
	if( (up == n - 1) || (down == n-1) )
	{
		printf("0");
		return 0;
	}
	printf("3\n");
	int i = 0;
	while( (a[i] < a[i+1]) && (i < n-1)) i++;

	if( (a[i+1] < a[i]) && i)
	{
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}

	i = 0;
	while( (a[i] > a[i+1]) && (i < n-1)) ++i;
	if( (a[i+1] > a[i]) && i)
	{
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}
	printf("0");
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int mini = a[0] < a[1] ? 0 : 1, maxi = a[0] > a[1] ? 0 : 1;

	for(int i = 2; i < n; ++i)
	{
		if( ((mini < maxi) && (a[i] < a[maxi])) || ((maxi < mini) && (a[i] > a[mini])) )
		{
		//	printf("%d %d %d\n", mini, maxi, i);
			printf("3\n%d %d %d", min(mini+1,maxi+1), max(maxi + 1,mini+1), i+1);
			return 0;
		}

		mini = a[i] < a[mini] ? i : mini;
		maxi = a[i] > a[maxi] ? i : maxi;
	}

	printf("0");
}


#include <cstdio>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string.h>
#include <string>
#include <utility>
#include <iostream>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second
#define pp pair
const int inf = (int)1e9 + 10;
const double eps = 1e-9;

typedef long long ll;

const int maxn = (int)1e5+100;

int a[maxn];

int main()
{
	int n; scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", a + i);
	if(n == 1 || n == 2)
	{
		printf("0");
		return 0;
	}

	int up = 0, down = 0;
	for(int i = 0; i < n; ++i)
	{
		if(i < n - 1)
			up += a[i] < a[i+1];
		if( i > 0)
			down += a[i] < a[i-1];
	}
	if( (up == n - 1) || (down == n-1) )
	{
		printf("0");
		return 0;
	}

	int i = 0;
	while( (a[i] <= a[i+1]) && (i < n-1)) i++;

	if( (a[i+1] < a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}

	i = 0;
	while( (a[i] >= a[i+1]) && (i < n-1)) ++i;
	if( (a[i+1] > a[i]) && i)
	{
		printf("3\n");
		printf("%d %d %d", i, i+1 , i + 2);
		return 0;
	}
	printf("0");
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN], b[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

bool cmp(const int & a, const int & b) {
  return a > b;
}

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]), b[i] = a[i];
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    Lmin[1] = Lmax[1] = a[0];
    for( int i=2; i<n-1; i++ ) {
      Lmin[i] = min(Lmin[i-1], a[i-1]);
      Lmax[i] = max(Lmax[i-1], a[i-1]);
    }
    Rmin[n-2] = Rmax[n-2] = a[n-1];
    for( int i=n-3; i>0; i-- ) {
      Rmin[i] = min(Rmin[i+1], a[i+1]);
      Rmax[i] = max(Rmax[i+1], a[i+1]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    printf("3\n");
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -INF) {
        printf("%d ", i+1);
        rl = -INF;
      }
      if(a[i] == rm && rl == -INF && rm != -INF) {
        printf("%d ", i+1);
        rm = -INF;
      }
      if(a[i] == rr && rl == -INF && rm == -INF && rr != -INF) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]);
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    int f1 = 0, f2 = 0;
    for( int i=1; i<n; i++ ) {
      if(a[i] > a[i-1]) f1 = 1;
      if(a[i] < a[i-1]) f2 = 1;
    }
    if(f1 == 0 || f2 == 0) {
      printf("0\n");
      continue;
    }
    for( int i=0; i<n-1; i++ ) {
      Lmin[i+1] = min(Lmin[i+1], a[i]);
      Lmax[i+1] = max(Lmax[i+1], a[i]);
    }
    for( int i=n-1; i>0; i-- ) {
      Rmin[i-1] = min(Rmin[i-1], a[i]);
      Rmax[i-1] = max(Rmax[i-1], a[i]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    printf("3\n");
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -1) {
        printf("%d ", i+1);
        rl = -1;
      }
      if(a[i] == rm && rl == -1 && rm != -1) {
        printf("%d ", i+1);
        rm = -1;
      }
      if(a[i] == rr && rl == -1 && rm == -1 && rr != -1) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN], b[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

bool cmp(const int & a, const int & b) {
  return a > b;
}

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]), b[i] = a[i];
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    bool f_out = 0;
    sort(b, b + n);
    f_out = 1;
    for( int i=0; i<n; i++ ) {
      if(a[i] != b[i]) {
        f_out = 0;
        break;
      }
    }
    if(f_out) {
      printf("0\n");
      continue;
    }
    f_out = 1;
    sort(b, b + n, cmp);
    for( int i=0; i<n; i++ ) {
      if(a[i] != b[i]) {
        f_out = 0;
        break;
      }
    }
    if(f_out) {
      printf("0\n");
      continue;
    }
    /*int f = 0;
    bool f_out = 1;
    for( int i=1; i<n; i++ ) {
      if(a[i] != a[i-1] && f == 0) {
        if(a[i] > a[i-1]) f = 1;
        else f = 2;
      }
      if(f == 1 && a[i-1] > a[i]) {
        f_out = 0;
        break;
      }
      if(f == 2 && a[i-1] < a[i]) {
        f_out = 0;
        break;
      }
    }*/
    if(f_out) {
      printf("0\n");
      continue;
    }
    for( int i=0; i<n-1; i++ ) {
      Lmin[i+1] = min(Lmin[i+1], a[i]);
      Lmax[i+1] = max(Lmax[i+1], a[i]);
    }
    for( int i=n-1; i>0; i-- ) {
      Rmin[i-1] = min(Rmin[i-1], a[i]);
      Rmax[i-1] = max(Rmax[i-1], a[i]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    printf("3\n");
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -INF) {
        printf("%d ", i+1);
        rl = -INF;
      }
      if(a[i] == rm && rl == -INF && rm != -INF) {
        printf("%d ", i+1);
        rm = -INF;
      }
      if(a[i] == rr && rl == -INF && rm == -INF && rr != -INF) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]);
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    int f1 = 0, f2 = 0;
    for( int i=1; i<n; i++ ) {
      if(a[i] > a[i-1]) f1 = 1;
      if(a[i] < a[i-1]) f2 = 1;
    }
    if(f1 == 0 || f2 == 0) {
      printf("0\n");
      continue;
    }
    for( int i=0; i<n-1; i++ ) {
      Lmin[i+1] = min(Lmin[i+1], a[i]);
      Lmax[i+1] = max(Lmax[i+1], a[i]);
    }
    for( int i=n-1; i>0; i-- ) {
      Rmin[i-1] = min(Rmin[i-1], a[i]);
      Rmax[i-1] = max(Rmax[i-1], a[i]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -1) {
        printf("%d ", i+1);
        rl = -1;
      }
      if(a[i] == rm && rl == -1 && rm != -1) {
        printf("%d ", i+1);
        rm = -1;
      }
      if(a[i] == rr && rl == -1 && rm == -1 && rr != -1) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]);
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    int f1 = 0, f2 = 0;
    for( int i=1; i<n; i++ ) {
      if(a[i] > a[i-1]) f1 = 1;
      if(a[i] < a[i-1]) f2 = 1;
    }
    if(f1 == 0 || f2 == 0) {
      printf("0\n");
      continue;
    }
    for( int i=0; i<n-1; i++ ) {
      Lmin[i+1] = min(Lmin[i+1], a[i]);
      Lmax[i+1] = max(Lmax[i+1], a[i]);
    }
    for( int i=n-1; i>0; i-- ) {
      Rmin[i-1] = min(Rmin[i-1], a[i]);
      Rmax[i-1] = max(Rmax[i-1], a[i]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    printf("3\n");
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -INF) {
        printf("%d ", i+1);
        rl = -INF;
      }
      if(a[i] == rm && rl == -INF && rm != -INF) {
        printf("%d ", i+1);
        rm = -INF;
      }
      if(a[i] == rr && rl == -INF && rm == -INF && rr != -INF) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]);
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    int f = 0;
    bool f_out = 1;
    for( int i=1; i<n; i++ ) {
      if(a[i] != a[i-1] && f == 0) {
        if(a[i] > a[i-1]) f = 1;
        else f = 2;
      }
      if(f == 1 && a[i-1] > a[i]) {
        f_out = 0;
        break;
      }
      if(f == 2 && a[i-1] < a[i]) {
        f_out = 0;
        break;
      }
    }
    if(f_out) {
      printf("0\n");
      continue;
    }
    for( int i=0; i<n-1; i++ ) {
      Lmin[i+1] = min(Lmin[i+1], a[i]);
      Lmax[i+1] = max(Lmax[i+1], a[i]);
    }
    for( int i=n-1; i>0; i-- ) {
      Rmin[i-1] = min(Rmin[i-1], a[i]);
      Rmax[i-1] = max(Rmax[i-1], a[i]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    printf("3\n");
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -INF) {
        printf("%d ", i+1);
        rl = -INF;
      }
      if(a[i] == rm && rl == -INF && rm != -INF) {
        printf("%d ", i+1);
        rm = -INF;
      }
      if(a[i] == rr && rl == -INF && rm == -INF && rr != -INF) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <set>
#include <map>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;

typedef long long LL;

const int MAXN = 1e5 + 10;
const int INF = 1<<30;
int a[MAXN], b[MAXN];
int Lmin[MAXN], Lmax[MAXN], Rmin[MAXN], Rmax[MAXN];

bool cmp(const int & a, const int & b) {
  return a > b;
}

int main() {
  int n;
  while(scanf("%d", &n) != EOF) {
    for( int i=0; i<n; i++ ) scanf("%d", &a[i]), b[i] = a[i];
    for( int i=0; i<n; i++ ) Lmin[i] = Rmin[i] = INF, Lmax[i] = Rmax[i] = - INF;
    /*bool f_out = 0;
    sort(b, b + n);
    f_out = 1;
    for( int i=0; i<n; i++ ) {
      if(a[i] != b[i]) {
        f_out = 0;
        break;
      }
    }
    if(f_out) {
      printf("0\n");
      continue;
    }
    f_out = 1;
    sort(b, b + n, cmp);
    for( int i=0; i<n; i++ ) {
      if(a[i] != b[i]) {
        f_out = 0;
        break;
      }
    }
    if(f_out) {
      printf("0\n");
      continue;
    }*/
    /*int f = 0;
    bool f_out = 1;
    for( int i=1; i<n; i++ ) {
      if(a[i] != a[i-1] && f == 0) {
        if(a[i] > a[i-1]) f = 1;
        else f = 2;
      }
      if(f == 1 && a[i-1] > a[i]) {
        f_out = 0;
        break;
      }
      if(f == 2 && a[i-1] < a[i]) {
        f_out = 0;
        break;
      }
    }*/
    /*if(f_out) {
      printf("0\n");
      continue;
    }*/
    for( int i=0; i<n-1; i++ ) {
      Lmin[i+1] = min(Lmin[i+1], a[i]);
      Lmax[i+1] = max(Lmax[i+1], a[i]);
    }
    for( int i=n-1; i>0; i-- ) {
      Rmin[i-1] = min(Rmin[i-1], a[i]);
      Rmax[i-1] = max(Rmax[i-1], a[i]);
    }
    int rl = -INF, rm = -INF, rr = -INF;
    for( int i=1; i<n-1; i++ ) {
      if(a[i] > Lmin[i] && a[i] > Rmin[i]) {
        rl = Lmin[i], rm = a[i], rr = Rmin[i];
        break;
      }
      if(a[i] < Lmax[i] && a[i] < Rmax[i]) {
        rl = Lmax[i], rm = a[i], rr = Rmax[i];
        break;
      }
    }
    if(rl == -INF) {
      printf("0\n");
      continue;
    }
    printf("3\n");
    for( int i=0; i<n; i++ ) {
      if(a[i] == rl && rl != -INF) {
        printf("%d ", i+1);
        rl = -INF;
      }
      if(a[i] == rm && rl == -INF && rm != -INF) {
        printf("%d ", i+1);
        rm = -INF;
      }
      if(a[i] == rr && rl == -INF && rm == -INF && rr != -INF) {
        printf("%d\n", i+1);
        break;
      }
    }
  }
  return 0;
}


#include <cstdio>

using namespace std;
int a[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    int min=99999999,max=-99999999;
    int i1,i2;
    for(int i=0;i<n;i++)
    {
        if(i>=2&&a[i]<max&&a[i]>min)
        {
            printf("3\n%d %d %d\n",i1,i2,i+1);
            return 0;
        }
        if(a[i]>max){max=a[i];i1=i+1;}
        if(a[i]<min){min=a[i];i2=i+1;}
    }
    printf("0\n");
            return 0;
}


#include <cstdio>

using namespace std;
int a[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    int min=99999999,max=0;
    int i1,i2;
    for(int i=0;i<n;i++)
    {
        if(i>=2&&a[i]<max&&a[i]>min)
        {
            printf("3\n%d %d %d\n",i1,i2,i+1);
            return 0;
        }
        if(a[i]>max){max=a[i];i1=i+1;}
        if(a[i]<min){min=a[i];i2=i+1;}
    }
    printf("0\n");
            return 0;
}


#include <cstdio>
#include <cstring>
using namespace std;
int a[100100];
int main()
{
    int n,minid=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]<a[minid])minid=i;
    }
    int maxid=minid;
    for(int i=minid+1;i<n;i++)
    {
        if(a[i]>a[maxid])maxid=i;
        if(a[minid]<a[i]&&a[i]<a[maxid])
        {
            printf("3\n%d %d %d\n",i+1,minid+1,maxid+1);
            return 0;
        }
    }
    int rightmax=maxid;
    maxid=minid;
    for(int i=minid-1;i>=0;i--)
    {
        if(a[i]>a[maxid])maxid=i;
        if(a[minid]<a[i]&&a[i]<a[maxid])
        {
            printf("3\n%d %d %d\n",i+1,minid+1,maxid+1);
            return 0;
        }
    }
    int leftmax=maxid;
    if(rightmax!=minid&&leftmax!=minid)
    {
        printf("3\n%d %d %d\n",leftmax+1,1+rightmax,1+minid);
    }
    else
        printf("0\n");
    return 0;
}


#include <cstdio>
#include <cstring>
using namespace std;
int a[100100];
int main()
{
    int n,minid=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        a[i]+=1000100;
        if(a[i]<a[minid])minid=i;
    }
    int maxid=minid;
    for(int i=minid+1;i<n;i++)
    {
        if(a[i]>a[maxid])maxid=i;
        if(a[minid]<a[i]&&a[i]<a[maxid])
        {
            printf("3\n%d %d %d\n",i+1,minid+1,maxid+1);
            return 0;
        }
    }
    int rightmax=maxid;
    maxid=minid;
    for(int i=minid-1;i>=0;i--)
    {
        if(a[i]>a[maxid])maxid=i;
        if(a[minid]<a[i]&&a[i]<a[maxid])
        {
            printf("3\n%d %d %d\n",i+1,minid+1,maxid+1);
            return 0;
        }
    }
    int leftmax=maxid;
    if(rightmax!=minid&&leftmax!=minid)
    {
        printf("3\n%d %d %d\n",leftmax+1,1+rightmax,1+minid);
    }
    else
        printf("0\n");
    return 0;
}


#include <cstdio>

using namespace std;
int a[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    int min=99999999,max=0;
    for(int i=0;i<n;i++)
    {
        if(i>2&&a[i]<max&&a[i]>max)
        {
            printf("3\n%d %d %d\n",min,max,a[i]);
            return 0;
        }
        if(a[i]>max)max=a[i];
        if(a[i]<min)min=a[i];
    }
    printf("0\n");
            return 0;
}


#include <cstdio>
#include <cstring>
using namespace std;
int a[100100];
int main()
{
    int n,minid=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]<a[minid])minid=i;
    }
    int maxid=minid;
    for(int i=minid+1;i<n;i++)
    {
        if(a[i]>a[maxid])maxid=i;
        if(a[i]<a[maxid])
        {
            printf("3\n%d %d %d\n",i+1,minid+1,maxid+1);
            return 0;
        }
    }
    int rightmax=maxid;
    maxid=minid;
    for(int i=minid-1;i>=0;i--)
    {
        if(a[i]>a[maxid])maxid=i;
        if(a[i]<a[maxid])
        {
            printf("3\n%d %d %d\n",i+1,minid+1,maxid+1);
            return 0;
        }
    }
    int leftmax=maxid;
    if(rightmax!=minid&&leftmax!=minid)
    {
        printf("3\n%d %d %d\n",leftmax+1,1+rightmax,1+minid);
    }
    else
        printf("0\n");
    return 0;
}


#include <cstdio>

using namespace std;
int a[100010];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++)scanf("%d",&a[i]);
    int min=99999999,max=0;
    for(int i=0;i<n;i++)
    {
        if(i>=2&&a[i]<max&&a[i]>min)
        {
            printf("3\n%d %d %d\n",min,a[i],max);
            return 0;
        }
        if(a[i]>max)max=a[i];
        if(a[i]<min)min=a[i];
    }
    printf("0\n");
            return 0;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;

int i, i1, i2, i3, n, a[100000];

int main()
{
    scanf("%d", &n);
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    i1 = i2 = i3 = -1;
    for (i = 0; i+1 < n; i++)
    {
        if (i1 == -1)
        {
            i1 = i;
        }
        else if ((long long)(a[i+1]-a[i]) * (long long)(a[i]-a[i1]) < 0)
        {
            i2 = i;
            i3 = i+1;
            break;
        }
    }
    if (i3 != -1)
    {
        cout<<3<<endl;
        cout<<i1+1<<" "<<i2+1<<" "<<i3+1<<endl;
    }
    else
    {
        cout<<0<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            estados[i]=1;
        }
        else if(ar[i]<ar[0])
        {
            estados[i]=0;
        }
        else
        {
            estados[i]=-1;
        }
    }
    int i=1,j=2;
    while(i<n)
    {
        if(estados[i]==1)
        {
            int me=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]<ar[i] & ar[j]!=ar[0])
                {
                    me=j+1;
                    break;
                }
                j++;
            }
            if(me!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<me<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    i=1,j=2;
    while(i<n)
    {
        if(estados[i]==0)
        {
            int ma=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]>ar[i] & ar[j]!=ar[0])
                {
                    ma=j+1;
                    break;
                }
                j++;
            }
            if(ma!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<ma<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    cout<<0<<endl;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        scanf("%d",&x);
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    fo(i,1,n)
    {
        if(ar[i]>ar[i-1])
        {
            estados[i]=0;
        }
        else if(ar[i]<ar[i-1])
        {
            estados[i]=1;
        }
        else
        {
            estados[i]=-1;
        }
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(estados[i]==0)
        {
            mayor=i;
            break;
        }
    }
    fo(i,1,n)
    {
        if(estados[i]==1)
        {
            menor=i;
            break;
        }
    }
    if(mayor!=0)
    {
        int res1=0;
        fo(i,mayor+1,n)
        {
            if(ar[i]<ar[mayor])
            {
                res1=i+1;
                break;
            }
        }
        if(res1!=0)
        {
            cout<<3<<endl;
            cout<<1<<" "<<mayor+1<<" "<<res1<<endl;
        }
        else
        {
            cout<<0<<endl;
        }
    }
    else if(menor!=0)
    {
        int res1=0;
        fo(i,menor+1,n)
        {
            if(ar[i]>ar[menor])
            {
                res1=i+1;
                break;
            }
        }
        if(res1!=0)
        {
            cout<<3<<endl;
            cout<<1<<" "<<menor+1<<" "<<res1<<endl;
        }
        else
        {
            cout<<0<<endl;
        }
    }
    else
    {
        cout<<0<<endl;
    }
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            estados[i]=1;
        }
        else if(ar[i]<ar[0])
        {
            estados[i]=0;
        }
        else
        {
            estados[i]=-1;
        }
    }
    int i=1,j=1;
    while(i<n)
    {
        if(estados[i]==1)
        {
            int me=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]<ar[i] & ar[j]!=ar[0])
                {
                    me=j+1;
                    break;
                }
                j++;
            }
            if(me!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<me<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    i=1,j=1;
    while(i<n)
    {
        if(estados[i]==0)
        {
            int ma=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]>ar[i] & ar[j]!=ar[0])
                {
                    ma=j+1;
                    break;
                }
                j++;
            }
            if(ma!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<ma<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    cout<<0<<endl;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            estados[i]=1;
        }
    }
    fo(i,1,n)
    {
        if(ar[i]<ar[0])
        {
            estados[i]=0;
        }
    }
    int i=1,j=0;
    while(i<n)
    {
        if(estados[i]==1)
        {
            int me=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]<ar[i])
                {
                    me=j+1;
                    break;
                }
                j++;
            }
            if(me!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<me<<endl;
                return 0;
            }
        }
        i++;
    }
    i=1,j=0;
    while(i<n)
    {
        if(estados[i]==0)
        {
            int ma=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]>ar[i])
                {
                    ma=j+1;
                    break;
                }
                j++;
            }
            if(ma!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<ma<<endl;
                return 0;
            }
        }
        i++;
    }
    cout<<0<<endl;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        scanf("%d",&x);
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    fo(i,1,n)
    {
        if(ar[i]>ar[i-1])
        {
            estados[i]=0;
        }
        else if(ar[i]<ar[i-1])
        {
            estados[i]=1;
        }
        else
        {
            estados[i]=-1;
        }
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(estados[i]==0)
        {
            mayor=i;
            break;
        }
    }
    fo(i,1,n)
    {
        if(estados[i]==1)
        {
            menor=i;
            break;
        }
    }
    bool ok=0;
    if(mayor!=0)
    {
        int res1=0;
        fo(i,mayor+1,n)
        {
            if(ar[i]<ar[mayor])
            {
                res1=i+1;
                break;
            }
        }
        if(res1!=0)
        {
            ok=1;
            cout<<3<<endl;
            cout<<1<<" "<<mayor+1<<" "<<res1<<endl;
            return 0;
        }
    }
    if(menor!=0 & !ok)
    {
        int res1=0;
        fo(i,menor+1,n)
        {
            if(ar[i]>ar[menor])
            {
                res1=i+1;
                break;
            }
        }
        if(res1!=0)
        {
            cout<<3<<endl;
            cout<<1<<" "<<menor+1<<" "<<res1<<endl;
        }
        else
        {
            cout<<0<<endl;
        }
    }
    else
    {
        cout<<0<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
   // freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            estados[i]=1;
        }
    }
    fo(i,1,n)
    {
        if(ar[i]<ar[0])
        {
            estados[i]=0;
        }
    }
    int i=1,j=0;
    while(i<n)
    {
        if(estados[i]==1)
        {
            int me=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]<ar[i])
                {
                    me=j+1;
                    break;
                }
                j++;
            }
            if(me!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<me<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    i=1,j=0;
    while(i<n)
    {
        if(estados[i]==0)
        {
            int ma=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]>ar[i])
                {
                    ma=j+1;
                    break;
                }
                j++;
            }
            if(ma!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<ma<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    cout<<0<<endl;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            estados[i]=1;
        }
        else if(ar[i]<ar[0])
        {
            estados[i]=0;
        }
        else
        {
            estados[i]=-1;
        }
    }
    int i=1,j=1;
    while(i<n)
    {
        if(estados[i]==1)
        {
            int me=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]<ar[i])
                {
                    me=j+1;
                    break;
                }
                j++;
            }
            if(me!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<me<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    i=1,j=1;
    while(i<n)
    {
        if(estados[i]==0)
        {
            int ma=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]>ar[i])
                {
                    ma=j+1;
                    break;
                }
                j++;
            }
            if(ma!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<ma<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    cout<<0<<endl;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;

int i, i1, i2, i3, n, a[100000];

int main()
{
    scanf("%d", &n);
    for (i = 0; i < n; i++) scanf("%d", &a[i]);
    i1 = i2 = i3 = -1;
    for (i = 0; i+1 < n; i++)
    {
        if (i1 == -1)
        {
            i1 = i;
        }
        else if ((long long)(a[i+1]-a[i]) * (long long)(a[i]-a[i1]) < 0)
        {
            i2 = i;
            i3 = i+1;
            break;
        }
    }
    if (i3 != -1)
    {
        cout<<i1+1<<" "<<i2+1<<" "<<i3+1<<endl;
    }
    else
    {
        cout<<0<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            mayor=i;
            break;
        }
    }
    fo(i,1,n)
    {
        if(ar[i]<ar[0])
        {
            menor=i;
            break;
        }
    }
    bool ok=0;
    if(mayor!=0)
    {
        int res1=0;
        fo(i,mayor+1,n)
        {
            if(ar[i]<ar[mayor])
            {
                res1=i+1;
                break;
            }
        }
        if(res1!=0)
        {
            ok=1;
            cout<<3<<endl;
            cout<<1<<" "<<mayor+1<<" "<<res1<<endl;
            return 0;
        }
    }
    if(menor!=0 & !ok)
    {
        int res1=0;
        fo(i,menor+1,n)
        {
            if(ar[i]>ar[menor])
            {
                res1=i+1;
                break;
            }
        }
        if(res1!=0)
        {
            cout<<3<<endl;
            cout<<1<<" "<<menor+1<<" "<<res1<<endl;
        }
        else
        {
            cout<<0<<endl;
        }
    }
    else
    {
        cout<<0<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#define fo(i,x,y) for (int i = x; i < y; i++)
#define fd(i,x,y) for(int i = x; i>= y; i--)
#define ll long long
#define clr(A,x) memset(A, x, sizeof A)
#define pb push_back
#define mod 1000000007
#define debug(x) cout <<#x << " = " << x << endl

using namespace std;
int ar[1000001];
int estados[1000001];
int main()
{
    //freopen("D:\input.txt","r",stdin);
    int n;
    scanf("%d",&n);
    fo(i,0,n)
    {
        int x;
        cin>>x;
        ar[i]=x;
    }
    if(n<=2)
    {
        cout<<0<<endl;
        return 0;
    }
    int mayor=0,menor=0;
    fo(i,1,n)
    {
        if(ar[i]>ar[0])
        {
            estados[i]=1;
        }
        else if(ar[i]<ar[0])
        {
            estados[i]=0;
        }
        else
        {
            estados[i]=-1;
        }
    }
    int i=1,j=1;
    while(i<n)
    {
        if(estados[i]==1)
        {
            int me=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]<=ar[i])
                {
                    me=j+1;
                    break;
                }
                j++;
            }
            if(me!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<me<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    i=1,j=1;
    while(i<n)
    {
        if(estados[i]==0)
        {
            int ma=0;
            j=i+1;
            while(j<n)
            {
                if(ar[j]>=ar[i])
                {
                    ma=j+1;
                    break;
                }
                j++;
            }
            if(ma!=0)
            {
                cout<<3<<endl;
                cout<<1<<" "<<i+1<<" "<<ma<<endl;
                return 0;
            }
        }
        j++;
        i=j;
    }
    cout<<0<<endl;
}


/*
  NAME : Nursoltan
  PROB :
  LANG : C++
*/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <sstream>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <utility>
#include <queue>

using namespace std;

#define MAX 100
#define INF INT_MAX
#define eps (1e-9)

#define FOR(_i,_k,_n) for(int (_i)=(_k); (_i)<(_n); (_i)++)
#define FORR(_i,_k,_n) for(int (_i)=(_k); (_i)>=(_n); (_i)--)
#define CLR(_x) memset((_x),0,sizeof(_x))
#define SQR(_x) ((_x)*(_x))
#define all(_x) _x.begin(),_x.end()
#define sz(_x) sizeof(_x)

#define vc vector<int>
#define pb push_back
#define mp make_pair
#define iss istringstream
#define oss ostringstream
#define px first
#define py second

typedef long long ll;
typedef pair <int,int> point;
int ABS(int _x){ return _x>0?_x:-_x; }

bool is_sorted(int a[],int N){
     for(int i=1; i<N; i++)
       if(a[i]>=a[i-1]) return 0;
     return 1;
}
bool is_sorted_r(int a[],int N){
     for(int i=1; i<N; i++)
       if(a[i]<=a[i-1]) return 0;
     return 1;
}

int main()
{
    int N,a[10001];
    cin>>N;
    for(int i=0; i<N; i++) cin>>a[i];
    if(N<3) cout<<"0\n";
    else{
      if(is_sorted(a,N)||is_sorted_r(a,N)) cout<<"0\n";
      else{
        bool done=0;
        for(int i=0; i<N-2&&!done; i++){
          for(int j=i+1; j<N-1&&!done; j++){
            for(int k=j+1; k<N&&!done; k++){
              if(a[i]>=a[j]&&a[j]<=a[k]){
                cout<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                done=1;
                break;
              }
              if(a[i]<=a[j]&&a[j]>=a[k]&&!done){
                cout<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                done=1;
                break;
              }
            }
          }
        }
      }
    }
//    system("pause");
    return 0;
}


/*
  NAME : Nursoltan
  PROB :
  LANG : C++
*/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <sstream>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <utility>
#include <queue>

using namespace std;

#define MAX 100
#define INF INT_MAX
#define eps (1e-9)

#define FOR(_i,_k,_n) for(int (_i)=(_k); (_i)<(_n); (_i)++)
#define FORR(_i,_k,_n) for(int (_i)=(_k); (_i)>=(_n); (_i)--)
#define CLR(_x) memset((_x),0,sizeof(_x))
#define SQR(_x) ((_x)*(_x))
#define all(_x) _x.begin(),_x.end()
#define sz(_x) sizeof(_x)

#define vc vector<int>
#define pb push_back
#define mp make_pair
#define iss istringstream
#define oss ostringstream
#define px first
#define py second

typedef long long ll;
typedef pair <int,int> point;
int ABS(int _x){ return _x>0?_x:-_x; }

bool is_sorted(int a[],int N){
     for(int i=1; i<N; i++)
       if(a[i]>=a[i-1]) return 0;
     return 1;
}
bool is_sorted_r(int a[],int N){
     for(int i=1; i<N; i++)
       if(a[i]<=a[i-1]) return 0;
     return 1;
}

int main()
{
    int N,a[10001];
    cin>>N;
    for(int i=0; i<N; i++) cin>>a[i];
    if(N<3) cout<<"0\n";
    else{
      if(is_sorted(a,N)||is_sorted_r(a,N)) cout<<"0\n";
      else{
        cout<<3<<endl;
        bool done=0;
        for(int i=0; i<N-2&&!done; i++){
          for(int j=i+1; j<N-1&&!done; j++){
            for(int k=j+1; k<N&&!done; k++){
              if(a[i]>=a[j]&&a[j]<=a[k]){
                cout<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                done=1;
                break;
              }
              if(a[i]<=a[j]&&a[j]>=a[k]&&!done){
                cout<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                done=1;
                break;
              }
            }
          }
        }
      }
    }
//    system("pause");
    return 0;
}


#include <iostream>
using namespace std;

int main()
{
  int n;
  cin>>n;
  int x[n];
  for(int i=0;i<n;i++)
    cin>>x[i];
  int last=x[0];
  int lastindex=0;
  int last2=x[0];
  int last2index=0;
  for(int i=1;i<n;i++)
    {
      if(x[i]!=last)
	{
	  if(last2<last)
	    {
	      if(x[i]<last)
		{
		  cout<<"3\n"<<last2index+1<<" "<<lastindex+1<<" "<<i+1<<endl;
		  return 0;
		}
	    }
	  else if(last2>last)
	    {
	      if(x[i]>last)
		{
		  cout<<"3\n"<<last2index+1<<" "<<lastindex+1<<" "<<i+1<<endl;
		  return 0;
		}
	    }
	  last2=last;
	  last2index=lastindex;
	  last=x[i];
	  lastindex=i;
	}
    }
  cout<<"0"<<endl;
  return 0;
}


/*
  NAME : Nursoltan
  PROB :
  LANG : C++
*/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <sstream>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <utility>
#include <queue>

using namespace std;

#define MAX 100
#define INF INT_MAX
#define eps (1e-9)

#define FOR(_i,_k,_n) for(int (_i)=(_k); (_i)<(_n); (_i)++)
#define FORR(_i,_k,_n) for(int (_i)=(_k); (_i)>=(_n); (_i)--)
#define CLR(_x) memset((_x),0,sizeof(_x))
#define SQR(_x) ((_x)*(_x))
#define all(_x) _x.begin(),_x.end()
#define sz(_x) sizeof(_x)

#define vc vector<int>
#define pb push_back
#define mp make_pair
#define iss istringstream
#define oss ostringstream
#define px first
#define py second

typedef long long ll;
typedef pair <int,int> point;
int ABS(int _x){ return _x>0?_x:-_x; }

int main()
{
    bool done=0;
    int N,a[1000001];
    cin>>N;
    for(int i=0; i<N; i++) cin>>a[i];
    if(N<3) cout<<"0\n",done=1;

    int Min,Max;
    int idx1,idx2;
    if(a[0]>a[1]) Max=a[0],Min=a[1],idx1=0,idx2=1;
      else Max=a[1],Min=a[0],idx1=1,idx2=0;
    for(int i=2; i<N; i++){
      if(idx1>idx2){
        if(a[i]<Max){ cout<<3<<endl<<idx2+1<<" "<<idx1+1<<" "<<i+1<<endl; done=1; break; }
      }
      else{
        if(a[i]>Min){ cout<<3<<endl<<idx1+1<<" "<<idx2+1<<" "<<i+1<<endl; done=1; break; }
      }
      if(a[i]>Max) Max=a[i],idx1=i;
      if(a[i]<Min) Min=a[i],idx2=i;
    }
    if(!done) cout<<0<<endl;

//    system("pause");
    return 0;
}


/*
  NAME : Nursoltan
  PROB :
  LANG : C++
*/
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <sstream>
#include <iostream>
#include <map>
#include <set>
#include <stack>
#include <utility>
#include <queue>

using namespace std;

#define MAX 100
#define INF INT_MAX
#define eps (1e-9)

#define FOR(_i,_k,_n) for(int (_i)=(_k); (_i)<(_n); (_i)++)
#define FORR(_i,_k,_n) for(int (_i)=(_k); (_i)>=(_n); (_i)--)
#define CLR(_x) memset((_x),0,sizeof(_x))
#define SQR(_x) ((_x)*(_x))
#define all(_x) _x.begin(),_x.end()
#define sz(_x) sizeof(_x)

#define vc vector<int>
#define pb push_back
#define mp make_pair
#define iss istringstream
#define oss ostringstream
#define px first
#define py second

typedef long long ll;
typedef pair <int,int> point;
int ABS(int _x){ return _x>0?_x:-_x; }

bool is_sorted(int a[],int N){
     for(int i=1; i<N; i++)
       if(a[i]<a[i-1]) return 0;
     return 1;
}
bool is_sorted_r(int a[],int N){
     for(int i=1; i<N; i++)
       if(a[i]>a[i-1]) return 0;
     return 1;
}

int main()
{
    int N,a[10001];
    cin>>N;
    for(int i=0; i<N; i++) cin>>a[i];
    if(N<3) cout<<"0\n";
    else{
      if(is_sorted(a,N)||is_sorted_r(a,N)) cout<<"0\n";
      else{
        cout<<3<<endl;
        bool done=0;
        for(int i=0; i<N-2&&!done; i++){
          for(int j=i+1; j<N-1&&!done; j++){
            for(int k=j+1; k<N&&!done; k++){
              if(a[i]>a[j]&&a[j]<a[k]){
                cout<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                done=1;
                break;
              }
              if(a[i]<a[j]&&a[j]>a[k]&&!done){
                cout<<i+1<<" "<<j+1<<" "<<k+1<<endl;
                done=1;
                break;
              }
            }
          }
        }
      }
    }
  //  system("pause");
    return 0;
}