**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
import os
import sys
from io import BytesIO, IOBase
from collections import *
from math import *
from functools import *
from types import *
from heapq import *
from itertools import *
from operator import *
from bisect import *
BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0
    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def sol(n,edges,s):
    adj=defaultdict(set)
    for a,b in edges:
        adj[a].add(b)
        adj[b].add(a)
    queue=deque([0])
    d={'0':0, '1':0, '?':0}
    count=0
    for node in range(1,n):
        if len(adj[node])==1:
            d[s[node]]+=1
        else:
            count+=s[node]=='?'
    score=0
    if s[0]!='?':
        score=d['1'] if s[0]=='0' else d['0']
        score+=(d['?']+1)//2
    else:
        score=max(d['1'],d['0'])
        score+=(d['?'])//2
        score+=d['1']==d['0'] and count%2
    return score

t=int(input().strip())
for _ in range(t):
    n=int(input().strip())
    edges=[]
    for _ in range(n-1):
        a,b=map(int,input().strip().split())
        edges.append((a-1,b-1))
    s=(input().strip())
    print(sol(n,edges,s))

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

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

Think step by step.

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


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
import java.util.*;

public class cf156 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();

        for (int t = 0; t < T; t++) {
            int n = sc.nextInt();
            int x = 0, y = 0, z = 0, w = 0;
            int[] deg = new int[n + 1];

            // Reading the edges and calculating the degree of each node
            for (int i = 0; i < n - 1; i++) {
                int u = sc.nextInt();
                int v = sc.nextInt();
                deg[u]++;
                deg[v]++;
            }

            // Reading the string (s) and processing
            String s = " " + sc.next(); // Adding a space at the beginning to match 1-based indexing

            for (int i = 2; i <= n; i++) {
                if (deg[i] == 1) { // Leaf node
                    if (s.charAt(i) == '?') {
                        z++;
                    } else if (s.charAt(i) == '0') {
                        x++;
                    } else {
                        y++;
                    }
                } else if (s.charAt(i) == '?') {
                    w++;
                }
            }

            if (s.charAt(1) == '0') {
                System.out.println(y + (z + 1) / 2);
            } else if (s.charAt(1) == '1') {
                System.out.println(x + (z + 1) / 2);
            } else {
                System.out.println(Math.max(x, y) + (z + (w % 2 == (x == y ? 1 : 0) ? 1 : 0)) / 2);
            }
        }

        sc.close();
    }
}

**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 consider the logic and potential edge cases that the code might handle incorrectly. The key points to focus on are:

1. **Leaf Nodes with Unknown Values (‘?’):** The code incorrectly handles the distribution of ‘?’ values among leaf nodes and non-leaf nodes.
2. **Root Node Value:** The code's logic for handling the root node's value (‘0’ or ‘1’) might be flawed.
3. **Optimal Play:** The code should simulate the optimal play by both players, but it might not correctly account for the strategic placement of ‘0’ and ‘1’ values.

Given these considerations, let's construct a test case that maximizes the failure probability:

### Test Case:
- **Tree Structure:** A tree with a root node and multiple branches, including some leaf nodes with ‘?’ values.
- **Root Node Value:** ‘?’ to test the logic for the root node.
- **Leaf Node Values:** A mix of ‘0’, ‘1’, and ‘?’ to test the distribution of values.

### Example:
```plaintext
1
5
1 2
1 3
2 4
2 5
?1?01
```

### Explanation:
- **Tree Structure:**
  - Root node: 1
  - Child nodes: 2, 3
  - Grandchild nodes: 4, 5
- **Node Values:**
  - Node 1: ‘?’
  - Node 2: ‘1’
  - Node 3: ‘?’
  - Node 4: ‘0’
  - Node 5: ‘1’

### Expected Behavior:
- **Optimal Play:**
  - If the root node is set to ‘0’, the optimal play would be:
    - Node 1: ‘0’
    - Node 3: ‘0’ (to minimize the score)
  - If the root node is set to ‘1’, the optimal play would be:
    - Node 1: ‘1’
    - Node 3: ‘1’ (to maximize the score)

### Correct Output:
- The correct output for this test case should be `1` because:
  - If the root node is ‘0’, the leaves 4 and 5 have weights 0 and 0, respectively.
  - If the root node is ‘1’, the leaves 4 and 5 have weights -1 and 1, respectively, resulting in a score of 1.

### Test Input:
```plaintext
1
5
1 2
1 3
2 4
2 5
?1?01
```

This test case should expose the bug in the given buggy code by challenging the logic for handling the root node and the distribution of ‘?’ values among leaf nodes.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

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

public class Main {
boolean MULTI_CASE = true;
boolean ALWAYS_FLUSH = false;

void go() {
    int n = nextInt();
    int[][] edges = inEdges(n - 1);
    d = edges2List(edges, n);
    a = next().toCharArray();
    leafCnt = new int[200];
    dive(0, -1);
    if (a[0] != '?') sl(leafCnt[1 - (a[0] - '0') + '0'] + (leafCnt['?'] + 1) / 2);
    else {
        int allQ = 0;
        for (char x : a) if (x == '?') allQ++;
        int existMax = Math.max(leafCnt['0'], leafCnt['1']);
        if (existMax > 0) {
            sl(existMax + leafCnt['?'] / 2);
        } else {
            if ((allQ - 1 - leafCnt['?']) % 2 == 0) {
                sl((leafCnt['?'] - 1 + 1) / 2);
            } else {
                sl((leafCnt['?'] + 1) / 2);
            }
        }
    }
}

char[] a;
int[][] d;
int[] leafCnt;

void dive(int cur, int fa) {
    boolean isLeaf = true;
    for (int x : d[cur]) {
        if (x == fa) continue;
        isLeaf = false;
        dive(x, cur);
    }
    if (fa != -1 && isLeaf) {
        leafCnt[a[cur]]++;
    }
}

int[][] inEdges(int n) {
    int[][] edges = new int[n][2];
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < 2; ++j)
            edges[i][j] = nextInt() - 1;
    return edges;
}

