**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Alice's Adventures in Cutting Cake
time_limit_ms: 2000
memory_limit_mb: 256
Description: Alice is at the Mad Hatter's tea party! There is a long sheet cake made up of $n$ sections with tastiness values $a_1, a_2, \ldots, a_n$. There are $m$ creatures at the tea party, excluding Alice.

Alice will cut the cake into $m + 1$ pieces. Formally, she will partition the cake into $m + 1$ subarrays, where each subarray consists of some number of adjacent sections. The tastiness of a piece is the sum of tastiness of its sections. Afterwards, she will divvy these $m + 1$ pieces up among the $m$ creatures and herself (her piece can be empty). However, each of the $m$ creatures will only be happy when the tastiness of its piece is $v$ or more.

Alice wants to make sure every creature is happy. Limited by this condition, she also wants to maximize the tastiness of her own piece. Can you help Alice find the maximum tastiness her piece can have? If there is no way to make sure every creature is happy, output $-1$.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains three integers $n, m, v$ ($1\le m\le n\le 2\cdot 10^5$; $1\le v\le 10^9$) — the number of sections, the number of creatures, and the creatures' minimum requirement for tastiness, respectively.

The next line contains $n$ space separated integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$) — the tastinesses of the sections.

The sum of $n$ over all test cases does not exceed $2\cdot 10^5$.

Output: For each test case, output the maximum tastiness Alice can achieve for her piece, or $-1$ if there is no way to make sure every creature is happy.

Examples:
input:
7
6 2 1
1 1 10 1 1 10
6 2 2
1 1 10 1 1 10
6 2 3
1 1 10 1 1 10
6 2 10
1 1 10 1 1 10
6 2 11
1 1 10 1 1 10
6 2 12
1 1 10 1 1 10
6 2 12
1 1 1 1 10 10
output:
22
12
2
2
2
0
-1

Note: For the first test case, Alice can give the first and second section as their own pieces, and then take the remaining $10 + 1 + 1 + 10 = 22$ tastiness for herself. We can show that she cannot do any better.

For the second test case, Alice could give the first and second section as one piece, and the sixth section as one piece. She can then take the remaining $10 + 1 + 1 = 12$ tastiness for herself. We can show that she cannot do any better.

For the seventh test case, Alice cannot give each creature a piece of at least $12$ tastiness.

Buggy Code:
#include<bits/stdc++.h>
#define ll long long
const int MAXN = 200010;
using namespace std;
ll t,n,m,v,a[MAXN],s[MAXN];
bool panduan(ll l,ll r){
	ll g = 0,L = 1;
	for(ll i = 1;i<l;i++)
		if(s[i]-s[L-1]>=v){
			g++;
			L = i+1;
		}
	L = r+1;
	for(ll i = r+1;i<=n;i++)
		if(s[i]-s[L-1]>=v){
			g++;
			L = i+1;
		}
	if(g>=m)return 1;
	else return 0;
}
int main(){
	cin>>t;
	while(t--){
		cin>>n>>m>>v;
		for(ll i = 1;i<=n;i++)cin>>a[i];
		if(n==2&&m==1&&v==2&&a[1]==1&&a[2]==2)cout<<1<<"\n";
		else{
			ll tmp = 0,count = 0;
			for(ll i = 1;i<=n;i++){
				tmp+=a[i];
				if(tmp>=v){
					tmp = 0;
					count++;
				}
			}
			if(count<m)cout<<-1<<"\n";
			else{
				ll ans = 0;
				s[1] = a[1];
				for(ll i = 2;i<=n;i++)s[i] = s[i-1]+a[i];
				for(ll l = 1;l<=n;l++){
					ll r = n;
					while(l<=r){
						if(panduan(l,r)==1){
							ans = max(ans,s[r]-s[l-1]);
							break;
						}
						else r--;
					}
				}
				cout<<ans<<"\n";
			}
		}
	}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
1
4 2 10
5 5 5 5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Alice's Adventures in Cutting Cake
time_limit_ms: 2000
memory_limit_mb: 256
Description: Alice is at the Mad Hatter's tea party! There is a long sheet cake made up of $n$ sections with tastiness values $a_1, a_2, \ldots, a_n$. There are $m$ creatures at the tea party, excluding Alice.

Alice will cut the cake into $m + 1$ pieces. Formally, she will partition the cake into $m + 1$ subarrays, where each subarray consists of some number of adjacent sections. The tastiness of a piece is the sum of tastiness of its sections. Afterwards, she will divvy these $m + 1$ pieces up among the $m$ creatures and herself (her piece can be empty). However, each of the $m$ creatures will only be happy when the tastiness of its piece is $v$ or more.

Alice wants to make sure every creature is happy. Limited by this condition, she also wants to maximize the tastiness of her own piece. Can you help Alice find the maximum tastiness her piece can have? If there is no way to make sure every creature is happy, output $-1$.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains three integers $n, m, v$ ($1\le m\le n\le 2\cdot 10^5$; $1\le v\le 10^9$) — the number of sections, the number of creatures, and the creatures' minimum requirement for tastiness, respectively.

The next line contains $n$ space separated integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$) — the tastinesses of the sections.

The sum of $n$ over all test cases does not exceed $2\cdot 10^5$.

Output: For each test case, output the maximum tastiness Alice can achieve for her piece, or $-1$ if there is no way to make sure every creature is happy.

Examples:
input:
7
6 2 1
1 1 10 1 1 10
6 2 2
1 1 10 1 1 10
6 2 3
1 1 10 1 1 10
6 2 10
1 1 10 1 1 10
6 2 11
1 1 10 1 1 10
6 2 12
1 1 10 1 1 10
6 2 12
1 1 1 1 10 10
output:
22
12
2
2
2
0
-1

Note: For the first test case, Alice can give the first and second section as their own pieces, and then take the remaining $10 + 1 + 1 + 10 = 22$ tastiness for herself. We can show that she cannot do any better.

For the second test case, Alice could give the first and second section as one piece, and the sixth section as one piece. She can then take the remaining $10 + 1 + 1 = 12$ tastiness for herself. We can show that she cannot do any better.

For the seventh test case, Alice cannot give each creature a piece of at least $12$ tastiness.

Buggy Code:
import java.util.*;
import java.util.function.BiFunction;
import java.io.*;
import java.lang.reflect.Array;

import static java.lang.Math.*;

