apaz/codeforces-genesys huggingface dataset:
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
378QAQ has a tree with $$$n$$$ vertices. Initially, all vertices are white.

There are two chess pieces called $$$P_A$$$ and $$$P_B$$$ on the tree. $$$P_A$$$ and $$$P_B$$$ are initially located on vertices $$$a$$$ and $$$b$$$ respectively. In one step, 378QAQ will do the following in order:

1. Move $$$P_A$$$ to a neighboring vertex. If the target vertex is white, this vertex will be painted red.
2. Move $$$P_B$$$ to a neighboring vertex. If the target vertex is colored in red, this vertex will be painted blue.

Initially, the vertex $$$a$$$ is painted red. If $$$a=b$$$, the vertex $$$a$$$ is painted blue instead. Note that both the chess pieces must be moved in each step. Two pieces can be on the same vertex at any given time.

378QAQ wants to know the minimum number of steps to paint all vertices blue.

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

The first line of each test case contains one integer $$$n$$$ ($$$1\leq n\leq 2\cdot 10^5$$$).

The second line of each test case contains two integers $$$a$$$ and $$$b$$$ ($$$1\leq a,b\leq n$$$).

Then $$$n - 1$$$ lines follow, each line contains two integers $$$x_i$$$ and $$$y_i$$$ ($$$1 \le x_i,y_i \le n$$$), indicating an edge between vertices $$$x_i$$$ and $$$y_i$$$. It is guaranteed that these edges form a tree.

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

## Output Format
For each test case, output the minimum number of steps to paint all vertices blue.

## Examples
```input
3
2
1 2
1 2
5
1 2
1 2
1 3
1 4
1 5
8
5 4
7 1
1 5
1 8
8 3
7 2
8 6
3 4
```
```output
2
8
13
```

## Note
In the first test case, 378QAQ can paint all vertices blue in the following order:

- Initially, $$$P_A$$$ is located on the vertex $$$1$$$, and $$$P_B$$$ is located on the vertex $$$2$$$. The vertex $$$1$$$ is painted red and the vertex $$$2$$$ is white.
- 378QAQ moves $$$P_A$$$ to the vertex $$$2$$$ and paints it red. Then 378QAQ moves $$$P_B$$$ to the vertex $$$1$$$ and paints it blue.
- 378QAQ moves $$$P_A$$$ to the vertex $$$1$$$. Then 378QAQ moves $$$P_B$$$ to the vertex $$$2$$$ and paints it blue.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
You are given a tree of $$$n$$$ vertices numbered from $$$1$$$ to $$$n$$$. Initially, all vertices are colored white or black.

You are asked to perform $$$q$$$ queries:

- "u" — toggle the color of vertex $$$u$$$ (if it was white, change it to black and vice versa).

After each query, you should answer whether all the black vertices form a chain. That is, there exist two black vertices such that the simple path between them passes through all the black vertices and only the black vertices. Specifically, if there is only one black vertex, they form a chain. If there are no black vertices, they do not form a chain.

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

The first line of each test case contains two integers $$$n$$$ and $$$q$$$ ($$$1\leq n,q\leq 2\cdot 10^5$$$).

The second line of each test case contains $$$n$$$ integers $$$c_1,c_2,\ldots,c_n$$$ ($$$c_i \in \{ \mathtt{0}, \mathtt{1} \}$$$) — the initial color of the vertices. $$$c_i$$$ denotes the color of vertex $$$i$$$ where $$$\mathtt{0}$$$ denotes the color white, and $$$\mathtt{1}$$$ denotes the color black.

Then $$$n - 1$$$ lines follow, each line contains two integers $$$x_i$$$ and $$$y_i$$$ ($$$1 \le x_i,y_i \le n$$$), indicating an edge between vertices $$$x_i$$$ and $$$y_i$$$. It is guaranteed that these edges form a tree.

The following $$$q$$$ lines each contain an integer $$$u_i$$$ ($$$1 \le u_i \le n$$$), indicating the color of vertex $$$u_i$$$ needs to be toggled.

It is guaranteed that the sum of $$$n$$$ and $$$q$$$ over all test cases respectively does not exceed $$$2\cdot 10^5$$$.

## Output Format
For each query, output "Yes" if the black vertices form a chain, and output "No" otherwise.

You can output "Yes" and "No" in any case (for example, strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive response).