int[][] edges2List(int[][] edges, int n) {
    int[] g = new int[n];
    for (int[] en : edges) {
        g[en[0]]++;
        g[en[1]]++;
    }
    int[][] r = new int[n][0];
    for (int i = 0; i < n; ++i) {
        r[i] = new int[g[i]];
    }
    int[] ri = new int[n];
    for (int[] en : edges) {
        r[en[0]][ri[en[0]]++] = en[1];
        r[en[1]][ri[en[1]]++] = en[0];
    }
    return r;
}

/**
 * Input.
 */
InputStream inStream;
byte[] inBuff = new byte[1024];
int inBuffCursor = 0, inBuffLen = 0;

boolean isVisibleChar(int c) {
    return 33 <= c && c <= 126;
}

boolean hasNextByte() {
    if (inBuffCursor < inBuffLen) return true;
    inBuffCursor = 0;
    try {
        inBuffLen = inStream.read(inBuff);
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }
    return inBuffLen > 0;
}

boolean hasNext() {
    while (hasNextByte() && !isVisibleChar(inBuff[inBuffCursor])) inBuffCursor++;
    return hasNextByte();
}

int nextByte() {
    return hasNextByte() ? inBuff[inBuffCursor++] : -1;
}

String next() {
    if (!hasNext()) throw new RuntimeException("no next.");
    StringBuilder sb = new StringBuilder();
    int b = nextByte();
    while (isVisibleChar(b)) {
        sb.appendCodePoint(b);
        b = nextByte();
    }
    return sb.toString();
}

long nextLong() {
    if (!hasNext()) throw new RuntimeException("no next.");
    long result = 0;
    boolean negative = false;
    int b = nextByte();
    if (b < '0') {
        if (b == '-') negative = true;
        else if (b != '+') throw new RuntimeException("long number must start with +/-.");
        b = nextByte();
    }
    while (isVisibleChar(b)) {
        if (b < '0' || b > '9') throw new RuntimeException("wrong digit in long:" + (char) b);
        // NOTE: may overflow here, even if it is a valid Long, eg.-(1<<63).
        result = result * 10 + (b - '0');
        b = nextByte();
    }
    return negative ? -result : result;
}

int nextInt() {
    long x = nextLong();
    if (x < Integer.MIN_VALUE || x > Integer.MAX_VALUE)
        throw new RuntimeException("int overflow:" + x);
    return (int) x;
}

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

/**
 * Output.
 */
PrintWriter printOut = new PrintWriter(System.out);

void so(Object obj, boolean newLine) {
    if (newLine) printOut.println(obj);
    else printOut.print(obj);
    if (ALWAYS_FLUSH) printOut.flush();
}

void so(Object obj) {
    so(obj, false);
}

void sl(Object obj) {
    so(obj, true);
}

void sl() {
    sl("");
}

/**
 * Main.
 */
void mainGo() {
    try {
        inStream = new FileInputStream("src/main.in");
        ALWAYS_FLUSH = true;
    } catch (Exception e) {
        inStream = System.in;
    }
    while (hasNext()) {
        if (MULTI_CASE) {
            int T = nextInt();
            if (T == 0) break;
            for (int i = 0; i < T; ++i) {
                go();
            }
        } else {
            go();
        }
    }
    printOut.flush();
}

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

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

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

Think step by step.

Response:
To expose the bug in the provided code, we need to create a test case that challenges the logic of the algorithm, particularly focusing on how it handles unknown values (`?`) and the calculation of leaf weights. The code seems to have issues with how it handles the root node and the distribution of unknown values.

### Step-by-Step Analysis:

1. **Root Node Handling**:
   - The root node (vertex 1) is always considered, and its value is fixed. The code does not handle the root node's value correctly if it is `?`.

2. **Leaf Weight Calculation**:
   - The code calculates the weight of leaves based on the number of occurrences of `10` and `01` substrings. It needs to correctly handle the case where the root node's value is `?`.

3. **Optimal Play**:
   - The code should simulate the optimal play of Iris and Dora. If the root node's value is `?`, it should be considered in the optimal play.

### Test Case Generation:

To create a challenging test case, we will:
- Use a small tree with a few vertices.
- Set the root node's value to `?` to test how the code handles an unknown root.
- Use a mix of `0`, `1`, and `?` values to ensure the code correctly handles the distribution of unknown values.

### Test Case:

```plaintext
1
4
1 2
1 3
2 4
???0
```

### Explanation:

- **Tree Structure**:
  - Vertex 1 (root) is connected to vertices 2 and 3.
  - Vertex 2 is connected to vertex 4.
  - Vertex 3 is a leaf.
  - Vertex 4 is a leaf.

- **Vertex Values**:
  - Vertex 1: `?`
  - Vertex 2: `?`
  - Vertex 3: `?`
  - Vertex 4: `0`

### Expected Behavior:

- The root node (vertex 1) has an unknown value.
- The optimal play should consider the best and worst-case scenarios for the unknown values.
- The final score should be calculated based on the optimal play of Iris and Dora.

### Expected Output:

The expected output for this test case should be `1` because:
- If the root node is set to `0`, the possible paths are:
  - `00` (leaf 3) with weight `0`
  - `0?0` (leaf 4) with weight `0` or `1` (depending on the value of vertex 2)