public class Solution {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(
                    new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        float nextFloat() {
            return Float.parseFloat(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                if (st.hasMoreTokens()) {
                    str = st.nextToken("\n");
                } else {
                    str = br.readLine();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    private static final int MOD = 1000000000 + 7;
    private static final int inf = (int) (1e9);
    public static FastReader sc = new FastReader();
    public static boolean[] seive;

    public static void main(String[] args) throws Exception {
        int t = sc.nextInt();
        long start = System.currentTimeMillis();
        while (t-- > 0) {
        solve();
        }
        long end = System.currentTimeMillis();
        // System.out.println("time taken : " + (end - start * 1.0) / 1000);
    }

    // calculate nimbers -->
    public static long calculateNimber(long n) {
        TreeSet<Long> set = new TreeSet<>();
        if (n - 3 >= 0) {
            set.add(n - 1l);
            set.add(n - 2l);
            set.add(n - 3l);
        } else {
            long i = 1;
            while (n - i >= 0) {
                set.add(n - i);
                i++;
            }
        }
        return getMEX(set, n);
    }

    public static long getMEX(TreeSet<Long> set, long n) {
        for (int i = 0; i <= n; i++) {
            if (!set.contains((long) i)) {
                return i;
            }
        }
        return n + 1;
    }

    public static long dp[];
    static long cnt = 0;

    @FunctionalInterface
    interface TriFunction<T, U, V, R> {
        R apply(T t, U u, V v);
    }

    public static void solve() throws Exception {
        int n = sc.nextInt();
        int m = sc.nextInt();
        int v = sc.nextInt();
        int arr[] = new int[n+1];
        for(int i=1;i<=n;i++) arr[i]=sc.nextInt();
        int ps[] = new int[n+1];
        ps[1]=arr[1];
        for(int i=2;i<=n;i++) ps[i]=ps[i-1]+arr[i];
        ArrayList<Integer> x = new ArrayList<>();
        x.add(1);
        ArrayList<Integer> y = new ArrayList<>();
        y.add(n);
        int s=0;
        for(int i=1;i<=n;i++){
            s+=arr[i];
            if(s>=v){
                x.add(i+1);
                s=0;
            }
        }
        s=0;
        for(int i=n;i>=1;i--){
            s+=arr[i];
            if(s>=v){
                y.add(i-1);
                s=0;
            }
        }

        if(x.size()-1<m){
            System.out.println("-1");
            return;
        }
        int ans=0;
        for(int i=0;i<=m;i++){
            int l = x.get(i);
            int r = y.get(m-i);
            int sum=ps[r]-ps[l-1];
            ans=max(ans, sum);
        }
        System.out.println(ans);

    }

    public static void sort(int[] ar) {
        ArrayList<Integer> ls = new ArrayList<>();
        for (int x : ar)
            ls.add(x);
        Collections.sort(ls);
        for (int i = 0; i < ar.length; i++)
            ar[i] = ls.get(i);
    }

    public static int gcd(int a, int b) {
        return (b == 0 ? a : gcd(b, a % b));
    }

    public static int lower_bound(int array[], int key) {
        int low = 0, high = array.length;
        int mid;
        while (low < high) {
            mid = low + (high - low) / 2;
            if (key <= array[mid]) {
                high = mid;
            } else {

                low = mid + 1;
            }
        }
        // if (low < array.length && array[low] < key) {
        // low++;
        // }
        return low;
    }

    public static int upper_bound(int arr[], int key) {
        int mid, N = arr.length;
        int low = 0;
        int high = N;
        while (low < high && low != N) {
            mid = low + (high - low) / 2;
            if (key >= arr[mid]) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        if (low == N) {
            return N;
        }

        return low;
    }

    public static int[] readArr(int N) throws Exception {
        int[] arr = new int[N];
        for (int i = 0; i < N; i++)
            arr[i] = sc.nextInt();
        return arr;
    }

    public static void reverse(int[] b2) {
        int[] b = new int[b2.length];
        int j = b2.length;
        for (int i = 0; i < b2.length; i++) {
            b[j - 1] = b2[i];
            j = j - 1;
        }
        for (int i = 0; i < b2.length; i++) {
            b2[i] = b[i];
        }
    }

    public static long[] readlongArr(int l) throws Exception {
        long[] arr = new long[l];
        for (int i = 0; i < l; i++)
            arr[i] = sc.nextLong();
        return arr;
    }

    public static void printarr(int[] arr) {
        // for debugging only
        for (int x : arr)
            System.out.print(x + " ");
        System.out.println();
    }

    public static void printlongarr(long[] arr) {
        // for debugging only
        for (long x : arr)
            System.out.print(x + " ");
        System.out.println();
    }
}

class DSU {

    int par[];
    int size[];

    DSU(int n) {
        par = new int[n + 1];
        size = new int[n + 1];
        Arrays.fill(size, 1);
        for (int i = 0; i <= n; i++) {
            par[i] = i;
        }
    }

    public int findLeader(int node) {
        if (node == par[node])
            return node;
        return par[node] = findLeader(par[node]); // path comp
    }

    public void unionbySize(int u, int v) {
        int UparU = findLeader(u);
        int UparV = findLeader(v);

        if (UparU == UparV)
            return;
        if (size[UparU] < size[UparV]) {
            par[UparU] = UparV;
            size[UparV] += size[UparU];
        } else {
            par[UparV] = UparU;
            size[UparU] += size[UparV];
        }
    }

}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
1
5 3 15
10 10 10 10 10
```

### Explanation:
1. **Test Case Description:**
   - **n = 5**: There are 5 sections in the cake.
   - **m = 3**: There are 3 creatures at the tea party.
   - **v = 15**: Each creature requires a piece with a minimum tastiness of 15.

2. **Cake Sections:**
   - The cake sections have tastiness values: 10, 10, 10, 10, 10.

3. **Expected Output:**
   - The creatures require a piece with a minimum tastiness of 15. Each section has a tastiness of 10, so the only way to satisfy the creatures is to give each a piece of 2 or more sections.
   - If Alice gives the first two sections to one creature, the next two sections to another creature, and the last section to the third creature, the creatures will be satisfied.
   - Alice will then have no sections left, so the maximum tastiness she can achieve is 0.

4. **Why This Test Case is Challenging:**
   - This test case exposes the bug in the faulty solution where the algorithm might incorrectly partition the cake, leading to a suboptimal or incorrect result.
   - The equal tastiness of each section makes it easy to see if the algorithm is correctly partitioning the cake to satisfy the creatures' requirements.

5. **Correct Output:**
   - The correct output for this test case should be `0` because Alice cannot get any tastiness for herself while ensuring all creatures are happy.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Alice's Adventures in Cutting Cake
time_limit_ms: 2000
memory_limit_mb: 256
Description: Alice is at the Mad Hatter's tea party! There is a long sheet cake made up of $n$ sections with tastiness values $a_1, a_2, \ldots, a_n$. There are $m$ creatures at the tea party, excluding Alice.

Alice will cut the cake into $m + 1$ pieces. Formally, she will partition the cake into $m + 1$ subarrays, where each subarray consists of some number of adjacent sections. The tastiness of a piece is the sum of tastiness of its sections. Afterwards, she will divvy these $m + 1$ pieces up among the $m$ creatures and herself (her piece can be empty). However, each of the $m$ creatures will only be happy when the tastiness of its piece is $v$ or more.

Alice wants to make sure every creature is happy. Limited by this condition, she also wants to maximize the tastiness of her own piece. Can you help Alice find the maximum tastiness her piece can have? If there is no way to make sure every creature is happy, output $-1$.

Input: Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.

The first line of each test case contains three integers $n, m, v$ ($1\le m\le n\le 2\cdot 10^5$; $1\le v\le 10^9$) — the number of sections, the number of creatures, and the creatures' minimum requirement for tastiness, respectively.

The next line contains $n$ space separated integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$) — the tastinesses of the sections.

The sum of $n$ over all test cases does not exceed $2\cdot 10^5$.

Output: For each test case, output the maximum tastiness Alice can achieve for her piece, or $-1$ if there is no way to make sure every creature is happy.

Examples:
input:
7
6 2 1
1 1 10 1 1 10
6 2 2
1 1 10 1 1 10
6 2 3
1 1 10 1 1 10
6 2 10
1 1 10 1 1 10
6 2 11
1 1 10 1 1 10
6 2 12
1 1 10 1 1 10
6 2 12
1 1 1 1 10 10
output:
22
12
2
2
2
0
-1

Note: For the first test case, Alice can give the first and second section as their own pieces, and then take the remaining $10 + 1 + 1 + 10 = 22$ tastiness for herself. We can show that she cannot do any better.

For the second test case, Alice could give the first and second section as one piece, and the sixth section as one piece. She can then take the remaining $10 + 1 + 1 = 12$ tastiness for herself. We can show that she cannot do any better.

For the seventh test case, Alice cannot give each creature a piece of at least $12$ tastiness.

Buggy Code:
import java.io.*;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastReader sc = new FastReader();
        int t = sc.nextInt();
        while (t-- > 0) {
            solve(sc);
        }
    }

    static void solve(FastReader sc) {
        int n = sc.nextInt();
        int m = sc.nextInt();
        int v = sc.nextInt();

        int[] a = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            a[i] = sc.nextInt();
        }

        int[] prefixSum = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            prefixSum[i] = prefixSum[i - 1] + a[i];
        }

        List<Integer> v1 = new ArrayList<>();
        List<Integer> v2 = new ArrayList<>();
        v1.add(1);
        v2.add(n);

        int s = 0;

        for (int i = 1; i <= n; i++) {
            s += a[i];
            if (s >= v) {
                v1.add(i + 1);
                s = 0;
            }
        }

        s = 0;
        for (int i = n; i >= 1; i--) {
            s += a[i];
            if (s >= v) {
                v2.add(i - 1);
                s = 0;
            }
        }

        if (v1.size() - 1 < m) {
            System.out.println("-1");
            return;
        }

        int ans = 0;

        // Calculate maximum sum for the segments
        for (int i = 0; i <= m; i++) {
            int left = v1.get(i);
            int right = v2.get(m - i);
            int sum = prefixSum[right] - prefixSum[left - 1];
            ans = Math.max(ans, sum);
        }

        System.out.println(ans);
    }

    // Fast input handling class
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
1
5 2 15
10 10 10 10 10
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
#include<iostream>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=1;i<=t;i++){
    int a,b,c;
    cin>>a>>b>>c;
    // a=b=c=0;
    if(a<b && b<c){
        cout<<"STAIR"<<endl;
    }
    else if((a<c && c<b ||c<a &&  a<b)){
        cout<<"PEAK"<<endl;
    }
    else{
        cout<<"NONE"<<endl;
    }
}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
4
0 0 0
1 1 1
9 9 9
5 5 5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
#include <iostream>

int main()
{
 int t;
 std::cin>>t;
 for(int i=0;i<7;i++)
   {
    int a,b,c;
    std::cin>>a>>b>>c;
    if(a<b&&b>c)
     std::cout<<"PEAK\n";
    else if(a<b&&b<c)
     std::cout<<"STAIR\n";
     else
     std::cout<<"NONE\n";

   }

return 0;

}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
0 0 0
9 9 9
1 1 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
#include<iostream>
using namespace std;
int main(){
    long long int t;
    cin>>t ;
    while(t--){

    long long int a , b , c ;
    cin>>a >> b>> c ;
    if(b>a && c >b && c >a) cout<<"STAIR"<<endl;
    else if(b>a &&b > a) cout<<"PEAK"<<endl;
    else cout<<"NONE"<<endl;
}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 2 2
2 2 1
1 1 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
n = int(input())
for i in range(n):
    a, b, c = input().split()
    if a < b and b < c:
        print('STAIR')
    if a < b and b > c:
        print('PEAK')
    if a==b and b==c or a > b:
        print('NONE')

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 1 1
2 2 3
9 8 7
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
t=int(input())
for _ in range(t):
  a=list(map(int,input().split()))
  k=list(a)
  a.sort()
  s=set(a)
  if len(s)<len(a):
    print("NONE")
  elif k==a:
    print("STAIR")
  elif k[1]==a[-1]:
    print("PEAK")
  else:
    print("NONE")

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 2 2
2 2 1
1 2 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
t=int(input())
for i in range(t):
    a,b,c= map(int, input().split())
    if a<b:
        if b<c:
            print("STAIR")
        else:
            print("PEAK")
    else:
        print("NONE")

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
4
0 1 1
1 1 2
2 2 2
1 2 2
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
import java.util.*;
public class Main
{
	public static void main(String[] args) {
	    Scanner s=new Scanner(System.in);
	    int t=s.nextInt();
	    while(t-->0){
	        int a=s.nextInt(),b=s.nextInt(),c=s.nextInt();
	        if(a<b){
	            if(b<c) System.out.println("STAIR");
	            else System.out.println("PEAK");
	        }else System.out.println("NONE");
	    }
	}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 2 2
2 2 1
0 9 9
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
import java.util.*;
public class MyClass {
    public static void main(String args[]) {
      Scanner sc=new Scanner(System.in);
      int t=sc.nextInt();
      while(t-- > 0)
      {
           int a=sc.nextInt();
           int b=sc.nextInt();
           int c=sc.nextInt();
           if(a < b)
           {
               if(b < c)
               {
                   System.out.println("STAIR");
               }
               else
               {
                   System.out.println("PEAK");
               }
           }
           else{
               System.out.println("NONE");
           }
      }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
0 0 0
1 1 1
9 9 9
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MN = 1e5+5;
int a[MN];
signed main () {
  int t ; cin >> t ; while (t--){
    int a, b ,c; cin >> a >> b >> c;
    if ( a == b || b == c || c == a ) {
      cout << "NONE" << "\n";
    }
    if ( a > b ) {
      cout << "NONE" <<"\n";
    }
    else if ( b > a && b > c ) {
      cout << "PEAK" << "\n";
    }
    else if ( b > a && c > b ) {
      cout << "STAIR" << "\n";
    }
  }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 1 2
1 2 2
2 2 2
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
#include<bits/stdc++.h>
using namespace std;
#define testcase int t;cin>>t;while(t--)
#define file_txt() freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)
#define int long long
#define pyes cout<<"YES\n"
#define pno cout<<"NO\n"
#define vi vector<int>
#define endl '\n'
#define lcm(a, b) a *b / __gcd(a, b)
#define fl(i, n) for (int i = 0; i < n; i++)
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
void solve(){
    int a,b,c;
    cin >> a >> b >> c;
    (a<b)?(b<c)?cout << "STAIR\n": cout << "PEAK\n" : cout << "NONE\n";
}
signed main(){
    //file_txt();
    optimize();
    testcase{
        solve();
    }

}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To create a challenging test input that exposes the bug in the provided code, we need to consider edge cases and scenarios that can cause the code to fail. The buggy code has a logical error in its conditional checks, which can be exposed by specific inputs.

Let's break down the conditions and think about what could go wrong:

1. **Stair Condition**: \(a < b < c\)
2. **Peak Condition**: \(a < b > c\)
3. **Neither Condition**: Any other combination of \(a\), \(b\), and \(c\).

The code provided uses a nested ternary operator to check these conditions:
```cpp
(a < b) ? (b < c) ? cout << "STAIR\n" : cout << "PEAK\n" : cout << "NONE\n";
```

This logic is flawed because it does not correctly handle the case where \(a < b\) but \(b \not< c\) and \(b \not> c\). Specifically, it will incorrectly output "PEAK" for cases where \(a < b\) and \(b = c\).

### Challenging Test Input
To expose this bug, we can use a test case where \(a < b\) and \(b = c\). This should output "NONE" but the buggy code will output "PEAK".

Here is the test input:

```plaintext
1
1 2 2
```

This input will cause the buggy code to output "PEAK" instead of the correct output "NONE".

### Explanation
- \(a = 1\), \(b = 2\), \(c = 2\)
- \(a < b\) is true (1 < 2)
- \(b < c\) is false (2 < 2 is false)
- \(b > c\) is false (2 > 2 is false)
- Since \(a < b\) is true and both \(b < c\) and \(b > c\) are false, the correct output should be "NONE".

The buggy code will output "PEAK" because it only checks if \(a < b\) and then incorrectly assumes \(b < c\) or \(b > c\) must be true, which it is not.

Thus, the test input:
```plaintext
1
1 2 2
```
will effectively expose the bug in the provided code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
r = int(input())

for i in range(r):
	a,b,c = list(map(int,input().split()))
	if a<b<c:
		print("STAIR")
	elif a>b>c or a==b==c or a>b<c:
		print("NONE")
	elif a<b>c :
		print("PEAK")

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 1 1
2 2 2
3 3 3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
# -*- coding: utf-8 -*-
"""hhh3.ipynb

Automatically generated by Colab.

Original file is located at
    https://colab.research.google.com/drive/1e6WumAbAYkbkqfaCXY83RLNNOu75iTfM
"""

def bla_bla(a, b, c):
    if a < b:
        if b < c:
            return "STAIR"
        else:
            return "PEAK"
    return "NONE"

t = int(input())

for _ in range(t):
    a, b, c= map(int, input().split())
    print(bla_bla(a, b, c))

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 1 2
2 2 2
9 8 7
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
import java.util.Scanner;

public class Q1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        while(t-->0){
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();

            if(a < b){
                if(b < c) System.out.println("STAIR");
                else if(c < b) System.out.println("PEAK");
            }
            else System.out.println("NONE");
        }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
5
0 1 1
1 1 2
2 2 2
9 9 8
8 9 9
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
import java.util.*;
import java.io.*;

public class betngan {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int t = sc.nextInt();
		for (int i = 0; i < t; i++) {
			int a = sc.nextInt();
			int b = sc.nextInt();
			int c = sc.nextInt();
			if (b>a) {
				if (c>b) {
					pw.println("STAIR");
				}else
					pw.println("PEAK");
			}else
				pw.println("NONE");
		}

		pw.flush();
	}

	static class Scanner {

		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String file) throws IOException {
			br = new BufferedReader(new FileReader(file));
		}

		public Scanner(FileReader r) {
			br = new BufferedReader(r);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String readAllLines(BufferedReader reader) throws IOException {
			StringBuilder content = new StringBuilder();
			String line;
			while ((line = reader.readLine()) != null) {
				content.append(line);
				content.append(System.lineSeparator());
			}
			return content.toString();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public long[] nextlongArray(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

		public Long[] nextLongArray(int n) throws IOException {
			Long[] a = new Long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

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

		public Integer[] nextIntegerArray(int n) throws IOException {
			Integer[] a = new Integer[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to focus on edge cases and scenarios where the code might fail. The primary issue in the code is that it does not handle the "NONE" case correctly when `b > a` but `c <= b`. It will incorrectly print "PEAK" in such cases.

Let's consider the following scenarios:
1. `b > a` and `c > b` (STAIR)
2. `b > a` and `c < b` (PEAK)
3. `b > a` and `c = b` (NONE, but the code will print PEAK)
4. `b <= a` (NONE)

To maximize the failure probability, we should include a test case where `b > a` and `c = b` to ensure the code fails.

Here is the test input:

```plaintext
4
1 2 3
1 2 1
1 2 2
3 2 1
```

Explanation:
- The first test case `1 2 3` is a stair, which should output "STAIR".
- The second test case `1 2 1` is a peak, which should output "PEAK".
- The third test case `1 2 2` is neither a stair nor a peak, but the code will incorrectly print "PEAK".
- The fourth test case `3 2 1` is neither a stair nor a peak, which should output "NONE".

This input will help expose the bug in the code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

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

int main()
{
   int t;
   int a,b,c;
   cin>>t;
   while(t--)
   {
    cin>>a>>b>>c;
    if(a<b)
    {
        if(b<c)
            cout<<"STAIR"<<endl;
        else if(b>c)
            cout<<"PEAK"<<endl;
    }
    else
        cout<<"NONE"<<endl;
   }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
0 1 1
9 8 7
5 5 5
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
#include <bits/stdc++.h>
#define mod 10e9
#define ll long long int
#define int long long
using namespace std;

signed main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
int te;
cin>>te;
while(te--){
  int a, b, c;
  cin>>a>>b>>c;
  if(b>a){
      if(b>c){
          cout<<"PEAK"<<endl;
      }
      else if(b<c){
          cout<<"STAIR"<<endl;
      }
  }
  else{
      cout<<"NONE"<<endl;
  }
}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
5
0 0 1
1 1 1
9 8 8
2 2 3
4 4 4
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
case = int(input())

for i in range(case):
    a, b, c = map(int, input().split())
    if a > b:
        print("NONE")
    elif b > a:
        if c > b:
            print("STAIR")
        elif c < b:
            print("PEAK")
    else: print("NONE")

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
4
1 1 1
2 2 3
3 3 2
0 1 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
t=int(input())
for i in range(t):
    a,b,c=map(int,input().split())
    if(b>c and b>a):
        print("PEAK\n")
    elif(a<b and a<c):
        if(b<c):
            print("STAIR\n")
    else:
        print("NONE\n")

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
5
1 2 2
2 2 1
2 1 2
0 9 9
9 9 0
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
import java.util.*;

public class Main {
    public static void main(String[] args) {
      Scanner t=new Scanner(System.in);
      int T=t.nextInt();
      while(T-->0)
      {
        int a=t.nextInt();
        int b=t.nextInt();
        int c=t.nextInt();
        if(a<b && b<c)
        {
          System.out.println("STAIR");
        }
        else if(a<b && b>a)
        {
          System.out.println("PEAK");
        }
        else
        {
          System.out.println("NONE");
        }
      }
  }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
1 1 1
2 2 2
0 9 9
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Stair, Peak, or Neither?
time_limit_ms: 1000
memory_limit_mb: 256
Description: You are given three digits $$$a$$$, $$$b$$$, and $$$c$$$. Determine whether they form a stair, a peak, or neither.

- A stair satisfies the condition $$$a<b<c$$$.
- A peak satisfies the condition $$$a<b>c$$$.

Input: The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.

The only line of each test case contains three digits $$$a$$$, $$$b$$$, $$$c$$$ ($$$0 \leq a$$$, $$$b$$$, $$$c \leq 9$$$).

Output: For each test case, output "STAIR" if the digits form a stair, "PEAK" if the digits form a peak, and "NONE" otherwise (output the strings without quotes).

Examples:
input:
7
1 2 3
3 2 1
1 5 3
3 4 1
0 0 0
4 1 7
4 5 7
output:
STAIR
NONE
PEAK
PEAK
NONE
NONE
STAIR

Note:

Buggy Code:
import java.util.*;
import java.io.*;

public class SolnA {
    public static void main(String[] args) {
        List<List<Integer>> list = Input.inputMethod();

        for (int j = 0; j<list.size(); j++){

            List<Integer> arr = list.get(j);
            int a = arr.get(0);
            int b = arr.get(1);
            int c = arr.get(2);

            if (b>a){
                if (c>b){
                    System.out.println("STAIR");
                }
                else{
                    if (c != b){
                        System.out.println("PEAK");
                    }
                }
            }
            else {
                System.out.println("NONE");
            }
        }
    }

}

class Input{
    static FastReader in = new FastReader();

    public static List<List<Integer>> inputMethod(){
        int a = in.nextInt();
        List<List<Integer>> list= new ArrayList<List<Integer>>(a);

        for (int i = 0; i<a; i++){
            List<Integer> arr= new ArrayList<>(3);

            for (int j = 0; j < 3; j++){
                arr.add(in.nextInt());
            }

            list.add(arr);
        }

        return list;

    }

}

class FastReader
{
    BufferedReader br;
    StringTokenizer st;

    public FastReader()
    {
        br = new BufferedReader(new
                InputStreamReader(System.in));
    }

    String next()
    {
        while (st == null || !st.hasMoreElements())
        {
            try
            {
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e)
            {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    int nextInt()
    {
        return Integer.parseInt(next());
    }

    long nextLong()
    {
        return Long.parseLong(next());
    }

    double nextDouble()
    {
        return Double.parseDouble(next());
    }
    String nextLine()
    {
        String str = "";
        try
        {
            str = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        return str;
    }

    int [] readintarray(int n) {
        int res [] = new int [n];
        for(int i = 0; i<n; i++)res[i] = nextInt();
        return res;
    }
    long [] readlongarray(int n) {
        long res [] = new long [n];
        for(int i = 0; i<n; i++)res[i] = nextLong();
        return res;
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to focus on edge cases and scenarios that can cause the code to fail. The buggy code has a logical issue in handling cases where `b > a` and `c == b`. Specifically, it prints "PEAK" when `c != b`, but it does not handle the case where `c == b`.

Let's consider the following edge cases:
1. `a < b < c` (STAIR)
2. `a < b > c` (PEAK)
3. `a < b == c` (NONE, but the buggy code incorrectly prints "PEAK")
4. `a > b` (NONE)
5. `a == b` (NONE)
6. `a == b == c` (NONE)

Given these cases, we can create a small-scale test input that includes all these scenarios to ensure the code fails when it should.

Here is the test input:

```plaintext
6
1 2 3
1 3 2
1 2 2
3 2 1
1 1 1
1 1 2
```

Explanation:
- `1 2 3` should output "STAIR".
- `1 3 2` should output "PEAK".
- `1 2 2` should output "NONE" but the buggy code will output "PEAK".
- `3 2 1` should output "NONE".
- `1 1 1` should output "NONE".
- `1 1 2` should output "NONE".

This test input is designed to expose the bug in the buggy code where it incorrectly prints "PEAK" for the case `1 2 2`.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Turtle and Three Sequences
time_limit_ms: 3000
memory_limit_mb: 256
Description: Piggy gives Turtle three sequences $a_1, a_2, \ldots, a_n$, $b_1, b_2, \ldots, b_n$, and $c_1, c_2, \ldots, c_n$.

Turtle will choose a subsequence of $1, 2, \ldots, n$ of length $m$, let it be $p_1, p_2, \ldots, p_m$. The subsequence should satisfy the following conditions:

  * $a_{p_1} \le a_{p_2} \le \cdots \le a_{p_m}$;    * All $b_{p_i}$ for all indices $i$ are pairwise distinct, i.e., there don't exist two different indices $i$, $j$ such that $b_{p_i} = b_{p_j}$.

Help him find the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$, or tell him that it is impossible to choose a subsequence of length $m$ that satisfies the conditions above.

Recall that a sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.

Input: The first line contains two integers $n$ and $m$ ($1 \le n \le 3000$, $1 \le m \le 5$) — the lengths of the three sequences and the required length of the subsequence.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le n$) — the elements of the sequence $a$.

The third line contains $n$ integers $b_1, b_2, \ldots, b_n$ ($1 \le b_i \le n$) — the elements of the sequence $b$.

The fourth line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \le c_i \le 10^4$) — the elements of the sequence $c$.

Output: Output a single integer — the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$. If it is impossible to choose a subsequence of length $m$ that satisfies the conditions above, output $-1$.

Examples:
input:
4 2
2 3 4 2
1 3 3 2
1 4 2 3
output:
5

input:
7 3
1 4 5 2 3 6 7
1 2 2 1 1 3 2
1 5 6 7 3 2 4
output:
13

input:
5 3
1 2 3 4 5
1 1 2 1 2
5 4 3 2 1
output:
-1

Note: In the first example, we can choose $p = [1, 2]$, then $c_{p_1} + c_{p_2} = 1 + 4 = 5$. We can't choose $p = [2, 4]$ since $a_2 > a_4$, violating the first condition. We can't choose $p = [2, 3]$ either since $b_2 = b_3$, violating the second condition. We can choose $p = [1, 4]$, but $c_1 + c_4 = 4$, which isn't maximum.

In the second example, we can choose $p = [4, 6, 7]$.

In the third example, it is impossible to choose a subsequence of length $3$ that satisfies both of the conditions.

Buggy Code:
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 3000;
const int MAX_M = 5;

int dp[MAX_N + 1][MAX_M + 1][MAX_N + 1];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, m;
    cin >> n >> m;

    vector<int> a(n), b(n), c(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> b[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> c[i];
    }

    memset(dp, -1, sizeof(dp));
    dp[0][0][0] = 0;

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= min(i, m); ++j) {
            for (int k = 0; k <= n; ++k) {
                if (dp[i][j][k] == -1) continue;
                dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j][k]);
                if (j < m) {
                    bool found = false;
                    for (int l = 0; l < i; ++l) {
                        if (b[l] == b[i]) {
                            found = true;
                            break;
                        }
                    }
                    if (!found && (j == 0 || a[i] >= a[k])) {
                        dp[i + 1][j + 1][i] = max(dp[i + 1][j + 1][i], dp[i][j][k] + c[i]);
                    }
                }
            }
        }
    }

    int ans = -1;
    for (int i = 0; i <= n; ++i) {
        ans = max(ans, dp[n][m][i]);
    }

    cout << ans << endl;

    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided code, we need to focus on scenarios where the conditions for the subsequence are particularly tricky to satisfy. The code seems to have issues with handling the uniqueness of the `b` values and the non-decreasing order of the `a` values. Let's consider a small-scale test input that can highlight these issues:

### Step-by-Step Reasoning:

1. **Length of Sequences (n and m):**
   - Choose a small `n` and `m` to keep the input manageable. For example, `n = 5` and `m = 3`.

2. **Sequence a (Non-decreasing Order):**
   - Ensure that the sequence `a` is such that it has multiple elements that are equal or in non-decreasing order. This will test the condition `a_{p_1} <= a_{p_2} <= ... <= a_{p_m}`.

3. **Sequence b (Pairwise Distinct):**
   - Ensure that the sequence `b` has repeated values to test the condition that all `b_{p_i}` are pairwise distinct.

4. **Sequence c (Maximize Sum):**
   - Assign values to `c` such that the maximum sum can be achieved by a valid subsequence.

### Example Input:

```plaintext
5 3
1 2 2 3 3
1 2 2 3 1
5 4 3 2 1
```

### Explanation:

- **Sequence a:** `1 2 2 3 3` — This sequence is non-decreasing, with some repeated values.
- **Sequence b:** `1 2 2 3 1` — This sequence has repeated values, which will test the pairwise distinct condition.
- **Sequence c:** `5 4 3 2 1` — This sequence has values that decrease, which will make the maximum sum more challenging to achieve.

### Expected Output:

- The expected output should be `-1` because it is impossible to choose a subsequence of length 3 that satisfies both conditions:
  - The subsequence `p = [1, 2, 4]` is invalid because `b[2] = b[4]`.
  - The subsequence `p = [1, 3, 4]` is invalid because `b[3] = b[4]`.
  - The subsequence `p = [1, 2, 5]` is invalid because `b[1] = b[5]`.

This test input should effectively expose the bug in the provided code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Turtle and Three Sequences
time_limit_ms: 3000
memory_limit_mb: 256
Description: Piggy gives Turtle three sequences $a_1, a_2, \ldots, a_n$, $b_1, b_2, \ldots, b_n$, and $c_1, c_2, \ldots, c_n$.

Turtle will choose a subsequence of $1, 2, \ldots, n$ of length $m$, let it be $p_1, p_2, \ldots, p_m$. The subsequence should satisfy the following conditions:

  * $a_{p_1} \le a_{p_2} \le \cdots \le a_{p_m}$;    * All $b_{p_i}$ for all indices $i$ are pairwise distinct, i.e., there don't exist two different indices $i$, $j$ such that $b_{p_i} = b_{p_j}$.

Help him find the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$, or tell him that it is impossible to choose a subsequence of length $m$ that satisfies the conditions above.

Recall that a sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.

Input: The first line contains two integers $n$ and $m$ ($1 \le n \le 3000$, $1 \le m \le 5$) — the lengths of the three sequences and the required length of the subsequence.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le n$) — the elements of the sequence $a$.

The third line contains $n$ integers $b_1, b_2, \ldots, b_n$ ($1 \le b_i \le n$) — the elements of the sequence $b$.

The fourth line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \le c_i \le 10^4$) — the elements of the sequence $c$.

Output: Output a single integer — the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$. If it is impossible to choose a subsequence of length $m$ that satisfies the conditions above, output $-1$.

Examples:
input:
4 2
2 3 4 2
1 3 3 2
1 4 2 3
output:
5

input:
7 3
1 4 5 2 3 6 7
1 2 2 1 1 3 2
1 5 6 7 3 2 4
output:
13

input:
5 3
1 2 3 4 5
1 1 2 1 2
5 4 3 2 1
output:
-1

Note: In the first example, we can choose $p = [1, 2]$, then $c_{p_1} + c_{p_2} = 1 + 4 = 5$. We can't choose $p = [2, 4]$ since $a_2 > a_4$, violating the first condition. We can't choose $p = [2, 3]$ either since $b_2 = b_3$, violating the second condition. We can choose $p = [1, 4]$, but $c_1 + c_4 = 4$, which isn't maximum.

In the second example, we can choose $p = [4, 6, 7]$.

In the third example, it is impossible to choose a subsequence of length $3$ that satisfies both of the conditions.

Buggy Code:
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using pii = pair<int, int>;

const int inf = 1000000007;
const int mod = 998244353;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n + 1), b(n + 1), c(n + 1);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 1; i <= n; ++i) {
    cin >> b[i];
  }
  for (int i = 1; i <= n; ++i) {
    cin >> c[i];
  }
  int ans = -1;
  while (clock() / CLOCKS_PER_SEC < 2.5) {
    vector<vector<int> > dp(n + 1, vector<int> (m + 1, -1));
    vector<int> d(n + 1), z(n + 1, -1);
    for (int i = 1; i <= n; ++i) {
      if (z[b[i]] == -1) {
        z[b[i]] = rng() % m;
      }
      d[i] = z[b[i]];
      dp[i][1] = c[i];
      for (int j = 2; j <= m; ++j) {
        for (int f = 1; f <= i; ++f) {
          if (dp[f][j - 1] != -1 && a[i] >= a[f] && d[i] > d[f]) {
            dp[i][j] = max(dp[i][j], dp[f][j - 1] + c[i]);
          }
        }
      }
      ans = max(ans, dp[i][m]);
    }
  }
  cout << ans << "\n";
}

int main() {

  ios_base :: sync_with_stdio(false);
  cin.tie(nullptr);

  int t = 1;
  //cin >> t;
  while (t--) {
    solve();
  }

  #ifdef LOCALDEF
    cout.flush();
    getchar();
  #endif

  return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the given buggy code, we need to focus on edge cases that are likely to cause issues. The buggy code uses a randomization approach and a dynamic programming (DP) solution, which can lead to incorrect results if not handled properly. Here are some key points to consider:

1. **Non-monotonic sequences for `a` and `b`**: The sequences should not be strictly increasing or decreasing to ensure the subsequence conditions are not trivially satisfied.
2. **Distinct values in `b`**: The values in `b` should be carefully chosen to ensure that the distinctness condition is not easily satisfied.
3. **Maximize the difficulty in finding a valid subsequence**: The values in `c` should be chosen to maximize the potential for high sums, but in a way that makes it challenging to find a valid subsequence.

Given these considerations, let's construct a small-scale test input:

```plaintext
5 3
1 3 2 4 5
1 2 1 3 2
100 10 100 10 100
```

### Explanation:
- **`n = 5` and `m = 3`**: We want to find a subsequence of length 3.
- **`a = [1, 3, 2, 4, 5]`**: This sequence is not strictly increasing or decreasing, making it harder to find a valid subsequence.
- **`b = [1, 2, 1, 3, 2]`**: The values in `b` are not all distinct, which makes it challenging to satisfy the distinctness condition.
- **`c = [100, 10, 100, 10, 100]`**: The values in `c` are high, but the pattern is such that it is difficult to find a valid subsequence that maximizes the sum.

### Expected Output:
- **Output: -1**: It should be impossible to find a subsequence of length 3 that satisfies both conditions.

This test input should expose the bug in the buggy code by making it difficult to find a valid subsequence that meets the given conditions.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Turtle and Three Sequences
time_limit_ms: 3000
memory_limit_mb: 256
Description: Piggy gives Turtle three sequences $a_1, a_2, \ldots, a_n$, $b_1, b_2, \ldots, b_n$, and $c_1, c_2, \ldots, c_n$.

Turtle will choose a subsequence of $1, 2, \ldots, n$ of length $m$, let it be $p_1, p_2, \ldots, p_m$. The subsequence should satisfy the following conditions:

  * $a_{p_1} \le a_{p_2} \le \cdots \le a_{p_m}$;    * All $b_{p_i}$ for all indices $i$ are pairwise distinct, i.e., there don't exist two different indices $i$, $j$ such that $b_{p_i} = b_{p_j}$.

Help him find the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$, or tell him that it is impossible to choose a subsequence of length $m$ that satisfies the conditions above.

Recall that a sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.

Input: The first line contains two integers $n$ and $m$ ($1 \le n \le 3000$, $1 \le m \le 5$) — the lengths of the three sequences and the required length of the subsequence.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le n$) — the elements of the sequence $a$.

The third line contains $n$ integers $b_1, b_2, \ldots, b_n$ ($1 \le b_i \le n$) — the elements of the sequence $b$.

The fourth line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \le c_i \le 10^4$) — the elements of the sequence $c$.

Output: Output a single integer — the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$. If it is impossible to choose a subsequence of length $m$ that satisfies the conditions above, output $-1$.

Examples:
input:
4 2
2 3 4 2
1 3 3 2
1 4 2 3
output:
5

input:
7 3
1 4 5 2 3 6 7
1 2 2 1 1 3 2
1 5 6 7 3 2 4
output:
13

input:
5 3
1 2 3 4 5
1 1 2 1 2
5 4 3 2 1
output:
-1

Note: In the first example, we can choose $p = [1, 2]$, then $c_{p_1} + c_{p_2} = 1 + 4 = 5$. We can't choose $p = [2, 4]$ since $a_2 > a_4$, violating the first condition. We can't choose $p = [2, 3]$ either since $b_2 = b_3$, violating the second condition. We can choose $p = [1, 4]$, but $c_1 + c_4 = 4$, which isn't maximum.

In the second example, we can choose $p = [4, 6, 7]$.

In the third example, it is impossible to choose a subsequence of length $3$ that satisfies both of the conditions.

Buggy Code:
from itertools import combinations
strn=list(input().split(" "))
n=int(strn[0])
m=int(strn[1])
l=[]
w=[]
for i in range(0,3):
    line=list(input().split(" "))[0:n]
    line=[int(x) for x in line]
    l.append(line)
ss=list(set([x for x in l[1]]))
n2=len(ss)
for i in range(0,n2):
    w.append(l[1].index(ss[i]))
comb=combinations(w,m)
prevsum=-1
w=[]
for ctr in comb:
    #ctr=comb[i]
    #ctr=i
    b=True
    tsum=0
    freq=0
    t=set()
    prev=l[0][ctr[0]]
    for j in ctr:
        nextele=l[0][j]
        if prev>(nextele) :
            b=False
        index=j
        if not b:
            for i in range(0,n):
                if l[1][i] == nextele:
                    if l[0][i]>=prev:
                        b=True
                        index=i
                        break
        if not b:
            break
        prev=nextele
        tsum=tsum+l[2][index]
    #print(b,c,ctr)
    if b and tsum>prevsum:
        prevsum=tsum
print(prevsum)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to consider the following aspects:

1. **Non-increasing sequence in `a`**: The code should handle cases where the sequence `a` is not strictly increasing.
2. **Duplicate values in `b`**: The code should handle cases where the sequence `b` contains duplicate values.
3. **Maximizing the sum in `c`**: The code should correctly identify the subsequence that maximizes the sum in `c` while satisfying the conditions.

Let's construct a test case that meets these criteria:

- **Sequence `a`**: Non-increasing.
- **Sequence `b`**: Contains duplicate values.
- **Sequence `c`**: High values to maximize the sum.

Here is a small-scale test input that fits the criteria:

```plaintext
5 3
5 4 3 2 1
1 2 2 1 2
10 20 30 40 50
```

Explanation:
- **Sequence `a`**: `[5, 4, 3, 2, 1]` (non-increasing).
- **Sequence `b`**: `[1, 2, 2, 1, 2]` (contains duplicates).
- **Sequence `c`**: `[10, 20, 30, 40, 50]` (high values to maximize the sum).

The correct subsequence that satisfies the conditions is `[1, 4, 5]` ( indices 1, 4, and 5 in 1-based indexing), which gives the maximum sum of `10 + 40 + 50 = 100`.

This test case should expose the bug in the buggy code, as it handles non-increasing sequences and duplicate values in `b`.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Turtle and Three Sequences
time_limit_ms: 3000
memory_limit_mb: 256
Description: Piggy gives Turtle three sequences $a_1, a_2, \ldots, a_n$, $b_1, b_2, \ldots, b_n$, and $c_1, c_2, \ldots, c_n$.

Turtle will choose a subsequence of $1, 2, \ldots, n$ of length $m$, let it be $p_1, p_2, \ldots, p_m$. The subsequence should satisfy the following conditions:

  * $a_{p_1} \le a_{p_2} \le \cdots \le a_{p_m}$;    * All $b_{p_i}$ for all indices $i$ are pairwise distinct, i.e., there don't exist two different indices $i$, $j$ such that $b_{p_i} = b_{p_j}$.

Help him find the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$, or tell him that it is impossible to choose a subsequence of length $m$ that satisfies the conditions above.

Recall that a sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.

Input: The first line contains two integers $n$ and $m$ ($1 \le n \le 3000$, $1 \le m \le 5$) — the lengths of the three sequences and the required length of the subsequence.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le n$) — the elements of the sequence $a$.

The third line contains $n$ integers $b_1, b_2, \ldots, b_n$ ($1 \le b_i \le n$) — the elements of the sequence $b$.

The fourth line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \le c_i \le 10^4$) — the elements of the sequence $c$.

Output: Output a single integer — the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$. If it is impossible to choose a subsequence of length $m$ that satisfies the conditions above, output $-1$.

Examples:
input:
4 2
2 3 4 2
1 3 3 2
1 4 2 3
output:
5

input:
7 3
1 4 5 2 3 6 7
1 2 2 1 1 3 2
1 5 6 7 3 2 4
output:
13

input:
5 3
1 2 3 4 5
1 1 2 1 2
5 4 3 2 1
output:
-1

Note: In the first example, we can choose $p = [1, 2]$, then $c_{p_1} + c_{p_2} = 1 + 4 = 5$. We can't choose $p = [2, 4]$ since $a_2 > a_4$, violating the first condition. We can't choose $p = [2, 3]$ either since $b_2 = b_3$, violating the second condition. We can choose $p = [1, 4]$, but $c_1 + c_4 = 4$, which isn't maximum.

In the second example, we can choose $p = [4, 6, 7]$.

In the third example, it is impossible to choose a subsequence of length $3$ that satisfies both of the conditions.

Buggy Code:
from itertools import combinations
strn=list(input().split(" "))
n=int(strn[0])
m=int(strn[1])
l=[]
w=[]
for i in range(0,3):
    line=list(input().split(" "))[0:n]
    line=[int(x) for x in line]
    l.append(line)
ss=list(set([x for x in l[1]]))
n=len(ss)
for i in range(0,n):
    w.append(l[1].index(ss[i]))
comb=combinations(w,m)
prevsum=-1
w=[]
for ctr in comb:
    #ctr=comb[i]
    #ctr=i
    b=True
    tsum=0
    freq=0
    t=set()
    prev=l[0][ctr[0]]
    for j in ctr:
        nextele=l[0][j]
        if prev>(nextele) :
            b=False
        if not b:
            for i in range(len(l[1])):
                if l[1][i] == nextele:
                    if l[0][i]>=prev:
                        b=True
        if not b:
            break
        prev=nextele
        tsum=tsum+l[2][j]
    #print(b,c,ctr)
    if b and tsum>prevsum:
        prevsum=tsum
print(prevsum)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To expose the bug in the provided code, we need to focus on edge cases that can highlight the issues in the logic. The code has several potential problems, such as incorrect handling of combinations, incorrect checking of conditions, and potential issues with the index and value comparisons.

### Step-by-Step Analysis:
1. **Combination Handling**: The code uses `combinations` to generate all possible subsequences of length `m`. However, it only considers the first occurrence of each unique value in `b`, which can miss valid subsequences.
2. **Condition Checking**: The code checks if the subsequence is non-decreasing in `a` and if the values in `b` are distinct. However, it does this in a way that can be easily broken by certain edge cases.
3. **Index and Value Comparisons**: The code uses indices from the first occurrence of values in `b`, which can lead to incorrect comparisons and subsequence selection.

### Challenging Test Input:
We need a test input that:
- Has a sequence `a` that is non-decreasing but has repeated values.
- Has a sequence `b` that has repeated values but in a way that makes it difficult to select a valid subsequence.
- Has a sequence `c` that has high values for indices that should be selected, but the code might miss them.

### Test Input:
```plaintext
5 3
1 1 2 2 3
1 2 1 2 3
100 100 100 100 100
```

### Explanation:
- **Sequence `a`**: `[1, 1, 2, 2, 3]` is non-decreasing.
- **Sequence `b`**: `[1, 2, 1, 2, 3]` has repeated values, making it difficult to select a valid subsequence of length 3.
- **Sequence `c`**: `[100, 100, 100, 100, 100]` has high values, which should be selected if a valid subsequence is found.

### Expected Output:
- The expected output should be `300` because the valid subsequence `[1, 2, 3]` can be selected from indices `[0, 2, 4]`, and the sum of `c` values is `100 + 100 + 100 = 300`.

### Why This Input is Challenging:
- The repeated values in `b` and `a` can easily break the logic in the code, especially the part where it only considers the first occurrence of each unique value in `b`.
- The high values in `c` ensure that any valid subsequence should maximize the sum, making it easier to verify if the code is working correctly.

This test input should help expose the bugs in the provided code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Turtle and Three Sequences
time_limit_ms: 3000
memory_limit_mb: 256
Description: Piggy gives Turtle three sequences $a_1, a_2, \ldots, a_n$, $b_1, b_2, \ldots, b_n$, and $c_1, c_2, \ldots, c_n$.

Turtle will choose a subsequence of $1, 2, \ldots, n$ of length $m$, let it be $p_1, p_2, \ldots, p_m$. The subsequence should satisfy the following conditions:

  * $a_{p_1} \le a_{p_2} \le \cdots \le a_{p_m}$;    * All $b_{p_i}$ for all indices $i$ are pairwise distinct, i.e., there don't exist two different indices $i$, $j$ such that $b_{p_i} = b_{p_j}$.

Help him find the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$, or tell him that it is impossible to choose a subsequence of length $m$ that satisfies the conditions above.

Recall that a sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.

Input: The first line contains two integers $n$ and $m$ ($1 \le n \le 3000$, $1 \le m \le 5$) — the lengths of the three sequences and the required length of the subsequence.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le n$) — the elements of the sequence $a$.

The third line contains $n$ integers $b_1, b_2, \ldots, b_n$ ($1 \le b_i \le n$) — the elements of the sequence $b$.

The fourth line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \le c_i \le 10^4$) — the elements of the sequence $c$.

Output: Output a single integer — the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$. If it is impossible to choose a subsequence of length $m$ that satisfies the conditions above, output $-1$.

Examples:
input:
4 2
2 3 4 2
1 3 3 2
1 4 2 3
output:
5

input:
7 3
1 4 5 2 3 6 7
1 2 2 1 1 3 2
1 5 6 7 3 2 4
output:
13

input:
5 3
1 2 3 4 5
1 1 2 1 2
5 4 3 2 1
output:
-1

Note: In the first example, we can choose $p = [1, 2]$, then $c_{p_1} + c_{p_2} = 1 + 4 = 5$. We can't choose $p = [2, 4]$ since $a_2 > a_4$, violating the first condition. We can't choose $p = [2, 3]$ either since $b_2 = b_3$, violating the second condition. We can choose $p = [1, 4]$, but $c_1 + c_4 = 4$, which isn't maximum.

In the second example, we can choose $p = [4, 6, 7]$.

In the third example, it is impossible to choose a subsequence of length $3$ that satisfies both of the conditions.

Buggy Code:
def max_sum_subsequence(a, b, c, m):
    # Sort sequences
    a.sort()
    b.sort()

    # Use a set to keep track of used elements in b
    used_b = set()

    # Initialize variables
    max_sum = 0

    # Try to form a valid subsequence of length m
    for i in range(m):
        # Find the smallest possible value in a that is greater than or equal to the last element in p
        for j in range(i, len(a)):
            if a[j] >= a[i]:
                # Check if b[j] is not already used
                if b[j] not in used_b:
                    # Add a[j] to the subsequence and update used_b
                    used_b.add(b[j])
                    # Add c[j] to the current sum
                    max_sum += c[j]
                    break
        else:
            # If no valid element is found, return -1
            return -1

    return max_sum

# Read input
import sys
input = sys.stdin.read
data = input().split()

n, m = map(int, data[0:2])
a = list(map(int, data[2:2+n]))
b = list(map(int, data[2+n:2+2*n]))
c = list(map(int, data[2+2*n:2+3*n]))

# Output the result
print(max_sum_subsequence(a, b, c, m))

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To expose the bug in the provided code, we need to focus on the following issues:

1. The code incorrectly sorts the sequences `a`, `b`, and `c`, which destroys the original relationships between the elements of these sequences.
2. The code does not correctly handle the constraints that the subsequence of `a` must be non-decreasing and the elements of `b` must be distinct.

Given these points, we need to create a test input where the sorting of `a`, `b`, and `c` will lead to incorrect results. Specifically, we want a scenario where the sorted sequences do not match the original sequences' constraints.

Let's create a small-scale test input:

```plaintext
5 3
1 2 3 4 5
1 2 2 3 3
5 4 3 2 1
```

### Explanation:
- **n = 5, m = 3**: We are given sequences of length 5 and need to find a subsequence of length 3.
- **a = [1, 2, 3, 4, 5]**: This sequence is already non-decreasing.
- **b = [1, 2, 2, 3, 3]**: This sequence has repeated elements, which makes it challenging to form a valid subsequence.
- **c = [5, 4, 3, 2, 1]**: The costs are in descending order.

### Expected Output:
- **-1**: It is impossible to choose a subsequence of length 3 that satisfies both conditions:
  - The subsequence of `a` must be non-decreasing.
  - The elements of `b` must be distinct.

### Why This Test Input Exposes the Bug:
- When the code sorts the sequences, it destroys the original relationships between the elements.
- The code will try to form a subsequence using the sorted `a` and `b`, which will not respect the original constraints.
- The correct solution should recognize that no valid subsequence of length 3 can be formed due to the repeated elements in `b`.

This test input should effectively expose the bug in the provided code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Turtle and Three Sequences
time_limit_ms: 3000
memory_limit_mb: 256
Description: Piggy gives Turtle three sequences $a_1, a_2, \ldots, a_n$, $b_1, b_2, \ldots, b_n$, and $c_1, c_2, \ldots, c_n$.

Turtle will choose a subsequence of $1, 2, \ldots, n$ of length $m$, let it be $p_1, p_2, \ldots, p_m$. The subsequence should satisfy the following conditions:

  * $a_{p_1} \le a_{p_2} \le \cdots \le a_{p_m}$;    * All $b_{p_i}$ for all indices $i$ are pairwise distinct, i.e., there don't exist two different indices $i$, $j$ such that $b_{p_i} = b_{p_j}$.

Help him find the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$, or tell him that it is impossible to choose a subsequence of length $m$ that satisfies the conditions above.

Recall that a sequence $a$ is a subsequence of a sequence $b$ if $a$ can be obtained from $b$ by the deletion of several (possibly, zero or all) elements.

Input: The first line contains two integers $n$ and $m$ ($1 \le n \le 3000$, $1 \le m \le 5$) — the lengths of the three sequences and the required length of the subsequence.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le n$) — the elements of the sequence $a$.

The third line contains $n$ integers $b_1, b_2, \ldots, b_n$ ($1 \le b_i \le n$) — the elements of the sequence $b$.

The fourth line contains $n$ integers $c_1, c_2, \ldots, c_n$ ($1 \le c_i \le 10^4$) — the elements of the sequence $c$.

Output: Output a single integer — the maximum value of $\sum\limits_{i = 1}^m c_{p_i}$. If it is impossible to choose a subsequence of length $m$ that satisfies the conditions above, output $-1$.

Examples:
input:
4 2
2 3 4 2
1 3 3 2
1 4 2 3
output:
5

input:
7 3
1 4 5 2 3 6 7
1 2 2 1 1 3 2
1 5 6 7 3 2 4
output:
13

input:
5 3
1 2 3 4 5
1 1 2 1 2
5 4 3 2 1
output:
-1

Note: In the first example, we can choose $p = [1, 2]$, then $c_{p_1} + c_{p_2} = 1 + 4 = 5$. We can't choose $p = [2, 4]$ since $a_2 > a_4$, violating the first condition. We can't choose $p = [2, 3]$ either since $b_2 = b_3$, violating the second condition. We can choose $p = [1, 4]$, but $c_1 + c_4 = 4$, which isn't maximum.

In the second example, we can choose $p = [4, 6, 7]$.

In the third example, it is impossible to choose a subsequence of length $3$ that satisfies both of the conditions.

Buggy Code:
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,j,k) for(int i=j;i<=k;++i)
#define g(i,j,k) for(int i=j;i>=k;--i)
int n,m,s,l;
inline int read(){
	int x=0,f=1;char ch=getchar();
	for(;'0'>ch||ch>'9';ch=getchar())if(ch=='-')f=-1;
	for(;'0'<=ch&&ch<='9';ch=getchar())x=(x<<3)+(x<<1)+(ch^48);
	return x*f;
}
const int N=3030;
int a[N],b[N],c[N],k;
struct xy{int x,y;int B(){return max(b[x],b[y])*N+min(b[x],b[y]);}int C(){return c[x]+c[y];}};
struct op{
	vector<xy>a;
	void add(xy p){
		for(xy&q:a)if(p.B()==q.B()){if(q.C()<p.C())q=p;return;}
		for(xy&q:a)if(q.C()<p.C()){q=p;return;}
	}
}f[N],g[N],h={{{},{},{},{}}};
#define h(x,y)for(xy x:y.a)
struct Kazemaru{
	int A,B,C,D;op ua,ub;
	void add(int p,int q){
		if(c[p]+c[q]>c[A]+c[B])A=p,B=q,ua=ub=h;
		int va=b[A]!=b[p]&&b[A]!=b[q],vb=b[B]!=b[p]&&b[B]!=b[q];
		if(va)ua.add({p,q});if(vb)ub.add({p,q});
		if(va&&vb&&c[p]+c[q]>c[C]+c[D])C=p,D=q;
	}
	vector<xy>mk(){
		vector<xy>a={{A,B},{C,D}};
		h(e,ua)a.push_back(e);
		h(e,ub)a.push_back(e);
		return a;
	}
}F[N],G[N],H={0,0,0,0,h,h};
inline int ck(int l,int r){return l&&r&&a[l]<=a[r]&&b[l]!=b[r];}
signed main(){
	n=read();m=read();s=-1;
	f(i,1,n)a[i]=read();
	f(i,1,n)b[i]=read();
	f(i,1,n)c[i]=read();
	// n=3000;m=5;s=0;
	// f(i,1,n)a[i]=b[i]=c[i]=i;
	for(;m<5;++m)l+=c[++n]=1e8,a[n]=b[n]=n;
	c[0]=-9e9;
	f(i,1,n){
		f[i]=g[i]=h;F[i]=G[i]=H;
		f(j,1,i)if(ck(j,i))f[i].add({j,0});
		f(j,i,n)if(ck(i,j))g[i].add({j,0});
	}
	f(_,0,1)f(l,1,n)f(r,l,n)if(ck(l,r)){
		h(i,f[l])if(ck(i.x,r))F[r].add(i.x,l);h(j,g[r])if(ck(l,j.x))G[l].add(r,j.x);
	}
	f(i,1,n){
		auto P=F[i].mk(),Q=G[i].mk();
		for(xy p:P)for(xy q:Q)if(ck(p.x,q.x)&&ck(p.x,q.y)&&ck(p.y,q.x)&&ck(p.y,q.y))s=max(s,c[p.x]+c[p.y]+c[i]+c[q.x]+c[q.y]);
	}
	cout<<s-(s?l:1);
	return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
5 3
1 2 3 4 5
1 2 3 4 5
5 4 3 2 1
```