**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
def add(z):

    if len(a)==0:
        a.append(z)
        b.append(a[0]-1)
        #print("len(a)==0",a,b)
    else:
        if z>max(a):
            b.append( z-a[-1]-1 )
            a.append(z)
            a.sort()
            #print("z>max(a)",a,b)
        else:
            if z<min(a):
                b[0] = a[0] - z - 1
                b.insert(0,(z-1))
                a.append(z)
                a.sort()
                #print("z<min(a)",a,b)
            else:
                a.append(z)
                a.sort()
                ind=a.index(z)
                b[ind] = a[ind+1] - z - 1
                b.insert(ind,z - a[ind-1] - 1)
                #print("else",a,b)

def sub(z):

        if z==max(a):
            a.remove(z)
            b.pop(-1)
            #print(a,b)
        else:
            if z==min(a):
                 a.remove(z)
                 b.pop(0)
                 b[0]=a[0]-1
                 #print(a,b)
            else:
                 ind=a.index(z)
                 a.remove(z)
                 b.pop(ind)
                 b[ind]=a[ind]-1-a[ind-1]

def zapros(zz):
    p=''
    for r in range(len(b)):
        if b[r]>=zz:
            p=r
            break
    if p=='':
        return 1
        #return a[-1]+1

        #itog.append(1)
        #itog.append(max(a)+1)#ошибка
        #itog.append(a[-1]+1)#ошибка
    else:
        if p==0:
            return 1
            #itog.append(1)
        else:
            #sst+=str(a[p-1]+1)+" "
            #itog.append( a[p-1]+1 )#здесь норм
            return a[p-1]+1

sl={"+":lambda v: add(v), "-":lambda n: sub(n),"?":lambda m:zapros(m)}

for t in range(int(input())):
    sst=''
    itog=[]
    dl=int(input())
    a=list(map(int,input().split(' ')))
    a1=a.copy()
    b = list(map( lambda x:a[x+1]-a[x]-1 , range(dl-1) ))
    b.insert(0,a[0]-1)
    for f in range(int(input())):
        zz=list(input().split(' '))
        aa=sl[zz[0]](int(zz[1]))
        if aa!=None:
            sst+=str(aa)+" "
    if a1==[1,2,5,905,2000000]:
        itog=[2,2,1,6,3,8,8,2000001]
    if a1==[3,4,5,6,8]:
        itog=[9,9,9,7]
    if a1==[6,7,8,9,10]:
        itog=[1,1]
    if itog!=[]:
        print(*itog)
    else:
        print(sst)

**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
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
import sys

input = lambda: sys.stdin.readline().rstrip("\r\n")
rint = lambda: int(input())
rlist = lambda: list(map(int, input().split()))
rlist2  = lambda: input().split()

def bit_ceil(n):
    x = 1
    while x < n: x *= 2
    return x

def countr_zero(n):
    for i in range(32):
        if n & 1 << i:
            return i
    return 32

class Segtree:
    def __init__(self, v):
        n = len(v)
        self._n = n
        self.size = bit_ceil(n)
        self.log = countr_zero(self.size)
        self.d = [e() for _ in range(2 * self.size)]
        for i in range(n):
            self.d[self.size + i] = v[i]
        for i in range(self.size - 1, 0, -1):
            self.update(i)

    def _psh(self, p):
        for i in range(self.log, 0, -1):
            self.push(p >> i)

    def _upd(self, p):
        for i in range(1, self.log + 1):
            self.update(p >> i)

    def set(self, p, x):
        assert 0 <= p and p < self._n
        p += self.size
        self.d[p] = x
        self._upd(p)

    def get(self, p):
        assert 0 <= p and p < self._n
        return self.d[p + self.size]

    def prod(self, l, r):
        # assert 0 <= l and l <= r and r <= self._n
        l = max(l, 0)
        r = min(r, self._n)

        if l >= r: return e()
        l += self.size
        r += self.size
        sml, smr = e(), e()
        while l < r:
            if l & 1:
                sml = op(sml, self.d[l])
                l += 1
            if r & 1:
                r -= 1
                smr = op(self.d[r], smr)
            l >>= 1
            r >>= 1

        return op(sml, smr)

    def all_prod(self):
        return self.d[1]

    # maximum i s.t. g(a[l]...a[i]) == True
    def max_right(self, l, g):
        assert 0 <= l and l <= self._n
        assert g(e())
        if l == self._n: return self._n
        l += self.size
        sm = e()
        while True:
            while l % 2 == 0: l >>= 1
            if not g(op(sm, self.d[l])):
                while l < self.size:
                    l = 2 * l
                    if g(op(sm, self.d[l])):
                        sm = op(sm, self.d[l])
                        l += 1
                return l - self.size
            sm = op(sm, self.d[l])
            l += 1
            if l & -l == l:
                break
        return self._n

    # minimum i s.t. g(a[i]...a[r - 1]) == True
    def min_left(self, r, g):
        assert 0 <= r and r <= self._n
        assert g(e())
        if r == 0: return 0
        r += self.size
        sm = e()
        while True:
            r -= 1
            while r > 1 and r % 2: r >>= 1
            if not g(op(self.d[r], sm)):
                while r < self.size:
                    r = 2 * r + 1
                    if g(op(self.d[r], sm)):
                        sm = op(self.d[r], sm)
                        r -= 1
                return r + 1 - self.size
            sm = op(self.d[r], sm)
            if r & -r == r:
                break
        return 0

    def update(self, k):
        self.d[k] = op(self.d[2 * k], self.d[2 * k + 1])

def op(l, r):
    pref = l[1]
    if l[1] == l[0]:
        pref += r[1]
    suff = r[2]
    if r[2] == r[0]:
        suff += l[2]
    return (l[0] + r[0], pref, suff, max(l[3], l[2] + r[1], r[3]))

def e():
    return (0, 0, 0, 0)

def z():
    return (1, 0, 0, 0)

def one():
    return (1, 1, 1, 1)

target = 0
MX = 2* (10**6) +2
tr = Segtree([one() for _ in range(MX)])
tr.set(MX-1,(MX,MX,MX,MX))
s = set()

def solve():
    n = rint()
    a = rlist()
    m = rint()
    ops = [input().split() for _ in range(m)]
    for x in a:
        s.add(x)
        tr.set(x, z())

    ans = []
    for op, arg in ops:
        x = int(arg)
        if op == "+":
            s.add(x)
            tr.set(x, z())

        elif op == "-":
            s.discard(x)
            tr.set(x, one())
        else:
            r = tr.max_right(1, lambda y: y[-1] < x)
            if r==MX-1:
                r+=x-tr.prod(0,MX-1)[2]-1
            print(r+1-x,end=' ')
    print()
    for x in s:
        tr.set(x, one())
    s.clear()

t=1
t=rint()
for _ in range(t):
    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:
```plaintext
1
5
1 2 3 4 5
10
- 5
? 1
- 4
? 1
- 3
? 1
- 2
? 1
- 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: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
class GameEngine:
    def __init__(self, n, initial_set):
        self.current_set = set(initial_set)
        self.sorted_list = [0] + sorted(initial_set)
        self.differs = []
        for i in range(1, len(self.sorted_list)):
            self.differs.append(self.sorted_list[i] - self.sorted_list[i - 1])

    def insert(self, x):
        self.current_set.add(x)
        if x > self.sorted_list[-1]:
            self.sorted_list.append(x)
            self.differs.append(x - self.sorted_list[-1])
        elif self.sorted_list[0] < x < self.sorted_list[-1]:
            i = 0
            while x > self.sorted_list[i]:
                i += 1
            self.sorted_list = self.sorted_list[:i] + [x] + self.sorted_list[i:]
            self.differs = self.differs[:i - 1] + [x - self.sorted_list[i - 1]] + [self.sorted_list[i + 1] - x] + self.differs[i:]

    def delete(self, x):
        self.current_set.remove(x)
        t = self.sorted_list.index(x)
        self.sorted_list.remove(x)
        if t == len(self.sorted_list):
            self.differs.pop(-1)
        else:
            self.differs = self.differs[:t - 1] + [self.differs[t - 1] + self.differs[t]] + self.differs[t + 1:]

    def query_k_load(self, k):
        if not self.differs or not self.current_set or not self.sorted_list:
            return 1
        for i in range(len(self.differs)):
            if k < self.differs[i]:
                return self.sorted_list[i] + 1
        return self.sorted_list[-1] + 1

for _ in range(int(input())):
    n = int(input())
    initial_set = [int(x) for x in input().split()]
    m = int(input())
    game_engine = GameEngine(n, initial_set)
    ans = []
    for _ in range(m):
        ox = input().split()
        op_type, x = ox[0], int(ox[1])
        if op_type == '+':
            game_engine.insert(x)
        elif op_type == '-':
            game_engine.delete(x)
        elif op_type == '?':
            k = x
            k_load_result = game_engine.query_k_load(k)
            ans.append(k_load_result)
    print(*ans)

**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 are likely to cause issues. Here are some key points to consider:

1. **Initial Set and Operations:**
   - Ensure the initial set is well-defined and covers a range of values.
   - Include operations that insert and delete elements, especially those that affect the boundaries of the set.
   - Test the `query_k_load` function with different values of `k`, especially those that are large or edge cases.

2. **Edge Cases:**
   - Test with an empty set.
   - Test with a set that has only one element.
   - Test with a set that has consecutive elements.
   - Test with a set that has large gaps.

3. **Operations:**
   - Test operations that insert and delete elements at the boundaries of the set.
   - Test operations that insert and delete elements in the middle of the set.
   - Test operations that create large gaps in the set.

Given these considerations, here is a small-scale test input that should expose potential bugs in the code:

```plaintext
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
```

This test input includes:
- Multiple test cases with different initial sets.
- Operations that insert and delete elements at various positions.
- Queries for different values of `k` to test the `query_k_load` function.

This should help in identifying any issues in the provided buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

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

public class Main {
    static int M = (int)2e6 + 1;
    public static void main(String[] args) {
        SegTree segTree = new SegTree(M);
        TreeSet<Integer>[] a = new TreeSet[M + 1];
        Reader sc = new Reader();
        int t = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        while (t-- > 0) {
            int n = sc.nextInt();
            TreeSet<Integer> set = new TreeSet<>();
            set.add(0);
            for (int i = 0; i < n; i++) {
                set.add(sc.nextInt());
            }
            set.add((int)5e6);
            Arrays.setAll(a, key -> new TreeSet<>());
            int pre = -1;
            for (int x : set) {
                int len = x - pre - 1;
                len = Math.min(len, M);
                a[len].add(pre + 1);
                Integer nw = a[len].first();
                len = Math.min(len, M);
                segTree.set(len, nw);
                pre = x;
            }
            int m = sc.nextInt();
            while (m-- > 0) {
                char op = sc.nextChar();
                int x = sc.nextInt();
                if (op == '+') {
                    set.add(x);
                    int low = set.lower(x), high = set.higher(x);
                    int len = high - low - 1;
                    len = Math.min(len, M);
                    a[len].remove(low + 1);
                    int nw = a[len].isEmpty()? M : a[len].first();
                    segTree.set(len, nw);

                    len = x - low - 1;
                    len = Math.min(len, M);
                    a[len].add(low + 1);
                    nw = a[len].first();
                    segTree.set(len, nw);

                    len = high - x - 1;
                    len = Math.min(len, M);
                    a[len].add(x + 1);
                    nw = a[len].first();
                    segTree.set(len, nw);
                } else if (op == '-') {
                    set.remove(x);
                    int low = set.lower(x), high = set.higher(x);
                    int len = high - low - 1;
                    len = Math.min(len, M);
                    a[len].add(low + 1);
                    int nw = a[len].first();
                    segTree.set(len, nw);

                    len = x - low - 1;
                    len = Math.min(len, M);
                    a[len].remove(low + 1);
                    nw = a[len].isEmpty()? M : a[len].first();
                    segTree.set(len, nw);

                    len = high - x - 1;
                    len = Math.min(len, M);
                    a[len].remove(x + 1);
                    nw = a[len].isEmpty()? M : a[len].first();
                    segTree.set(len, nw);
                } else {
                    sb.append(segTree.min(x, M)).append(' ');
                }
            }
            pre = -1;
            for (int x : set) {
                int len = x - pre - 1;
                len = Math.min(len, M);
                a[len].clear();
                len = Math.min(len, M);
                segTree.set(len, M);
                pre = x;
            }
            sb.append('\n');
        }
        System.out.print(sb);
    }
}
class SegTree {
    int n;
    int[] mi;
    SegTree(int n) {
        this.n = n + 1;
        mi = new int[this.n * 2];
        Arrays.fill(mi, Main.M);
    }

    void set(int x, int v) {
        x += n;
        mi[x] = v;
        while (x > 0) {
            int fa = x / 2;
            mi[fa] = Math.min(mi[fa * 2], mi[fa * 2 + 1]);
            x = fa;
        }
    }

    long min(int x, int y) {
        int res = Main.M;
        x += n;
        y += n;
        while (x <= y) {
            if (x % 2 == 1) res = Math.min(res, mi[x++]);
            if (x > y) break;
            if (y % 2 == 0) res = Math.min(res, mi[y--]);
            x /= 2;
            y /= 2;
        }
        return res;
    }

}

class Reader {
    InputStream in = System.in;
    byte[] buffer = new byte[1024];
    int cur = 0, len = 0;
    private byte nextByte() {
        if (cur >= len) {
            try {
                cur = 0;
                this.len = this.in.read(buffer);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        if (len <= 0) {
            return -1;
        }
        return buffer[cur++];
    }
    char nextChar() {
        byte res;
        while ((res = nextByte()) != -1 && (res == ' ' || res == '\n'))
            ;
        return (char) res;
    }
    int nextInt() {
        int res = 0, flag = 1;
        byte c = 0;
        while ((c = nextByte()) != -1 && (c != '-' && !Character.isDigit((char)c)))
            ;
        if (c == '-') {
            flag = -1;
            c = nextByte();
        } else if (c == '+') {
            c = nextByte();
        }
        do {
            res = res * 10 + c - '0';
        } while ((c = nextByte()) != -1 && Character.isDigit(c));
        return res * flag;
    }
}

**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
1 2 3 4 5
10
? 1
? 2
? 3
? 4
? 5
- 3
? 1
? 2
? 3
? 4
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

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

public class SolutionCodeforces2000H {
    static final long MOD = 1_000_000_007;

    static class Pair implements Comparable<Pair> {

        public int first, second;

        public Pair(int first, int second) {
            this.first = first;
            this.second = second;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Pair pair = (Pair) o;
            return first == pair.first && second == pair.second;
        }

        @Override
        public int hashCode() {
            return Objects.hash(first, second);
        }

        @Override
        public int compareTo(Pair o) {
            if (first != o.first)
                return Integer.compare(first, o.first);
            return Integer.compare(second, o.second);
        }
    }

    public static void main(String[] args) throws FileNotFoundException {
        // InputStream is = new FileInputStream("input.txt");
        InputStream is = System.in;

        // Scanner in = new Scanner(is);
        FastScanner in = new FastScanner(is);
        PrintWriter out = new PrintWriter(System.out);
        // PrintWriter out = new PrintWriter(new FileOutputStream("output.txt"));

        int tn = in.nextInt();
        for (int tc = 0; tc < tn; tc++) {
            int n = in.nextInt();
            TreeSet<Integer> a = new TreeSet<>();
            TreeSet<Pair> skip = new TreeSet<>();
            a.add(0);
            int prev = 0;
            for (int i = 0; i < n; i++) {
                int cur = in.nextInt();
                a.add(cur);
                skip.add(new Pair(cur - prev, prev));
                prev = cur;
            }
            a.add(5000000);
            skip.add(new Pair(5000000 - prev, prev));
            int m = in.nextInt();
            for (int i = 0; i < m; i++) {
                String op = in.next();
                int x = in.nextInt();
                switch (op) {
                    case "+":
                        skip.remove(new Pair(a.ceiling(x) - a.floor(x), a.floor(x)));
                        skip.add(new Pair(a.ceiling(x) - x, x));
                        skip.add(new Pair(x - a.floor(x), a.floor(x)));
                        a.add(x);
                        break;
                    case "-":
                        a.remove(x);
                        skip.add(new Pair(a.ceiling(x) - a.floor(x), a.floor(x)));
                        skip.remove(new Pair(a.ceiling(x) - x, x));
                        skip.remove(new Pair(x - a.floor(x), a.floor(x)));
                        break;
                    default:
                        out.print(skip.ceiling(new Pair(x + 1, 0)).second + 1 + " ");
                }
            }
            out.println();
        }

        out.close();
    }

    static class FastScanner {
        private final BufferedReader br;
        private StringTokenizer st = new StringTokenizer("");

        public FastScanner(InputStream is) throws FileNotFoundException {
            br = new BufferedReader(new InputStreamReader(is));
        }

        public String next() {
            while (!st.hasMoreTokens())
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException ignored) {
                }
            return st.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(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
1 2 3 4 5
10
- 5
? 1
? 2
? 3
? 4
? 5
+ 6
? 1
? 2
? 3
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
#include<bits/stdc++.h>
#define Alex std::ios::sync_with_stdio(false),std::cin.tie(0),std::cout.tie(0);
using namespace std;
#define int long long
#define double long double
const int QAQ = 0;
const int mod = 1e9 + 7;
const double eps = 1e-10;
const double pi = std::acos(-1.0);
const int R = 4000000;
int a[R << 1],Ans[R << 1],n,m,gh;
int T[17000005];
std::set<int> S;

inline void Update_Tree(int k,int l,int r,int x,int v)
{
	if(l == r)
	{
		T[k] = v;
		return;
	}
	int mid = (l + r) >> 1;
	if(x <= mid) Update_Tree(k << 1,l,mid,x,v);
	if(x > mid) Update_Tree(k << 1 | 1,mid + 1,r,x,v);
	T[k] = std::max(T[k << 1],T[k << 1 | 1]);
	return;
}
inline void Read_Tree(int x)
{
	std::set<int>::iterator IT = S.lower_bound(x);
	int r = *IT;
	--IT;
	int l = *IT;
	Update_Tree(1,1,R,l + 1,x - l - 1);
	Update_Tree(1,1,R,x + 1,r - x - 1);
	S.insert(x);
	return;
}
inline void Erase_Tree(int x)
{
	S.erase(x);
	std::set<int>::iterator IT = S.lower_bound(x);
	int r = *IT;
	--IT;
	int l = *IT;
	Update_Tree(1,1,R,x + 1,0);
	Update_Tree(1,1,R,l + 1,r - l - 1);
	return;
}
inline int Query_Tree(int k,int l,int r,int x)
{
	if(l == r)
	{
		return l;
	}
	int mid = (l + r) >> 1;
	if(T[k << 1] >= x) return Query_Tree(k << 1,l,mid,x);
	return Query_Tree(k << 1 | 1,mid + 1,r,x);
}
signed main()
{
	Alex;
	int _;
	_ = 1;
	std::cin>>_;
	while(_--)
	{
		//std::cout<<R<<'\n';
		std::cin>>n;
		S.insert(0);
		S.insert(R + 1);
		Update_Tree(1,1,R,1,R);
		for(int i = 1;i <= n;i++)
		{
			std::cin>>a[i];
			Read_Tree(a[i]);
		}
		std::cin>>m;
		gh = 0;
		for(int i = 1;i <= m;i++)
		{
			char op;
			std::cin>>op;
			if(op == '-')
			{
				int x;
				std::cin>>x;
				Erase_Tree(x);
			}
			if(op == '+')
			{
				int x;
				std::cin>>x;
				Read_Tree(x);
			}
			if(op == '?')
			{
				int k;
				std::cin>>k;
				gh++;
				Ans[gh] = Query_Tree(1,1,R,k);
			}
		}
		for(int i = 1;i <= gh - 1;i++) std::cout<<Ans[i]<<' ';
		std::cout<<Ans[gh]<<'\n';
		while("gh" == "gh")
		{
			std::set<int>::iterator IT = S.begin();
			++IT;
			if(*IT == R + 1) break;
			Erase_Tree(*IT);
		}
	}
	return QAQ;
}

**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
3
1 2 3
5
+ 5
? 2
- 2
? 2
? 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

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

using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
#define IO ios::sync_with_stdio(0)
#define tie cin.tie(0), cout.tie(0)
#define int long long
const int maxm = 9e6 + 20;
using i64 = long long;

struct node
{
    int l, r, ps, ls, ms;
} tr[maxm];

void pushup(node &a, node &b, node &c)
{
    if (b.ps == b.r - b.l + 1)
    {
        a.ps = b.ps + c.ps;
    }
    else
    {
        a.ps = b.ps;
    }
    if (c.ls == c.r - c.l + 1)
    {
        a.ls = b.ls + c.ls;
    }
    else
    {
        a.ls = c.ls;
    }
    a.ms = max({a.ps, a.ls, b.ls + c.ps});
}
void build(int p, int l, int r)
{
    tr[p].l = l, tr[p].r = r;
    if (l == r)
    {
        tr[p] = {l, l, 1, 1, 1};
        return;
    }
    int mid = (l + r) >> 1;
    build(p << 1, l, mid);
    build(p << 1 | 1, mid + 1, r);
    pushup(tr[p], tr[p << 1], tr[p << 1 | 1]);
}
void modify(int p, int pos)
{
    if (pos == tr[p].l && tr[p].r == pos)
    {
        tr[p].ms ^= 1;
        tr[p].ps = tr[p].ls = tr[p].ms;
        return;
    }
    int mid = (tr[p].l + tr[p].r) >> 1;
    if (mid >= pos)
    {
        modify(p << 1, pos);
    }
    else
        modify(p << 1 | 1, pos);

    pushup(tr[p], tr[p << 1], tr[p << 1 | 1]);
}
int query(int p, int k)
{
    if (tr[p].l == tr[p].r)
        return tr[p].l;
    if (tr[p << 1].ms >= k)
    {
        return query(p << 1, k);
    }
    if (tr[p << 1].ls + tr[p << 1 | 1].ps >= k)
    {
        return tr[p << 1].r - tr[p << 1].ls + 1;
    }
    return query(p << 1 | 1, k);
}

void solve()
{

    set<int> s;

    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        s.insert(x);
        modify(1, x);
    }

    int m;
    cin >> m;

    while (m--)
    {
        char op;
        int x;
        cin >> op >> x;
        if (op == '+')
        {
            s.insert(x);
            modify(1, x);
        }
        else if (op == '-')
        {
            s.erase(x);
            modify(1, x);
        }
        else
        {
            if (x > tr[1].ms)
            {
                cout << tr[1].r - tr[1].ls + 1 << " ";
                continue;
            }
            cout << query(1, x) << ' ';
        }
    }
    cout << '\n';
    for (auto &x : s)
    {
        modify(1, x);
    }
}

signed main()
{
    IO;
    tie;
    int t = 1;
    cin >> t;
    build(1, 1, 2e6 + 5);
    for (int i = 1; i <= t; i++)
    {
        if (i == 29)
        {
            int n;
            cin >> n;
            cout << n;
            for (int x, i = 1; i <= n; i++)
            {
                cin >> x;
                cout << x << " ";
            }
            int m;
            cin >> m;

            while (m--)
            {
                char op;
                int x;
                cin >> op >> x;
                cout << op << " " << x << "\n";
            }
        }
        else
            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 generate a challenging test input that exposes the bug in the given buggy code, we need to focus on edge cases and scenarios that might cause the code to fail. Here are the steps to create such a test input:

1. **Initial Set with Gaps**: Start with an initial set that has gaps, which can make the $k$-load calculation non-trivial.
2. **Operations that Modify the Set**: Include operations that insert and remove elements, especially those that can change the gaps in the set.
3. **Queries for Different $k$-loads**: Include queries for different values of $k$ to ensure the $k$-load calculation is correct after each modification.

Let's create a small-scale test input that fits these criteria:

```plaintext
1
5
1 2 4 6 8
10
+ 3
? 2
- 2
? 2
+ 5
? 3
- 4
? 3
+ 7
? 4
```

### Explanation:
1. **Initial Set**: `{1, 2, 4, 6, 8}`. This set has gaps between the numbers.
2. **Operations**:
   - **Insert 3**: The set becomes `{1, 2, 3, 4, 6, 8}`.
   - **Query 2**: The $2$-load of `{1, 2, 3, 4, 6, 8}` should be `5` (since `5` and `6` are absent).
   - **Remove 2**: The set becomes `{1, 3, 4, 6, 8}`.
   - **Query 2**: The $2$-load of `{1, 3, 4, 6, 8}` should be `2` (since `2` and `3` are absent).
   - **Insert 5**: The set becomes `{1, 3, 4, 5, 6, 8}`.
   - **Query 3**: The $3$-load of `{1, 3, 4, 5, 6, 8}` should be `2` (since `2`, `3`, and `4` are absent).
   - **Remove 4**: The set becomes `{1, 3, 5, 6, 8}`.
   - **Query 3**: The $3$-load of `{1, 3, 5, 6, 8}` should be `2` (since `2`, `3`, and `4` are absent).
   - **Insert 7**: The set becomes `{1, 3, 5, 6, 7, 8}`.
   - **Query 4**: The $4$-load of `{1, 3, 5, 6, 7, 8}` should be `2` (since `2`, `3`, `4`, and `5` are absent).

This test input is designed to cover various edge cases and should help expose any bugs in the given buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
# ﷽
import sys
import heapq
from heapq import *
from math import log2,ceil,floor,gcd,sqrt,log,perm,comb,factorial
from random import randrange
from bisect import bisect_left
from collections import defaultdict, Counter, deque, OrderedDict
from functools import lru_cache, reduce
from bisect import bisect_left, bisect_right
from types import GeneratorType

input = lambda: sys.stdin.buffer.readline().decode().rstrip()

"""
The "sorted list" data-structure, with amortized O(n^(1/3)) cost per insert and pop.

Example:

A = SortedList()
A.insert(30)
A.insert(50)
A.insert(20)
A.insert(30)
A.insert(30)

print(A) # prints [20, 30, 30, 30, 50]

print(A.lower_bound(30), A.upper_bound(30)) # prints 1 4

print(A[-1]) # prints 50
print(A.pop(1)) # prints 30

print(A) # prints [20, 30, 30, 50]
print(A.count(30)) # prints 2

"""

from bisect import bisect_left as lower_bound
from bisect import bisect_right as upper_bound

class FenwickTree:
    def __init__(self, x):
        bit = self.bit = list(x)
        size = self.size = len(bit)
        for i in range(size):
            j = i | (i + 1)
            if j < size:
                bit[j] += bit[i]

    def update(self, idx, x):
        """updates bit[idx] += x"""
        while idx < self.size:
            self.bit[idx] += x
            idx |= idx + 1

    def __call__(self, end):
        """calc sum(bit[:end])"""
        x = 0
        while end:
            x += self.bit[end - 1]
            end &= end - 1
        return x

    def find_kth(self, k):
        """Find largest idx such that sum(bit[:idx]) <= k"""
        idx = -1
        for d in reversed(range(self.size.bit_length())):
            right_idx = idx + (1 << d)
            if right_idx < self.size and self.bit[right_idx] <= k:
                idx = right_idx
                k -= self.bit[idx]
        return idx + 1, k

class SortedList:
    block_size = 700

    def __init__(self, iterable=()):
        self.macro = []
        self.micros = [[]]
        self.micro_size = [0]
        self.fenwick = FenwickTree([0])
        self.size = 0
        for item in iterable:
            self.insert(item)

    def insert(self, x):
        i = lower_bound(self.macro, x)
        j = upper_bound(self.micros[i], x)
        self.micros[i].insert(j, x)
        self.size += 1
        self.micro_size[i] += 1
        self.fenwick.update(i, 1)
        if len(self.micros[i]) >= self.block_size:
            self.micros[i:i + 1] = self.micros[i][:self.block_size >> 1], self.micros[i][self.block_size >> 1:]
            self.micro_size[i:i + 1] = self.block_size >> 1, self.block_size >> 1
            self.fenwick = FenwickTree(self.micro_size)
            self.macro.insert(i, self.micros[i + 1][0])

    def pop(self, k=-1):
        i, j = self._find_kth(k)
        self.size -= 1
        self.micro_size[i] -= 1
        self.fenwick.update(i, -1)
        return self.micros[i].pop(j)

    def __getitem__(self, k):
        i, j = self._find_kth(k)
        return self.micros[i][j]

    def count(self, x):
        return self.upper_bound(x) - self.lower_bound(x)

    def __contains__(self, x):
        return self.count(x) > 0

    def lower_bound(self, x):
        i = lower_bound(self.macro, x)
        return self.fenwick(i) + lower_bound(self.micros[i], x)

    def upper_bound(self, x):
        i = upper_bound(self.macro, x)
        return self.fenwick(i) + upper_bound(self.micros[i], x)

    def _find_kth(self, k):
        return self.fenwick.find_kth(k + self.size if k < 0 else k)

    def __len__(self):
        return self.size

    def __iter__(self):
        return (x for micro in self.micros for x in micro)

    def __repr__(self):
        return str(list(self))

big = 10**8

def solve():
    n = int(input())
    arr = [0] + list(map(int,input().split())) + [big,3*big]
    A = SortedList()
    B = SortedList()
    cnt = {ai:0 for ai in arr}
    ans = {ai:0 for ai in arr}

    for i,ai in enumerate(arr[:-1])  :
        cnt[ai] += 1
        A.insert(ai)
        B.insert((arr[i+1]-ai-1,ai))
        ans[ai] = arr[i+1]-ai-1

    # print(A)

    for _ in range(int(input())) :
        t,x = list(map(str,input().split()))
        x = int(x)
        if t == "+" :
            try :
                cnt[x] += 1
            except :
                cnt[x] = 1
            if cnt[x] == 1 :
                # print(x,A)
                i = A.lower_bound(x)-1
                j = i + 1

                bef = A[i]
                aft = A[j]

                ii = B.lower_bound((ans[bef],bef))
                B.pop(ii)
                # j = B.lower_bound((ans[aft],aft))

                ans[bef] = x-bef -1
                ans[x] = aft-x-1

                B.insert((ans[bef],bef))
                B.insert((ans[x],x))

                A.insert((x))

        elif t == "-" :
            cnt[x] -= 1

            if cnt[x] == 0 :

                i = A.lower_bound(x)

                bef = A[i-1]
                aft = A[i+1]

                j = B.lower_bound((ans[bef],bef))
                B.pop(j)
                j = B.lower_bound((ans[x],x))
                B.pop(j)

                ans[bef] = aft-bef -1

                ans[x] = aft-x-1

                # print(x,bef)
                B.insert((ans[bef],bef))

                A.pop(i)

        else:
            # print(B)
            j = B.upper_bound((x-1,big))
            print(B[j][1] + 1, end = " ")

        # print(B)

    print()

###############################################################################
###############################################################################
###############################################################################

for t in range(int(input())):
    # case(t+1)
    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 generate a challenging test input that exposes the bug in the buggy code for the "Ksyusha and the Loaded Set" problem, we need to focus on edge cases and scenarios that are likely to cause issues. Here are the steps to think through this:

1. **Initial Set Configuration**:
   - Start with a small set of numbers that are closely packed together. This can help in testing the insertion and removal operations more effectively.

2. **Operations to Test**:
   - Include a mix of insertions, deletions, and queries.
   - Test the boundary conditions, such as inserting and deleting the smallest and largest elements.
   - Test operations that can cause the set to become sparse, which can affect the $k$-load calculation.

3. **Edge Cases**:
   - Test with a set that has very few elements.
   - Test with a set that has elements at the extreme ends of the allowed range.
   - Test with a set where the $k$-load is very large.

Based on these considerations, here is a small-scale test input that should be challenging for the buggy code:

```plaintext
3
5
1 2 3 4 5
10
- 3
? 2
+ 6
? 2
- 1
? 1
+ 3
? 2
- 5
? 3
5
1 10 100 1000 1000000
5
? 1
- 1000000
? 1
+ 1000001
? 1
5
1 2 3 4 5
5
? 5
- 1
? 5
- 2
? 5
```

This test input includes:
- A small set of closely packed numbers.
- Operations that remove and insert elements, including the smallest and largest elements.
- Queries for different values of $k$ to test the $k$-load calculation.
- A set with elements at the extreme ends of the allowed range to test edge cases.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
def add(xx,yy,zz):#yy=a,zz=b
    if len(yy)==0:
        yy.append(xx)
        zz.append(yy[0]-1)
        return [yy,zz]
        #print("len(a)==0",a,b)
    else:
        if xx>max(yy):
            zz.append( xx-yy[-1]-1 )
            yy.append(xx)
            yy.sort()
            return [yy,zz]
            #print("z>max(a)",a,b)
        else:
            if xx<min(yy):
                zz[0] = yy[0] - xx - 1
                zz.insert(0,(xx-1))
                yy.append(xx)
                yy.sort()
                return [yy,zz]
                #print("z<min(a)",a,b)
            else:
                yy.append(xx)
                yy.sort()
                ind=yy.index(xx)
                zz[ind] = yy[ind+1] - xx - 1
                zz.insert(ind,xx - yy[ind-1] - 1)
                return [yy,zz]
                #print("else",a,b)

def sub(xx,yy,zz):

        if xx==max(yy):
            yy.remove(xx)
            zz.pop(-1)
            return [yy,zz]
            #print(a,b)
        else:
            if xx==min(yy):
                 yy.remove(xx)
                 zz.pop(0)
                 zz[0]=yy[0]-1
                 return [yy,zz]
                 #print(a,b)
            else:
                 ind=yy.index(xx)
                 yy.remove(xx)
                 zz.pop(ind)
                 zz[ind]=yy[ind]-1-yy[ind-1]
                 return [yy,zz]

def zapros(xx,yy,zz):
    p=''
    for r in range(len(zz)):
        if zz[r]>=xx:
            p=r
            break
    if p==0:
            return 1

    else:
        if p=='':
            if len(yy)==0:
                return 1
            else:
                return max(yy)+1

        else:
            #sst+=str(a[p-1]+1)+" "
            #itog.append( a[p-1]+1 )#здесь норм
            return yy[p-1]+1

sl={"+":lambda x,y,z: add(x,y,z), "-":lambda x,y,z: sub(x,y,z),"?":lambda x,y,z:zapros(x,y,z)}

for t in range(int(input())):
    sst=''
    itog=[]
    dl=int(input())
    a=list(map(int,input().split(' ')))
    a1=a.copy()
    b = list(map( lambda x:a[x+1]-a[x]-1 , range(dl-1) ))
    b.insert(0,a[0]-1)
    maxc=0
    maxc=max(a)
    for f in range(int(input())):
        zz=list(input().split(' '))
        aa=sl[zz[0]](int(zz[1]),a,b)
        if type(aa)==list:
            a=aa[0]
            b=aa[1]
        else:
            if type(aa)==int:
                sst+=str(aa)+" "
    if a1==[1,2,5,905,2000000]:
        itog=[2,2,1,6,3,8,8,2000001]
    if a1==[3,4,5,6,8]:
        itog=[9,9,9,7]
    if a1==[6,7,8,9,10]:
        itog=[1,1]
    if itog!=[]:
        print(*itog)
    else:
        print(sst)

**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
5
1 2 3 4 5
10
- 3
? 2
+ 3
? 2
- 1
? 1
+ 1
? 1
- 5
? 1
5
1 3 5 7 9
10
? 2
- 3
? 2
+ 3
? 2
- 1
? 1
+ 1
? 1
- 9
? 1
5
1000000 1000001 1000002 1000003 1000004
10
? 2
- 1000002
? 2
+ 1000002
? 2
- 1000001
? 1
+ 1000001
? 1
- 1000004
? 1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

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

public class Main {
    static int M = (int)2e6 + 1;
    public static void main(String[] args) {
        SegTree segTree = new SegTree(M);
        TreeSet<Integer>[] a = new TreeSet[M + 1];
        Reader sc = new Reader();
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            TreeSet<Integer> set = new TreeSet<>();
            set.add(0);
            for (int i = 0; i < n; i++) {
                set.add(sc.nextInt());
            }
            set.add((int)5e6);
            Arrays.setAll(a, key -> new TreeSet<>());
            int pre = -1;
            for (int x : set) {
                int len = x - pre - 1;
                len = Math.min(len, M);
                a[len].add(pre + 1);
                Integer nw = a[len].first();
                len = Math.min(len, M);
                segTree.set(1, 1, M, len, nw);
                pre = x;
            }
            int m = sc.nextInt();
            StringBuilder sb = new StringBuilder();
            while (m-- > 0) {
                char op = sc.nextChar();
                int x = sc.nextInt();
                if (op == '+') {
                    set.add(x);
                    int low = set.lower(x), high = set.higher(x);
                    int len = high - low - 1;
                    len = Math.min(len, M);
                    a[len].remove(low + 1);
                    int nw = a[len].isEmpty()? M : a[len].first();
                    segTree.set(1, 1, M, len, nw);

                    len = x - low - 1;
                    len = Math.min(len, M);
                    a[len].add(low + 1);
                    nw = a[len].first();
                    segTree.set(1, 1, M, len, nw);

                    len = high - x - 1;
                    len = Math.min(len, M);
                    a[len].add(x + 1);
                    nw = a[len].first();
                    segTree.set(1, 1, M, len, nw);
                } else if (op == '-') {
                    set.remove(x);
                    int low = set.lower(x), high = set.higher(x);
                    int len = high - low - 1;
                    len = Math.min(len, M);
                    a[len].add(low + 1);
                    int nw = a[len].first();
                    segTree.set(1, 1, M, len, nw);

                    len = x - low - 1;
                    len = Math.min(len, M);
                    a[len].remove(low + 1);
                    nw = a[len].isEmpty()? M : a[len].first();
                    segTree.set(1, 1, M, len, nw);

                    len = high - x - 1;
                    len = Math.min(len, M);
                    a[len].remove(x + 1);
                    nw = a[len].isEmpty()? M : a[len].first();
                    segTree.set(1, 1, M, len, nw);
                } else {
                    sb.append(segTree.min(1, 1, M, x, M)).append(' ');
                }
            }
            pre = -1;
            for (int x : set) {
                int len = x - pre - 1;
                len = Math.min(len, M);
                a[len].clear();
                len = Math.min(len, M);
                segTree.set(1, 1, M, len, 0);
                pre = x;
            }
            System.out.println(sb);
        }
    }
}
class SegTree {
    int n;
    long[] mi, lazy;
    SegTree(int n) {
        this.n = n;
        mi = new long[4 * n];
        lazy = new long[4 * n];
    }

    SegTree(int[] data) {
        this(data.length);
        build(1, 1, n, data);
    }

    void set(int root, int l, int r, int x, int v) {
        if (x < l || x > r) return;
        if (l == r) {
            mi[root] = v;
            return;
        }
        int mid = (l + r) / 2;
        pushDown(root);
        set(root * 2, l, mid, x, v);
        set(root * 2 + 1, mid + 1, r, x, v);
    }

    long min(int root, int l, int r, int x, int y) {
        if (r < x || l > y) {
            return Integer.MAX_VALUE;
        }
        if (l == r) {
            return mi[root] == 0? Main.M: mi[root];
        }
        int mid = (l + r) / 2;
        pushDown(root);
        return Math.min(min(root * 2, l, mid, x, y), min(root * 2 + 1, mid + 1, r, x, y));
    }
    private void build(int root, int l, int r, int[] data) {
        if (l == r) {
            mi[root] = data[l - 1];
            return;
        }
        int mid = (l + r) / 2;
        build(root * 2, l, mid, data);
        build(root * 2 + 1, mid + 1, r, data);
        pushUp(root, l, r, mid);
    }
    void pushDown(int root) {
        if (lazy[root] != 0) {
            lazy[root * 2] += lazy[root];
            lazy[root * 2 + 1] += lazy[root];

            mi[root * 2] += lazy[root];
            mi[root * 2 + 1] += lazy[root];

            lazy[root] = 0;
        }
    }
    void pushUp(int root, int l, int r, int mid) {
        mi[root] = Math.min(mi[root * 2], mi[root * 2 + 1]);
    }
    void add(int root, int l, int r, int x, int y, int v) {
        if (r < x || l > y) return;
        if (x <= l && y >= r) {
            mi[root] += v;
            lazy[root] += v;
            return;
        }
        int mid = (l + r) / 2;
        pushDown(root);
        add(root * 2, l, mid, x, y, v);
        add(root * 2 + 1, mid + 1, r, x, y, v);
        pushUp(root, l, r, mid);
    }
}

class Reader {
    InputStream in = System.in;
    byte[] buffer = new byte[1024];
    int cur = 0, len = 0;
    private byte nextByte() {
        if (cur >= len) {
            try {
                cur = 0;
                this.len = this.in.read(buffer);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        if (len == 0) {
            return -1;
        }
        return buffer[cur++];
    }
    char nextChar() {
        byte res;
        while ((res = nextByte()) != -1 && (res == ' ' || res == '\n'))
            ;
        return (char) res;
    }
    int nextInt() {
        int res = 0, flag = 1;
        byte c = 0;
        while ((c = nextByte()) != -1 && (c != '-' && !Character.isDigit((char)c)))
            ;
        if (c == '-') {
            flag = -1;
            c = nextByte();
        } else if (c == '+') {
            c = nextByte();
        }
        do {
            res = res * 10 + c - '0';
        } while ((c = nextByte()) != -1 && Character.isDigit(c));
        return res * flag;
    }
}

**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 potential bugs in the provided code, we need to consider edge cases and scenarios that might cause issues. Here are some key points to consider:

1. **Initial Set with Gaps**: Create an initial set with large gaps to test the $k$-load calculation.
2. **Operations that Cause Complex Changes**: Include operations that insert and remove elements in a way that changes the gaps in the set.
3. **Large $k$-load Queries**: Test with large values of $k$ to ensure the code handles them correctly.
4. **Boundary Conditions**: Test with boundary values for $n$, $m$, and $k$ to ensure the code handles edge cases.

Here is a small-scale test input that meets these criteria:

```plaintext
3
5
1 2 4 10 1000000
10
? 3
+ 3
? 3
- 4
? 3
+ 5
? 3
- 5
? 3
? 1000000
4
1 2 3 4
4
? 1
- 2
+ 2
? 1
5
1 3 5 7 9
5
? 5
+ 2
? 5
- 7
? 5
```

This test input includes:
- An initial set with large gaps (1, 2, 4, 10, 1000000) to test the $k$-load calculation.
- Operations that insert and remove elements, changing the gaps in the set.
- Queries with large values of $k$ to ensure the code handles them correctly.
- Simple cases with small sets and small $k$ to test boundary conditions.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

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

public class Main {
    static PrintWriter pw = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static segmentTree st = new segmentTree((int) 2e6 + 1);

    static class segmentTree {

        int N;
        int[] sgTree;

        public segmentTree(int n) {
            N = 1;
            while (N < n) {
                N <<= 1;
            }
            sgTree = new int[N << 1];
            Arrays.fill(sgTree, -1);
        }

        int merge(int left, int right) {
            return Math.max(left, right);
        }

        void updatePoint(int idx, int val) {
            idx += N - 1;
            sgTree[idx] = val;
            while (idx > 1) {
                idx >>= 1;
                sgTree[idx] = merge(sgTree[idx << 1], sgTree[(idx << 1) | 1]);
            }
        }

        int query(int start, int end) {
            return query(1, 1, N, start, end);
        }

        int query(int node, int l, int r, int start, int end) {
            if (l > end || r < start) {
                return -1;
            }
            if (l >= start && r <= end) {
                return sgTree[node];
            }
            int mid = (l + r) >> 1;
            int left = node << 1, right = left | 1;
            return merge(query(left, l, mid, start, end), query(right, mid + 1, r, start, end));
        }

        public String toString(){
            return  Arrays.toString(sgTree);
        }
    }

    public static void solve() throws IOException {
        int n = sc.nextInt();
        Integer a [] = sc.nextIntegerArray(n);
        Arrays.sort(a);
        TreeSet<Integer> set = new TreeSet<>();
        for(int i = 0; i < n - 1 ; i++){
            st.updatePoint(a[i], a[i + 1] - a[i] - 1);
            set.add(a[i]);
        }
        st.updatePoint(a[n - 1], Integer.MAX_VALUE);
        int m = sc.nextInt();
        while(m -- > 0){
            char c = sc.next().charAt(0);
            int val = sc.nextInt();
            if(c == '-'){
                set.remove(val);
                st.updatePoint(val, Integer.MIN_VALUE);
                if(set.floor(val) != null){
                    int floor = set.floor(val);
                    int ceil = Integer.MAX_VALUE;
                    if(set.ceiling(val) != null)
                        ceil = set.ceiling(val);
                    st.updatePoint(floor, ceil - floor - 1);
                }
            }
            else if (c == '+'){
                if(set.floor(val) != null){
                    int floor = set.floor(val);
                    st.updatePoint(floor, val - floor - 1);
                }
                int ceil = Integer.MAX_VALUE;
                if(set.ceiling(val) != null){
                    ceil = set.ceiling(val);
                    st.updatePoint(val,ceil - val - 1);
                }
                else{
                    st.updatePoint(val, ceil);
                }
                set.add(val);
            }
            else{
                if(set.first() > val){
                    pw.print(1 + " ");
                    continue;
                }
                int low = 1, high = (int) 2e6;
                while(low <= high){
                    int mid = (low + high) / 2;
                    int mx = st.query(1, mid);
                    if(mx >= val){
                        high = mid - 1;
                    }
                    else {
                        low = mid + 1;
                    }
                }
                pw.print((low + 1) + " ");
            }
        }
        pw.println();
        for(int i : set)
            st.updatePoint(i, -1);
    }

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

    static class Scanner {
        StringTokenizer st;
        BufferedReader br;

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

        public Scanner(String s) throws FileNotFoundException {
            br = new BufferedReader(new FileReader(s));
        }

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

        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 that can cause issues. Here are the steps to create such a test input:

1. **Initial Set with Large Values**: Start with a set that has large values to test the boundary conditions.
2. **Operations to Manipulate the Set**: Include operations that insert and remove elements, particularly focusing on elements that are close to each other to test the segment tree's ability to handle gaps correctly.
3. **Queries to Test the K-Load**: Include queries that test the k-load for various values of k, especially values that are close to the gaps in the set.

Here is a small-scale test input that meets these criteria:

```plaintext
1
5
1 1000000 2000000 3000000 4000000
15
- 1
? 1
+ 2
? 2
- 2
? 1
+ 1000001
? 3
- 1000001
? 2
+ 2000001
? 4
- 2000001
? 3
+ 3000001
? 5
- 3000001
? 4
```

### Explanation:
- **Initial Set**: The set starts with large values {1, 1000000, 2000000, 3000000, 4000000}.
- **Operations**:
  - **Remove 1**: The set becomes {1000000, 2000000, 3000000, 4000000}.
  - **Query 1**: The 1-load should be 1 (since 1 is the smallest number not in the set).
  - **Add 2**: The set becomes {2, 1000000, 2000000, 3000000, 4000000}.
  - **Query 2**: The 2-load should be 3 (since 3, 4 are not in the set).
  - **Remove 2**: The set becomes {1000000, 2000000, 3000000, 4000000}.
  - **Query 1**: The 1-load should be 1.
  - **Add 1000001**: The set becomes {1000000, 1000001, 2000000, 3000000, 4000000}.
  - **Query 3**: The 3-load should be 1000002 (since 1000002, 1000003, 1000004 are not in the set).
  - **Remove 1000001**: The set becomes {1000000, 2000000, 3000000, 4000000}.
  - **Query 2**: The 2-load should be 1000001 (since 1000001, 1000002 are not in the set).
  - **Add 2000001**: The set becomes {1000000, 2000000, 2000001, 3000000, 4000000}.
  - **Query 4**: The 4-load should be 2000002 (since 2000002, 2000003, 2000004, 2000005 are not in the set).
  - **Remove 2000001**: The set becomes {1000000, 2000000, 3000000, 4000000}.
  - **Query 3**: The 3-load should be 2000001 (since 2000001, 2000002, 2000003 are not in the set).
  - **Add 3000001**: The set becomes {1000000, 2000000, 3000000, 3000001, 4000000}.
  - **Query 5**: The 5-load should be 3000002 (since 3000002, 3000003, 3000004, 3000005, 3000006 are not in the set).
  - **Remove 3000001**: The set becomes {1000000, 2000000, 3000000, 4000000}.
  - **Query 4**: The 4-load should be 3000001 (since 3000001, 3000002, 3000003, 3000004 are not in the set).

This test input should expose any issues in the segment tree's handling of large values and gaps in the set.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Ksyusha and the Loaded Set
time_limit_ms: 3000
memory_limit_mb: 512
Description: Ksyusha decided to start a game development company. To stand out among competitors and achieve success, she decided to write her own game engine. The engine must support a set initially consisting of $n$ distinct integers $a_1, a_2, \ldots, a_n$.

The set will undergo $m$ operations sequentially. The operations can be of the following types:

  * Insert element $x$ into the set;    * Remove element $x$ from the set;    * Report the $k$-load of the set.

The $k$-load of the set is defined as the minimum positive integer $d$ such that the integers $d, d + 1, \ldots, d + (k - 1)$ do not appear in this set. For example, the $3$-load of the set $\\{3, 4, 6, 11\\}$ is $7$, since the integers $7, 8, 9$ are absent from the set, and no smaller value fits.

Ksyusha is busy with management tasks, so you will have to write the engine. Implement efficient support for the described operations.

Input: The first line contains an integer $t$ ($1 \le t \le 10^4$) — the number of test cases.

The following lines describe the test cases.

The first line contains an integer $n$ ($1 \le n \le 2 \cdot 10^5$) — the initial size of the set.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_1 < a_2 < \ldots < a_n \le 2 \cdot 10^6$) — the initial state of the set.

The third line contains an integer $m$ ($1 \le m \le 2 \cdot 10^5$) — the number of operations.

The next $m$ lines contain the operations. The operations are given in the following format:

  * + $x$ ($1 \le x \le 2 \cdot 10^6$) — insert element $x$ into the set (it is guaranteed that $x$ is not in the set);    * - $x$ ($1 \le x \le 2 \cdot 10^6$) — remove element $x$ from the set (it is guaranteed that $x$ is in the set);    * ? $k$ ($1 \le k \le 2 \cdot 10^6$) — output the value of the $k$-load of the set.

It is guaranteed that the sum of $n$ across all test cases does not exceed $2 \cdot 10^5$, and the same holds for $m$.

Output: For each test case, output the answers to the operations of type "?".

Examples:
input:
3
5
1 2 5 905 2000000
15
- 2
? 2
? 1
- 1
? 1
+ 4
+ 2
? 2
+ 6
- 4
+ 7
? 2
? 3
? 4
? 2000000
5
3 4 5 6 8
9
? 5
- 5
? 5
+ 1
? 2
- 6
- 8
+ 6
? 5
5
6 7 8 9 10
10
? 5
- 6
? 4
- 10
+ 5
- 8
+ 3
+ 2
- 3
+ 10
output:
2 2 1 6 3 8 8 2000001
9 9 9 7
1 1

Note:

Buggy Code:
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <cstdio>
#include <ctime>
#include <iomanip>
#define gc getchar
using namespace std;
typedef long long ll;
const int N = 2e5 + 7, M = 2e6 + 7, INF = M;
int n, a[N];
char op[2];
set<int> S, rec;
map<int,set<int>> G;
clock_t start, finish;

template <class T>
inline void read(T &x){
    static char buf = gc();
    register int f = 1; x = 0;
    for (; !isdigit(buf); buf = gc())
        if (buf == '-') f = -1;
    for (; isdigit(buf); buf = gc())
        x = x * 10 + buf - 48;
    x *= f;
}

struct node{
    int l, r, val;
};

struct SegmentTree{
    #define lson (x << 1)
    #define rson (x << 1 | 1)
    #define MID ((L + R) >> 1)
    #define mid ((S[x].l + S[x].r) >> 1)
    node S[M << 2];

    void pushup(int x){
        S[x].val = min(S[lson].val, S[rson].val);
    }

    void build(int x, int L, int R){
        S[x] = {L, R, INF};
        if (L == R) return ;
        build(lson, L, MID);
        build(rson, MID + 1, R);
        pushup(x);
    }

    void upd(int x, int pos, int val){
        if (S[x].l == S[x].r){
            S[x].val = val;
            return ;
        }
        if (pos <= mid) upd(lson, pos, val);
        else upd(rson, pos, val);
        pushup(x);
    }

    int query(int x, int L, int R){
        if (L <= S[x].l and R >= S[x].r)
            return S[x].val;
        int ans = INF;
        if (L <= mid) ans = min(ans, query(lson, L, R));
        if (R > mid) ans = min(ans, query(rson, L, R));
        return ans;
    }
}SG;

void init() {
    S.insert(0);
    for (int i = 1; i <= n; i++){
        S.insert(a[i]);
        int d = a[i] - a[i - 1];
        if (!G.count(d)) {
            set<int> tmp;
            tmp.insert(a[i - 1]);
            G[d] = tmp;
        }
        else {
            G[d].insert(a[i - 1]);
        }
    }
    start = clock();
    for (auto [key, val]: G) {
        SG.upd(1, key, *(val.begin()));
        rec.insert(key);
    }
    finish = clock();
}

void clr() {
    S.clear();
    G.clear();
    for (auto t: rec) {
        SG.upd(1, t, INF);
    }
    rec.clear();
}

inline void modify(set<int> s, int pos) {
    if (s.size()) {
        SG.upd(1, pos, *(s.begin()));
        rec.insert(pos);
    }
    else {
        SG.upd(1, pos, INF);
        rec.erase(pos);
    }
}

int main(){
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    int t;
    read(t);
    SG.build(1, 1, 2e6);
    while (t--) {
        read(n);
        for (int i = 1; i <= n; i++)
            read(a[i]);
        init();
        int m;
        read(m);
        while (m--) {
            int x;
            scanf("%s", op);
            read(x);
            if (op[0] == '+') {
                //insert
                auto it1 = S.upper_bound(x), it2 = S.lower_bound(x);
                if (it1 != S.end()) {
                    int l = *(--it2), r = *it1;
                    G[r - l].erase(l);
                    G[x - l].insert(l);
                    G[r - x].insert(x);
                    modify(G[r - l], r - l);
                    modify(G[x - l], x - l);
                    modify(G[r - x], r - x);
                }
                else {
                    int l = *(--it2);
                    G[x - l].insert(l);
                    modify(G[x - l], x - l);
                }
                S.insert(x);
            }
            else if (op[0] == '-') {
                //remove
                auto it1 = S.upper_bound(x), it2 = S.lower_bound(x);
                if (it1 != S.end()) {
                    int l = *(--it2), r = *it1;
                    G[r - l].insert(l);
                    G[x - l].erase(l);
                    G[r - x].erase(x);
                    modify(G[r - l], r - l);
                    modify(G[x - l], x - l);
                    modify(G[r - x], r - x);
                }
                else {
                    int l = *(--it2);
                    G[x - l].erase(l);
                    modify(G[x - l], x - l);
                }
                S.erase(x);
            }
            else {
                //query
                int p = SG.query(1, x + 1, 2e6);
                if (p == INF)
                    printf("%d ", *(--S.end()) + 1);
                else
                    printf("%d ", p + 1);
            }
        }
        start = clock();
        clr();
        finish = clock();
        puts("");
    }
    // cout << "time: " << fixed << setprecision(8)
    //         << double(finish - start) / CLOCKS_PER_SEC << "s"<< endl;
    system("pause");
    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 buggy code, we need to focus on edge cases and scenarios that can cause issues. Here are some key considerations:

1. **Initial Set with Gaps**: The initial set should have gaps that can be manipulated by insertions and deletions.
2. **Operations to Manipulate Gaps**: The operations should include insertions and deletions that can change the gaps in the set.
3. **Query Operations**: The query operations should be designed to test the $k$-load of the set after various insertions and deletions.

Let's create a small-scale test input that fits these criteria:

### Test Input
```plaintext
1
5
1 3 5 7 9
5
- 5
? 2
+ 6
? 2
? 3
```

### Explanation
- **Initial Set**: `{1, 3, 5, 7, 9}`. This set has gaps of 2 between each element.
- **Operations**:
  - `- 5`: Remove 5 from the set. The set becomes `{1, 3, 7, 9}`.
  - `? 2`: Query the 2-load of the set. The 2-load should be 4, as the integers 4 and 5 are missing.
  - `+ 6`: Insert 6 into the set. The set becomes `{1, 3, 6, 7, 9}`.
  - `? 2`: Query the 2-load of the set. The 2-load should be 4, as the integers 4 and 5 are still missing.
  - `? 3`: Query the 3-load of the set. The 3-load should be 4, as the integers 4, 5, and 6 are missing.

This test input is designed to:
- Test the removal of an element that creates a gap.
- Test the insertion of an element that closes a gap.
- Test the query operations that check the $k$-load before and after the insertions and deletions.

This should help expose any bugs in the buggy code.