- If the root node is set to `1`, the possible paths are:
  - `1?0` (leaf 4) with weight `1` (if vertex 2 is `0`) or `0` (if vertex 2 is `1`)
  - `1?` (leaf 3) with weight `0` or `1` (depending on the value of vertex 3)

Given the optimal play, the final score should be `1`.

This test case should expose any issues in the code's handling of the root node's value and the distribution of unknown values.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
// Working program with FastReader
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

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

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

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

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

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

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

        String nextLine()
        {
            String str = "";
            try {
                if(st.hasMoreTokens()){
                    str = st.nextToken("\n");
                }
                else{
                    str = br.readLine();
                }
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    // gcd method returns the GCD of a and b
    static long gcd(long a, long b) {

        // if b=0, a is the GCD
        if (b == 0)
            return a;

        // call the gcd() method recursively by
        // replacing a with b and b with
        // modulus(a,b) as long as b != 0
        else
            return gcd(b, a % b);
    }

    // lcm() method returns the LCM of a and b
    static long lcm(long a, long b, long gcdValue)
    {
        return Math.abs(a * b) / gcdValue;
    }
    static FastReader sc = new FastReader();
    public static void main(String[] args) {
        int t= sc.nextInt();
        while (t-->0) {
            solve();
        }

    }
    private static void solve() {
        int n = sc.nextInt();
        HashMap<Integer , List<Integer>> map = new HashMap<>();
        while (n-->1) {
            int u =  sc.nextInt();
            int v =  sc.nextInt();
            if(!map.containsKey(u)){
                map.put(u, new ArrayList<>());
            }
            if(!map.containsKey(v)){
                map.put(v, new ArrayList<>());
            }
            map.get(u).add(v);
            map.get(v).add(u);
        }
        char[] arr = sc.next().toCharArray();
        HashSet<Integer> set = new HashSet<>();
        for(int x : map.keySet()){
            if(map.get(x).size() == 1 && x!=1){
                set.add(x);
            }
        }
        // System.out.println(set);
        int ans = 0 ;
        int c = 0 ;
        if(arr[0]!='?'){
            for(int x : set){
                if(arr[x-1]!='?' && arr[x-1]!=arr[0]){
                    ans ++;
                }else if(arr[x-1]=='?'){
                    c++;
                }
            }
            ans += (c+1)/2;
            System.out.println(ans);
        }else{
            int ones = 0 ;
            int zeros = 0 ;
            for(int x : set){
                if(arr[x-1]=='?'){
                    c++;
                }else if(arr[x-1] == '0') {
                    zeros++;
                }else ones++;
            }
            int nonleaf = 0 ;
            for(int i = 2 ; i<=arr.length ; i++){
                if(!set.contains(i) && arr[i-1] == '?'){
                    nonleaf ++;
                }
            }
            int leafs = c;
            if(leafs%2==0)
                System.out.println(leafs/2 +Math.max(zeros, ones));
            else{
                if(nonleaf%2==1)
                    System.out.println((leafs+1)/2+Math.min(zeros, ones));
                else{
                    System.out.println(leafs/2 +Math.max(zeros, ones));
                }
            }
        }
    }
}

**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
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
// Working program with FastReader
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

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

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

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

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

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

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

        String nextLine()
        {
            String str = "";
            try {
                if(st.hasMoreTokens()){
                    str = st.nextToken("\n");
                }
                else{
                    str = br.readLine();
                }
            }
            catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    // gcd method returns the GCD of a and b
    static long gcd(long a, long b) {

        // if b=0, a is the GCD
        if (b == 0)
            return a;

        // call the gcd() method recursively by
        // replacing a with b and b with
        // modulus(a,b) as long as b != 0
        else
            return gcd(b, a % b);
    }

    // lcm() method returns the LCM of a and b
    static long lcm(long a, long b, long gcdValue)
    {
        return Math.abs(a * b) / gcdValue;
    }
    static FastReader sc = new FastReader();
    public static void main(String[] args) {
        int t= sc.nextInt();
        while (t-->0) {
            solve();
        }

    }
    private static void solve() {
        int n = sc.nextInt();
        HashMap<Integer , List<Integer>> map = new HashMap<>();
        while (n-->1) {
            int u =  sc.nextInt();
            int v =  sc.nextInt();
            if(!map.containsKey(u)){
                map.put(u, new ArrayList<>());
            }
            if(!map.containsKey(v)){
                map.put(v, new ArrayList<>());
            }
            map.get(u).add(v);
            map.get(v).add(u);
        }
        char[] arr = sc.next().toCharArray();
        HashSet<Integer> set = new HashSet<>();
        for(int x : map.keySet()){
            if(map.get(x).size() == 1 && x!=1){
                set.add(x);
            }
        }
        // System.out.println(set);
        int ans = 0 ;
        int c = 0 ;
        if(arr[0]!='?'){
            for(int x : set){
                if(arr[x-1]!='?' && arr[x-1]!=arr[0]){
                    ans ++;
                }else if(arr[x-1]=='?'){
                    c++;
                }
            }
            ans += (c+1)/2;
            System.out.println(ans);
        }else{
            int ones = 0 ;
            int zeros = 0 ;
            for(int x : set){
                if(arr[x-1]=='?'){
                    c++;
                }else if(arr[x-1] == '0') {
                    zeros++;
                }else ones++;
            }
            int nonleaf = 0 ;
            for(int i = 2 ; i<arr.length ; i++){
                if(!set.contains(i) && arr[i-1] == '?'){
                    nonleaf ++;
                }
            }
            int leafs = c;
            if(leafs%2==0)
                System.out.println(leafs/2 +Math.max(zeros, ones));
            else{
                if(nonleaf%2==1)
                    System.out.println((leafs+1)/2+Math.min(zeros, ones));
                else{
                    System.out.println(leafs/2 +Math.max(zeros, ones));
                }
            }
        }
    }
}

**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
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
for _ in range(int(input())):
	n = int(input())
	freq = [0]*n
	for i in range(n-1):
		u,v = map(int,input().split())
		freq[u-1]+=1
		freq[v-1]+=1
	weight = list(input())
	leafs = [i for i in range(1,n) if freq[i]==1]

	game = sum(weight[leaf]=='?' for leaf in leafs)
	if weight[0]!='?':
		score = sum(weight[leaf]!='?' and weight[leaf]!=weight[0] for leaf in leafs)
		print(score + (game+1)//2)
	else:
		score0 = sum(weight[leaf]!='?' and weight[leaf]!='0' for leaf in leafs)
		score1 = sum(weight[leaf]!='?' and weight[leaf]!='1' for leaf in leafs)
		if score1!=score0:
			print(max(score0,score1) + game//2)
		else:
			if sum(weight[i]=='?' for i in range(1,n)) - game == 0 :
				print(score0+ game//2)
			else:
				print(score0+ game//2 + game%2)

**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
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
from sys import stdin, stdout
from collections import defaultdict,deque
input = stdin.readline
inp = lambda :  list(map(int,input().split()))
inps= lambda :	input().strip()
inpsl= lambda :	list(input().strip().split())
import math,random
MOD = 1000000007
class CustomSet:
    def __init__(self, arr = []):
        self.RANDOM = random.randrange(2**62)
        self.set = set(arr)
    def wrapper(self,num):
        return num ^ self.RANDOM
    def add(self, key):
        self.set.add(self.wrapper(key))
    def remove(self, key):
        self.set.remove(self.wrapper(key))
    def __contains__(self, key):
        return self.wrapper(key) in self.set
    def __iter__(self):
        return iter(self.wrapper(i) for i in self.set)
    def __len__(self):
        return len(self.set)
    def __repr__(self):
        return repr({self.wrapper(i) for i in self.set})
for _ in range(*inp()):
    n,=inp()
    d={}

    for i in range(n-1):
        x,y=inp()
        if x in d:
            d[x]+=1
        else:
            d[x]=1
        if y in d:
            d[y]+=1
        else:
            d[y]=1
    le=[]
    for i in d:
        if i!=1 and d[i]==1:    le.append(i)
    s=inps()
    ro=s[0]
    c0,c1,c2=0,0,0
    for i in le:
        if s[i-1]=='1': c1+=1
        elif s[i-1]=='0':   c0+=1
        else:   c2+=1
    if ro=='0':
        co=s.count('?')
        od=co-c2
        if c0==c1 and c2%2==0 and od%2:
            print(c1-(-c2//2)+1)
        else:
            print(c1-(-c2//2))
    elif ro=='1':
        co=s.count('?')
        od=co-c2
        if c0==c1 and c2%2==0 and od%2:
            print(c0-(-c2/2)+1)
        else:
            print(c0-(-c2//2))
    else:
        co=s.count('?')
        od=co-1-c2
        if c0!=c1 or od%2==0:
            print(max(c0,c1)+(c2//2))
        elif od%2:
            print(max(c0,c1)+(c2//2)+1)

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


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
for _ in range(int(input())):
    n=int(input())
    tr=[[] for i in range(n)]
    for i in range(n-1):
        u,v=map(int,input().split())
        tr[u-1].append(v-1)
        tr[v-1].append(u-1)
    s=input()
    li=[]
    co=s.count("?")
    for i in range(1,n):
        if len(tr[i])==1:
            li.append(i)
    p=0
    q=0
    r=0
    for i in li:
        if s[i]=="0":
            p+=1
        elif s[i]=="1":
            q+=1
        else:
            r+=1
    if s[0]=="0":
        print(len(li)-p-r//2)
    elif s[0]=="1":
        print(len(li)-q-r//2)
    else:
        if (len(li)-co)%2==0:
            print(max(p,q)+(r+1)//2)
        else:
            print(max(p,q)+r//2)

**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
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

Buggy Code:
import math
t = int(input())
for _ in range(t):
    n = int(input())
    adj = [[]for _ in range(n)]
    for _ in range(n-1):
        u,v = map(int,input().split())
        u,v = min(u,v),max(u,v)
        adj[u-1].append(v-1)
    s = input()
    c0 = 0
    c1 = 0
    c2 = 0
    cnt = s.count('?')
    for node in range(n):
        if len(adj[node])==0:
            if s[node]=='0':
                c0 += 1
            elif s[node]=='1':
                c1 += 1
            else:
                c2 += 1
    res = 0
    if s[0]=='1':
        res = c0+math.ceil(c2/2)
    elif s[0]=='0':
        res = c1+math.ceil(c2/2)
    elif s[0]=='?':
        if c1==c0 and (cnt-c2-1)>0 and (cnt-c2-1)%2==1:
            res = c1+math.ceil(c2/2)
        else:
            res = max(c0,c1)+c2//2
    print(res)

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

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

Think step by step.

Response:
```plaintext
3
4
1 2
1 3
4 1
11?1
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

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 ArrayList<Integer> adjl [];

    public static void solve() throws IOException {
        int n = sc.nextInt();
        adjl = new ArrayList[n + 1];
        for(int i = 0; i < n ; i++) {
            adjl[i] = new ArrayList<>();
        }
        for(int i = 1; i < n ; i++){
            int u = sc.nextInt() - 1, v = sc.nextInt() - 1;
            adjl[u].add(v);
            adjl[v].add(u);
        }
        char a [] = sc.next().toCharArray();
        if(n == 100000){
            pw.println(0);
            return;
        }
        int ones = 0, zeros = 0, maybe = 0, unknown = 0;
        for(int i = 1; i < n ; i++){
            if(adjl[i].size() == 1){
                if(a[i] == '1') {
                    ones++;
                }
                else if (a[i] == '0'){
                    zeros++;
                }
                else{
                    maybe++;
                }
            }
            else{
                if(a[i] == '?') {
                    unknown++;
                }
            }
        }
        if(a[0] == '?'){
            if(ones == zeros){
                if(unknown % 2 == 1){
                    pw.println(ones + (maybe + 1) / 2);
                }
                else{
                    pw.println(ones + maybe / 2);
                }
            }
            else {
                pw.println(Math.max(ones, zeros) + maybe / 2);
            }
        }
        else{
            pw.println((a[0] == '1' ? zeros : ones) + (maybe + 1) / 2);
        }
    }

    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 given buggy code, we need to focus on edge cases and scenarios that maximize the failure probability. The buggy code has several issues, but the primary ones are:

1. Incorrect handling of the root node (vertex 1).
2. Incorrect counting of leaves and their values.
3. Incorrect logic for determining the final score based on the values of the vertices.

Given these issues, we can create a test input that includes:

1. A tree with a root node that has a value of `?`.
2. A tree with multiple leaves, some of which have values of `?`.
3. A tree where the optimal moves by Iris and Dora would result in a specific score.

Let's construct a small-scale test input:

```plaintext
1
6
1 2
1 3
2 4
2 5
3 6
?0????
```

### Explanation:
- **Tree Structure:**
  - Root node (1) has a value of `?`.
  - Node 1 is connected to nodes 2 and 3.
  - Node 2 is connected to nodes 4 and 5.
  - Node 3 is connected to node 6.
- **Vertex Values:**
  - Node 1: `?`
  - Node 2: `0`
  - Node 3: `?`
  - Node 4: `?`
  - Node 5: `?`
  - Node 6: `?`

### Expected Behavior:
- Iris and Dora will play optimally to maximize and minimize the score, respectively.
- The optimal moves will depend on the initial values and the structure of the tree.

### Expected Output:
- The final score of the tree should be calculated based on the optimal moves by Iris and Dora.

This test input should expose the bugs in the buggy code, particularly in how it handles the root node and the leaves with unknown values.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Iris and Game on the Tree
time_limit_ms: 2000
memory_limit_mb: 256
Description: Iris has a tree rooted at vertex $1$. Each vertex has a value of $\mathtt 0$ or $\mathtt 1$.

Let's consider a leaf of the tree (the vertex $1$ is never considered a leaf) and define its weight. Construct a string formed by the values of the vertices on the path starting at the root and ending in this leaf. Then the weight of the leaf is the difference between the number of occurrences of $\mathtt{10}$ and $\mathtt{01}$ substrings in it.

Take the following tree as an example. Green vertices have a value of $\mathtt 1$ while white vertices have a value of $\mathtt 0$.

![](CDN_BASE_URL/712e8f1acc71d0401cf5eb23441e53a5)

  * Let's calculate the weight of the leaf $5$: the formed string is $\mathtt{10110}$. The number of occurrences of substring $\mathtt{10}$ is $2$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $2 - 1 = 1$.   * Let's calculate the weight of the leaf $6$: the formed string is $\mathtt{101}$. The number of occurrences of substring $\mathtt{10}$ is $1$, the number of occurrences of substring $\mathtt{01}$ is $1$, so the difference is $1 - 1 = 0$.

The score of a tree is defined as the number of leaves with non-zero weight in the tree.

But the values of some vertices haven't been decided and will be given to you as $\texttt{?}$. Filling the blanks would be so boring, so Iris is going to invite Dora to play a game. On each turn, one of the girls chooses any of the remaining vertices with value $\texttt{?}$ and changes its value to $\mathtt{0}$ or $\mathtt{1}$, with Iris going first. The game continues until there are no vertices with value $\mathtt{?}$ left in the tree. Iris aims to maximize the score of the tree, while Dora aims to minimize that.

Assuming that both girls play optimally, please determine the final score of the tree.

Input: Each test consists of multiple test cases. The first line contains a single integer $t$ ($1 \leq t \leq 5\cdot 10^4$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $n$ ($2 \leq n \leq 10^5$) — the number of vertices in the tree.

The following $n - 1$ lines each contain two integers $u$ and $v$ ($1 \leq u, v \leq n$) — denoting an edge between vertices $u$ and $v$.

It's guaranteed that the given edges form a tree.

The last line contains a string $s$ of length $n$. The $i$-th character of $s$ represents the value of vertex $i$. It's guaranteed that $s$ only contains characters $\mathtt{0}$, $\mathtt{1}$ and $\mathtt{?}$.

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $2\cdot 10^5$.

Output: For each test case, output a single integer — the final score of the tree.

Examples:
input:
6
4
1 2
1 3
4 1
0101
4
1 2
3 2
2 4
???0
5
1 2
1 3
2 4
2 5
?1?01
6
1 2
2 3
3 4
5 3
3 6
?0????
5
1 2
1 3
1 4
1 5
11?1?
2
2 1
??
output:
2
1
1
2
1
0

Note: In the first test case, all the values of the vertices have been determined. There are three different paths from the root to a leaf:

  * From vertex $1$ to vertex $2$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.    * From vertex $1$ to vertex $3$. The string formed by the path is $\mathtt{00}$, so the weight of the leaf is $0-0=0$.    * From vertex $1$ to vertex $4$. The string formed by the path is $\mathtt{01}$, so the weight of the leaf is $0-1=-1$.

Thus, there are two leaves with non-zero weight, so the score of the tree is $2$.

In the second test case, one of the sequences of optimal choices for the two players can be:

  * Iris chooses to change the value of the vertex $3$ to $\mathtt 1$.    * Dora chooses to change the value of the vertex $1$ to $\mathtt 0$.    * Iris chooses to change the value of the vertex $2$ to $\mathtt 0$.

The final tree is as follows:

![](CDN_BASE_URL/c8e20d0cf352b7905e60a7b371f053d6)

The only leaf with non-zero weight is $3$, so the score of the tree is $1$. Note that this may not be the only sequence of optimal choices for Iris and Dora.

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

#define IN(i,l,r) (l<i&&i<r)
#define FOR(i,L,R) for (int i = L; i < R; i++)
#define FORE(i,L,R) for (int i = L; i <= R; i++)
#define FFOR(i,L,R) for (int i = L; i > R; i--)
#define FFORE(i,L,R) for (int i = L; i >= R; i--)
#define ll long long

int c0=0;
int c1=0;
int c2=0;

void dfs(int i,string val,vector<vector<int>>&adj,vector<bool>&vis){
    bool isLeaf=true;
    vis[i]=true;
    for(auto it:adj[i]){
        if(!vis[it]){
            isLeaf=false;
            dfs(it,val,adj,vis);
        }
    }
    if(isLeaf){
        if(val[i]=='1'){c1++;}
        if(val[i]=='0')c0++;
        if(val[i]=='?') c2++;
    }
}

int solve(){
    int n;cin>>n;
    vector<vector<int>>adj(n);
    vector<bool>vis(n,0);
    string val;
    c1=0;c2=0;c0=0;

    for(int i=0;i<n-1;i++){
        int a, b;cin>>a>>b;
        a--;b--;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    cin>>val;

    dfs(0,val,adj,vis);

    int ans=0;
    int k=0;
    for(int i=0;i<n;i++){
        if(val[i]=='?'){
            k++;
        }
    }

    k=k-c2;
    if(val[0]=='1'){
        ans+=c0;
        ans=ans+(c2+1)/2;
    }
    else if(val[0]=='0'){
        ans=ans+c1;
        ans=ans+(c2+1)/2;
    }
    else{
        k--;

        int p1=c1+c2/2;
        int p0=c0+c2/2;

        if(c0==c1&&k%2){
            p1=c1+(c2+1)/2;
        }

        ans=max(p1,p0);
    }
    return ans;

}

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

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt","w", stdout);
    #endif

    int t;cin>>t;

    while(t--){
        cout<<solve()<<endl;
    }
 return 0;
}

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

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

Think step by step.

Response:
To expose the bug in the provided code, we need to focus on edge cases that might cause the code to fail. The code appears to have issues with handling the optimal play of both Iris and Dora, especially when the values of the vertices are not fully determined.

Let's consider a small tree with a few vertices and some unknown values. We'll create a test case where the optimal play of both players is crucial to determine the final score of the tree.

### Step-by-Step Reasoning:

1. **Tree Structure**: We need a tree with at least one unknown value and a few leaves to test the weight calculation.
2. **Initial Values**: Some vertices should have known values (0 or 1) and some should have unknown values (?).
3. **Optimal Play**: The test case should be designed such that the optimal play of both players (Iris and Dora) is not trivial and affects the final score.

### Example Test Case:
- **Tree with 5 vertices**:
  - Edges: (1, 2), (1, 3), (2, 4), (2, 5)
  - Values: 1, ?, 0, ?, ?

This tree has the following structure:
- Root (1) with value 1
- Child (2) with unknown value
- Child (3) with value 0
- Grandchild (4) of (2) with unknown value
- Grandchild (5) of (2) with unknown value

### Expected Behavior:
- **Initial State**:
  - Root (1): 1
  - Child (2): ?
  - Child (3): 0
  - Grandchild (4): ?
  - Grandchild (5): ?

- **Optimal Play**:
  - Iris can choose to set the value of (2) to 1 to maximize the score.
  - Dora can then set the value of (4) to 0 to minimize the score.
  - Iris can set the value of (5) to 1 to maximize the score.

- **Final Tree**:
  - Root (1): 1
  - Child (2): 1
  - Child (3): 0
  - Grandchild (4): 0
  - Grandchild (5): 1

- **Leaf Weights**:
  - Leaf (3): Path 1-3 -> 10 -> Weight = 0-1 = -1
  - Leaf (4): Path 1-2-4 -> 110 -> Weight = 0-1 = -1
  - Leaf (5): Path 1-2-5 -> 111 -> Weight = 0-0 = 0

- **Final Score**: 2 (leaves 3 and 4 have non-zero weights)

### Test Input:
```plaintext
1
5
1 2
1 3
2 4
2 5
1?0??
```

This test input should expose the bug in the code by requiring the optimal play of both Iris and Dora to determine the final score correctly.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Not a Nim Problem
time_limit_ms: 2000
memory_limit_mb: 512
Description: Two players, Alice and Bob, are playing a game. They have $n$ piles of stones, with the $i$-th pile initially containing $a_i$ stones.

On their turn, a player can choose any pile of stones and take any positive number of stones from it, with one condition:

  * let the current number of stones in the pile be $x$. It is not allowed to take from the pile a number of stones $y$ such that the greatest common divisor of $x$ and $y$ is not equal to $1$.

The player who cannot make a move loses. Both players play optimally (that is, if a player has a strategy that allows them to win, no matter how the opponent responds, they will win). Alice goes first.

Determine who will win.

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

Each test case consists of two lines:

  * the first line contains a single integer $n$ ($1 \le n \le 3 \cdot 10^5$);    * the second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^7$).

Additional constraint on the input: the sum of $n$ across all test cases does not exceed $3 \cdot 10^5$.

Output: For each test case, output Alice if Alice wins, or Bob if Bob wins.

Examples:
input:
3
3
3 2 9
4
3 3 6 1
5
1 2 3 4 5
output:
Bob
Alice
Bob

Note:

Buggy Code:
#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;

#define all(x) x.begin(), x.end()
#define sz(x) ((int) ((x).size()))
#define pb push_back
#define F first
#define S second
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

int n;
int s[1000010];
map<int, int> p;

void solve() {
	cin >> n;

	int x = 0;

	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		x ^= p[s[t]];
	}

	if  (x != 0) {
		cout << "Bob" << endl;
	} else

		cout << "Alice" << endl;
}

int main() {
	int cnt = 0;
	for (int i = 2; i < 1000010; i++) {
		if (!s[i]) {
			p[i] = cnt;
			cnt++;
			for (int j = 2; j < 1000010; j += i) {
				s[j] = i;
			}
		}
	}

	FIO;
	int t = 1;
	cin >> t;
	while(t--) {
		solve();
	}
	return 0;
}

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

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

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided code, we need to focus on the logic of the game and how the code handles it. The code uses a map to assign a unique value to each prime number and then uses these values to compute the XOR of the pile sizes. The issue lies in how the code handles the XOR operation and the conditions for winning.

### Key Points to Consider:
1. **Prime Number Handling**: The code uses a map to assign a unique value to each prime number. This is used to compute the XOR of the pile sizes.
2. **XOR Operation**: The code computes the XOR of the values assigned to the prime factors of the pile sizes.
3. **Winning Condition**: The code determines the winner based on the XOR result. If the XOR is non-zero, Bob wins; otherwise, Alice wins.

### Challenging Scenario:
A challenging scenario would be one where the XOR of the values assigned to the prime factors results in a non-zero value, but the actual game rules would suggest that Alice should win. This can happen if the code incorrectly assigns values to prime factors or if the XOR operation is not correctly reflecting the game state.

### Test Input:
We can create a test case where the pile sizes are such that the XOR of the values assigned to the prime factors results in a non-zero value, but the actual game rules would suggest that Alice should win.

```plaintext
1
5
2 3 5 7 11
```

### Explanation:
- The piles are 2, 3, 5, 7, and 11, which are all prime numbers.
- The code assigns unique values to these primes and computes the XOR.
- If the XOR of these values is non-zero, the code will incorrectly determine that Bob wins, even though Alice should win because all piles are prime and Alice can always make a move.

This test input should expose the bug in the code by showing that the XOR operation is not correctly reflecting the game state.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Not a Nim Problem
time_limit_ms: 2000
memory_limit_mb: 512
Description: Two players, Alice and Bob, are playing a game. They have $n$ piles of stones, with the $i$-th pile initially containing $a_i$ stones.

On their turn, a player can choose any pile of stones and take any positive number of stones from it, with one condition:

  * let the current number of stones in the pile be $x$. It is not allowed to take from the pile a number of stones $y$ such that the greatest common divisor of $x$ and $y$ is not equal to $1$.

The player who cannot make a move loses. Both players play optimally (that is, if a player has a strategy that allows them to win, no matter how the opponent responds, they will win). Alice goes first.

Determine who will win.

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

Each test case consists of two lines:

  * the first line contains a single integer $n$ ($1 \le n \le 3 \cdot 10^5$);    * the second line contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^7$).

Additional constraint on the input: the sum of $n$ across all test cases does not exceed $3 \cdot 10^5$.

Output: For each test case, output Alice if Alice wins, or Bob if Bob wins.

Examples:
input:
3
3
3 2 9
4
3 3 6 1
5
1 2 3 4 5
output:
Bob
Alice
Bob

Note:

Buggy Code:
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long
#define ul unsigned long long
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vpl vector<pll>
#define vpi vector<pii>
#define vvi vector<vi>
#define vvl vector<vl>
#define vb vector<bool>
#define vs vector<string>
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define frs(i,n) for(ll i=1;i*i<=n;i++)
#define fr(i,a,b,c) for(ll i=a;i<b;i+=c)
#define ff first
#define ss second
#define pb push_back
#define be() begin()
#define all(a) a.be(),a.end()
#define lb(a,x) lower_bound(all(a),x)-a.be()
#define nl cout<<"\n";
#define ub(a,x) upper_bound(all(a),x)-a.be()
#define me max_element
#define mpl map<ll,ll>
#define umpl unordered_map<ll,ll>
#define stl stack<ll>
#define qul queue<ll>
#define sz(a) a.size()
#define rev(a) reverse(a.be(),a.end())
#define zbit(x) __builtin_ctzll(x)
#define sbit(x)  __builtin_popcountll(x)
#define lzbit(x) __builtin_clzll(x)
#define sl set<ll>
#define py cout<<"YES";
#define pm cout<<"-1";
#define pn cout<<"NO";
#define fbo find_by_order
#define ook order_of_key
#define pnt(x) cout<<x
#pragma GCC target("popcnt")

using namespace std;
using u64 = uint64_t;
using u128 = __uint128_t;
using namespace __gnu_pbds;

template<typename T>
using oset= tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

u64 binpower(u64 base, u64 e, u64 mod) {
    u64 result = 1;
    base %= mod;
    while (e) {
        if (e & 1)
            result = (u128)result * base % mod;
        base = (u128)base * base % mod;
        e >>= 1;
    }
    return result;
}

bool check_composite(u64 n, u64 a, u64 d, int s) {
    u64 x = binpower(a, d, n);
    if (x == 1 || x == n - 1)
        return false;
    for (int r = 1; r < s; r++) {
        x = (u128)x * x % n;
        if (x == n - 1)
            return false;
    }
    return true;
};
bool iPrime(u64 n) {
    if (n < 2)
        return false;

    int r = 0;
    u64 d = n - 1;
    while ((d & 1) == 0) {
        d >>= 1;
        r++;
    }

    for (int a : {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}) {
        if (n == a)
            return true;
        if (check_composite(n, a, d, r))
            return false;
    }
    return true;
}

/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
ll sm(vl a,ll s=0){for(auto i:a) s+=i;return s;}
void pre(vl &a){rep(i,1,sz(a)) a[i]+=a[i-1];}
void sieve(vb &x,ll n){x[0]=x[1]=0;for(ll i=2;i*i<=n;i++)if(x[i])for(ll j=i*i;j<=n;j+=i)x[j]=0;}
ll isprime(ll n){if(n==1||n==0)return 0;if(n==2||n==3)return 1;if(n%2==0||n%3==0)return 0;for(ll i=5;i<=n/2;i+=6)if(n%i==0||n%(i+2)==0)return 0;return 1;}
void primef(ll n,vl &x){if(!(n&1)){x.pb(2);while(!(n&1))n=n>>1;}for(ll i=3;i*i<=n;i+=2){if(n%i==0){x.pb(i);while(n%i==0)n/=i;}}if(n>2)x.pb(n);}
ll freq(ll n,ll d){if(n%d!=0)return 0;return 1+freq(n/d,d);}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
void pow2(vl &x){x.pb(1);while(sz(x)<=60)x.pb(2*x[sz(x)-1]);}
bool sorta( pll a, pll b){return (a.ss < b.ss);}
bool sortd( pll a, pll b){return (a.ss > b.ss);}
void tobin(ll n,string &s){while(n>0){if(n&1)s.pb('1');else s.pb('0');n=n>>1;}}
void printv(vl v){for(auto i: v)cout<<i<<" ";}
char toc(ll n){char c='0';c+=n;return c;}
ll toi(char c){ll x=c-'0';return x;}
ll ain(char c){ll in=c-'a';return in;}
ll mi(ll a,ll b){return a+(b-a)/2;}
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

//-----SEGMENT TREE-----//

/*ll st(vl a,vl& s,ll e,ll b=0,ll i=0)
{
    if(b==e)
    {
        s[i]=a[b];
        return a[b];
    }
    ll m=b+(e-b)/2;
    s[i]=st(a,s,m,b,2*i+1)+st(a,s,e,m+1,2*i+2);
    return s[i];
}
ll gsm(vl s,ll l,ll r,ll e,ll b=0,ll i=0)
{
    if(l<=b&&r>=e)
    return s[i];
    if(l>e||r<b)
    return 0;
    ll m=b+(e-b)/2;
    return gsm(s,l,r,m,b,2*i+1)+gsm(s,l,r,e,m+1,2*i+2);
}
void update(vl& s,ll d,ll j,ll e,ll b=0,ll i=0)
{
    if(j<b||j>e)
    return;
    s[i]+=d;
    if(b!=e)
    {
        ll m=b+(e-b)/2;
        update(s,d,j,m,b,2*i+1);
        update(s,d,j,e,m+1,2*i+2);
    }
    return;
}
*/

/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

const ll hashp=1e18+7; //790738119649411319;
const ll mod=1e9+7; //998244353;
const ld pi= 3.141592653589793238;
const ll inf=2e18;

ll ext_gcd(ll a, ll b, ll &x, ll &y)
{
    if(!b)
    {
        x=1,y=0;
        return a;
    }
    ll x1,y1;
    ll g=ext_gcd(b,a%b,x1,y1);
    x=y1,y=x1-(a/b)*y1;
    return g;
}
ll powe(ll a,ll p,ll m=inf)
{
    if(p==0)
    return 1;
    ll result=powe(a,p>>1,m);
    if(p&1)
    return ((((a%m)*result)%m)*result)%m;
    return (result*result)%m;
}
ll add(ll a,ll b)
{
    return ((a%mod)+(b%mod))%mod;
}
ll mul(ll a,ll b)
{
    return ((a%mod)*(b%mod))%mod;
}
ll sub(ll a,ll b)
{
    return ((a%mod)-(b%mod)+mod)%mod;
}
ll divi(ll a,ll b)
{
    b=powe(b,mod-2,mod);
    return mul(a,b);
}
void facto(vl &f, ll n)
{
    f[0]=1,f[1]=1;
    rep(i,2,n)
    f[i]=mul(i,f[i-1]);
    return;
}

/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //cout<<fixed<<setprecision(9);
    ll t;
    cin>>t;

    ll mxn=1e7+5;

    while(t--)
    {
        ll n,k;
        cin>>n;

        ll c1=0;
        rep(i,0,n){
            ll x;
            cin>>x;
            c1+=(x&1);
        }
        n-=c1;

        ((n&1)==(c1&1))?pnt("Alice"):pnt("Bob");

        nl
    }

    return 0;
}

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

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

Think step by step.

Response:
```plaintext
1
4
3 4 6 8
```