## Examples
```input
2
2 1
1 0
1 2
1
5 4
1 0 0 0 0
1 2
1 3
1 5
3 4
4
3
2
5
```
```output
No
No
Yes
Yes
No
```
-----
```input
4
5 3
1 1 1 1 1
3 5
2 5
3 4
1 5
1
1
1
4 4
0 0 0 0
1 2
2 3
1 4
1
2
3
2
1 1
1
1
1 1
0
1
```
```output
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
```

## Note
In the second test case, the color of the vertices are as follows:

The initial tree:

The first query toggles the color of vertex $$$4$$$:

The second query toggles the color of vertex $$$3$$$:

The third query toggles the color of vertex $$$2$$$:

The fourth query toggles the color of vertex $$$5$$$:

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 512.0 MB

# Problem
Define the binary encoding of a finite set of natural numbers $$$T \subseteq \{0,1,2,\ldots\}$$$ as $$$f(T) = \sum\limits_{i \in T} 2^i$$$. For example, $$$f(\{0,2\}) = 2^0 + 2^2 = 5$$$ and $$$f(\{\}) = 0$$$. Notice that $$$f$$$ is a bijection from all such sets to all non-negative integers. As such, $$$f^{-1}$$$ is also defined.

You are given an integer $$$n$$$ along with $$$2^n-1$$$ sets $$$V_1,V_2,\ldots,V_{2^n-1}$$$.

Find all sets $$$S$$$ that satisfy the following constraint:

- $$$S \subseteq \{0,1,\ldots,n-1\}$$$. Note that $$$S$$$ can be empty.
- For all non-empty subsets $$$T \subseteq \{0,1,\ldots,n-1\}$$$, $$$|S \cap T| \in V_{f(T)}$$$.

Due to the large input and output, both input and output will be given in terms of binary encodings of the sets.

## Input Format
The first line of input contains a single integer $$$n$$$ ($$$1 \leq n \leq 20$$$).

The second line of input contains $$$2^n-1$$$ integers $$$v_1,v_2,\ldots,v_{2^n-1}$$$ ($$$0 \leq v_i < 2^{n+1}$$$) — the sets $$$V_i$$$ given in their binary encoding where $$$V_i = f^{-1}(v_i)$$$.

## Output Format
The first line of output should contain an integer $$$k$$$ indicating the number of possible $$$S$$$.

In the following $$$k$$$ lines, you should output $$$f(S)$$$ for all possible $$$S$$$ in increasing order.

## Examples
```input
3
15 15 15 15 15 15 12
```
```output
4
3
5
6
7
```
-----
```input
5
63 63 63 63 6 63 63 63 63 63 63 5 63 63 63 63 63 63 8 63 63 63 63 2 63 63 63 63 63 63 63
```
```output
1
19
```

## Note
In the first test case, one possible $$$S$$$ is $$$f^{-1}(3) = \{0,1\}$$$. All the non-empty subsets $$$T \subseteq \{0,1,2\}$$$ and the corresponding $$$|S \cap T|$$$, $$$f(T)$$$ and $$$V_f(T)$$$ are as follows:

$$$T$$$$$$|S\cap T|$$$$$$f(T)$$$$$$V_{f(T)}$$$$$$\{0\}$$$$$$1$$$$$$1$$$$$$\{0,1,2,3\}$$$$$$\{1\}$$$$$$1$$$$$$2$$$$$$\{0,1,2,3\}$$$$$$\{2\}$$$$$$0$$$$$$4$$$$$$\{0,1,2,3\}$$$$$$\{0,1\}$$$$$$2$$$$$$3$$$$$$\{0,1,2,3\}$$$$$$\{0,2\}$$$$$$1$$$$$$5$$$$$$\{0,1,2,3\}$$$$$$\{1,2\}$$$$$$1$$$$$$6$$$$$$\{0,1,2,3\}$$$$$$\{0,1,2\}$$$$$$2$$$$$$7$$$$$$\{2,3\}$$$

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 12.0 seconds
Memory limit: 512.0 MB

# Problem
One day, Zimpha casually came up with a problem. As a member of "Zimpha fan club", you decided to solve that problem.

You are given two strings $$$s$$$ and $$$t$$$ of length $$$n$$$ and $$$m$$$, respectively. Both strings only consist of lowercase English letters, - and *.

You need to replace all occurrences of * and -, observing the following rules:

- For each -, you must replace it with any lowercase English letter.
- For each *, you must replace it with a string of any (possibly, zero) length which only consists of lowercase English letters.

Note that you can replace two different instances of - with different characters. You can also replace each two different instances of * with different strings.

Suppose $$$s$$$ and $$$t$$$ have been transformed into $$$s'$$$ and $$$t'$$$. Now you're wondering if there's a replacement that makes $$$s'=t'$$$.

## Input Format
The first line of input contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 2 \cdot 10^6$$$) — the length of the strings $$$s$$$ and $$$t$$$, respectively.

The second line contains the string $$$s$$$ of length $$$n$$$. It is guaranteed that $$$s$$$ only consists of lowercase English letters, - and *.

The third line contains the string $$$t$$$ of length $$$m$$$. It is guaranteed that $$$t$$$ only consists of lowercase English letters, - and *.

## Output Format
For each test case, output "Yes" if there is a replacement that makes $$$s'=t'$$$, and output "No" otherwise.

You can output "Yes" and "No" in any case (for example, strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive response).

## Examples
```input
10 10
justmonika
j-stsayori
```
```output
No
```
-----
```input
7 8
ttk-wxx
*tt-l-xx
```
```output
Yes
```
-----
```input
13 11
asoulwangziji
-soulg*z-y-
```
```output
No
```
-----
```input
7 3
abc*cba
a*c
```
```output
No
```
-----
```input
20 18
bulijiojio-dibuliduo
*li*ji-*ox*i*-du*-
```
```output
Yes
```

## Note
In the second test case, we can transform both strings into ttklwxx. In $$$s$$$, - will be replaced with l. In $$$t$$$, * will be replaced by the empty string with the first and second - will be replaced with k and w respectively.

In the fifth test case, we can transform both strings into bulijiojioxdibuliduo.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
378QAQ has a string $$$s$$$ of length $$$n$$$. Define the core of a string as the substring$$$^\dagger$$$ with maximum lexicographic$$$^\ddagger$$$ order.

For example, the core of "$$$\mathtt{bazoka}$$$" is "$$$\mathtt{zoka}$$$", and the core of "$$$\mathtt{aaa}$$$" is "$$$\mathtt{aaa}$$$".

378QAQ wants to rearrange the string $$$s$$$ so that the core is lexicographically minimum. Find the lexicographically minimum possible core over all rearrangements of $$$s$$$.

$$$^\dagger$$$ A substring of string $$$s$$$ is a continuous segment of letters from $$$s$$$. For example, "$$$\mathtt{defor}$$$", "$$$\mathtt{code}$$$" and "$$$\mathtt{o}$$$" are all substrings of "$$$\mathtt{codeforces}$$$" while "$$$\mathtt{codes}$$$" and "$$$\mathtt{aaa}$$$" are not.

$$$^\ddagger$$$ A string $$$p$$$ is lexicographically smaller than a string $$$q$$$ if and only if one of the following holds:

- $$$p$$$ is a prefix of $$$q$$$, but $$$p \ne q$$$; or
- in the first position where $$$p$$$ and $$$q$$$ differ, the string $$$p$$$ has a smaller element than the corresponding element in $$$q$$$ (when compared by their ASCII code).

For example, "$$$\mathtt{code}$$$" and "$$$\mathtt{coda}$$$" are both lexicographically smaller than "$$$\mathtt{codeforces}$$$" while "$$$\mathtt{codeforceston}$$$" and "$$$\mathtt{z}$$$" are not.

## Input Format
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1\leq t\leq 10^5$$$). The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$1\leq n\leq 10^6$$$) — the length of string $$$s$$$.

The next line of each test case contains the string $$$s$$$ of length $$$n$$$. The string $$$s$$$ consists of lowercase English letters.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^6$$$.

## Output Format
For each test case, output the lexicographically minimum possible core over all rearrangements of $$$s$$$.

## Examples
```input
6
3
qaq
4
cccc
6
bazoka
6
zazzzz
7
ababbbb
7
ccbabcc
```
```output
qaq
cccc
z
zzz
bbababb
cbcacbc
```

## Note
In the first test case, all possible rearrangements and their corresponding cores are as follows:

- "$$$\mathtt{qaq}$$$", its core is "$$$\mathtt{qaq}$$$".
- "$$$\mathtt{aqq}$$$", its core is "$$$\mathtt{qq}$$$".
- "$$$\mathtt{qqa}$$$", its core is "$$$\mathtt{qqa}$$$".

