PROGRAMMING:And search [template]
Given a query set, please complete the merge and query operations.
###Input format:
The first line contains two integers n and m, indicating that there are n elements and M operations.
Next, m lines, each containing three integers $$Z_{ i}$$、$$X_{ i}$$、$$Y_{ i}$$。
When $$Z_{ i} When $$= 1, $$X_{ i} $$and $$Y_{ i} The collection in which $$.
When $$Z_{ i} When $$= 2, $$X is output_{ i} $$and $$Y_{ i} $$is in the same set, if yes, output y; Otherwise, output n.
###Output format:
For each $$Z_{ i} $$= 2, corresponding to a line of output, each line contains a capital letter, y or n.
###Input example:
```in
4 7
2 1 2
1 1 2
2 1 2
1 3 4
2 1 4
1 2 3
2 1 4
```
###Output example:
```out
N
Y
N
Y
```
###Data size:
For 30% data, n < = 10, m < = 20;
For 70% data, n < = 100, m < = 1000;
For 100% data, n < = 10000, m < = 200000.
answer:If there is no answer, please comment
###Input format:
The first line contains two integers n and m, indicating that there are n elements and M operations.
Next, m lines, each containing three integers $$Z_{ i}$$、$$X_{ i}$$、$$Y_{ i}$$。
When $$Z_{ i} When $$= 1, $$X_{ i} $$and $$Y_{ i} The collection in which $$.
When $$Z_{ i} When $$= 2, $$X is output_{ i} $$and $$Y_{ i} $$is in the same set, if yes, output y; Otherwise, output n.
###Output format:
For each $$Z_{ i} $$= 2, corresponding to a line of output, each line contains a capital letter, y or n.
###Input example:
```in
4 7
2 1 2
1 1 2
2 1 2
1 3 4
2 1 4
1 2 3
2 1 4
```
###Output example:
```out
N
Y
N
Y
```
###Data size:
For 30% data, n < = 10, m < = 20;
For 70% data, n < = 100, m < = 1000;
For 100% data, n < = 10000, m < = 200000.
answer:If there is no answer, please comment