So the core with the minimum lexicographic order in all rearrangement plans is "$$$\mathtt{qaq}$$$".

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 1.0 seconds
Memory limit: 256.0 MB

# Problem
You are given two distinct non-negative integers $$$x$$$ and $$$y$$$. Consider two infinite sequences $$$a_1, a_2, a_3, \ldots$$$ and $$$b_1, b_2, b_3, \ldots$$$, where

- $$$a_n = n \oplus x$$$;
- $$$b_n = n \oplus y$$$.

Here, $$$x \oplus y$$$ denotes the bitwise XOR operation of integers $$$x$$$ and $$$y$$$.

For example, with $$$x = 6$$$, the first $$$8$$$ elements of sequence $$$a$$$ will look as follows: $$$[7, 4, 5, 2, 3, 0, 1, 14, \ldots]$$$. Note that the indices of elements start with $$$1$$$.

Your task is to find the length of the longest common subsegment$$$^\dagger$$$ of sequences $$$a$$$ and $$$b$$$. In other words, find the maximum integer $$$m$$$ such that $$$a_i = b_j, a_{i + 1} = b_{j + 1}, \ldots, a_{i + m - 1} = b_{j + m - 1}$$$ for some $$$i, j \ge 1$$$.

$$$^\dagger$$$A subsegment of sequence $$$p$$$ is a sequence $$$p_l,p_{l+1},\ldots,p_r$$$, where $$$1 \le l \le r$$$.

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

The only line of each test case contains two integers $$$x$$$ and $$$y$$$ ($$$0 \le x, y \le 10^9, x \neq y$$$) — the parameters of the sequences.

## Output Format
For each test case, output a single integer — the length of the longest common subsegment.

## Examples
```input
4
0 1
12 4
57 37
316560849 14570961
```
```output
1
8
4
33554432
```

## Note
In the first test case, the first $$$7$$$ elements of sequences $$$a$$$ and $$$b$$$ are as follows:

$$$a = [1, 2, 3, 4, 5, 6, 7,\ldots]$$$

$$$b = [0, 3, 2, 5, 4, 7, 6,\ldots]$$$

It can be shown that there isn't a positive integer $$$k$$$ such that the sequence $$$[k, k + 1]$$$ occurs in $$$b$$$ as a subsegment. So the answer is $$$1$$$.

In the third test case, the first $$$20$$$ elements of sequences $$$a$$$ and $$$b$$$ are as follows:

$$$a = [56, 59, 58, 61, 60, 63, 62, 49, 48, 51, 50, 53, 52, 55, 54, \textbf{41, 40, 43, 42}, 45, \ldots]$$$

$$$b = [36, 39, 38, 33, 32, 35, 34, 45, 44, 47, 46, \textbf{41, 40, 43, 42}, 53, 52, 55, 54, 49, \ldots]$$$

It can be shown that one of the longest common subsegments is the subsegment $$$[41, 40, 43, 42]$$$ with a length of $$$4$$$.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 2.0 seconds
Memory limit: 256.0 MB

# Problem
You have been offered to play a game. In this game, there are $$$n$$$ possible outcomes, and for each of them, you must bet a certain integer amount of coins. In the event that the $$$i$$$-th outcome turns out to be winning, you will receive back the amount of coins equal to your bet on that outcome, multiplied by $$$k_i$$$. Note that exactly one of the $$$n$$$ outcomes will be winning.

Your task is to determine how to distribute the coins in such a way that you will come out ahead in the event of any winning outcome. More formally, the total amount of coins you bet on all outcomes must be strictly less than the number of coins received back for each possible winning outcome.

## Input Format
Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 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$$$ ($$$1 \le n \le 50$$$) — the number of outcomes.

The second line of each test case contains $$$n$$$ integers $$$k_1,k_2,\ldots,k_n$$$ ($$$2 \le k_i \le 20$$$) — the multiplier for the amount of coins if the $$$i$$$-th outcome turns out to be winning.

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

## Output Format
For each test case, output $$$-1$$$ if there is no way to distribute the coins as required. Otherwise, output $$$n$$$ integers $$$x_1, x_2,\ldots, x_n$$$ ($$$1 \le x_i \le 10^{9}$$$) — your bets on the outcomes.

It can be shown that if a solution exists, there is always a solution that satisfies these constraints.

If there are multiple suitable solutions, output any of them.

## Examples
```input
6
3
3 2 7
2
3 3
5
5 5 5 5 5
6
7 9 3 17 9 13
3
6 3 2
5
9 4 6 8 3
```
```output
27 41 12 
1 1 
-1
1989 1547 4641 819 1547 1071 
-1
8 18 12 9 24
```

## Note
In the first test case, the coins can be distributed as follows: $$$27$$$ coins on the first outcome, $$$41$$$ coins on the second outcome, $$$12$$$ coins on the third outcome. Then the total amount of coins bet on all outcomes is $$$27 + 41 + 12 = 80$$$ coins. If the first outcome turns out to be winning, you will receive back $$$3 \cdot 27 = 81$$$ coins, if the second outcome turns out to be winning, you will receive back $$$2 \cdot 41 = 82$$$ coins, if the third outcome turns out to be winning, you will receive back $$$7 \cdot 12 = 84$$$ coins. All these values are strictly greater than $$$80$$$.

In the second test case, one way is to bet one coin on each of the outcomes.

Now solve the problem and return the code.
You are an expert competitive programmer. You will be given a problem statement, test case constraints and example test inputs and outputs. Please reason step by step about the solution (that must respect memory and time limits), then provide a complete implementation in python3.

Your solution must read input from standard input (cin), write output to standard output (cout).
Do not include any debug prints or additional output.

Put your final solution within a single code block:
```python
<your code here>
```

Execution time limit: 3.0 seconds
Memory limit: 256.0 MB

# Problem
The Manhattan distance between two points $$$(x_1, y_1)$$$ and $$$(x_2, y_2)$$$ is defined as: $$$$$$|x_1 - x_2| + |y_1 - y_2|.$$$$$$

We call a Manhattan triangle three points on the plane, the Manhattan distances between each pair of which are equal.

You are given a set of pairwise distinct points and an even integer $$$d$$$. Your task is to find any Manhattan triangle, composed of three distinct points from the given set, where the Manhattan distance between any pair of vertices is equal to $$$d$$$.

## Input Format
Each test consists of multiple test cases. The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains two integers $$$n$$$ and $$$d$$$ ($$$3 \le n \le 2 \cdot 10^5$$$, $$$2 \le d \le 4 \cdot 10^5$$$, $$$d$$$ is even) — the number of points and the required Manhattan distance between the vertices of the triangle.

The $$$(i + 1)$$$-th line of each test case contains two integers $$$x_i$$$ and $$$y_i$$$ ($$$-10^5 \le x_i, y_i \le 10^5$$$) — the coordinates of the $$$i$$$-th point. It is guaranteed that all points are pairwise distinct.

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

## Output Format
For each test case, output three distinct integers $$$i$$$, $$$j$$$, and $$$k$$$ ($$$1 \le i,j,k \le n$$$) — the indices of the points forming the Manhattan triangle. If there is no solution, output "$$$0\ 0\ 0$$$" (without quotes).

If there are multiple solutions, output any of them.

## Examples
```input
6
6 4
3 1
0 0
0 -2
5 -3
3 -5
2 -2
5 4
0 0
0 -2
5 -3
3 -5
2 -2
6 6
3 1
0 0
0 -2
5 -3
3 -5
2 -2
4 4
3 0
0 3
-3 0
0 -3
10 8
2 1
-5 -1
-4 -1
-5 -3
0 1
-2 5
-4 4
-4 2
0 0
-4 1
4 400000
100000 100000
-100000 100000
100000 -100000
-100000 -100000
```
```output
2 6 1
4 3 5
3 5 1
0 0 0
6 1 3
0 0 0
```

## Note
In the first test case:

Points $$$A$$$, $$$B$$$, and $$$F$$$ form a Manhattan triangle, the Manhattan distance between each pair of vertices is $$$4$$$. Points $$$D$$$, $$$E$$$, and $$$F$$$ can also be the answer.

In the third test case:

Points $$$A$$$, $$$C$$$, and $$$E$$$ form a Manhattan triangle, the Manhattan distance between each pair of vertices is $$$6$$$.

In the fourth test case, there are no two points with a Manhattan distance of $$$4$$$, and therefore there is no suitable Manhattan triangle.

Now solve the problem and return the code.