## Bitwise Convolution 1, 2, 3

##### Bitwise Convolution Exercises 1, 2, 3

This is a practice problem for bitwise convolution using the Fast Walsh–Hadamard transform. Exercises come from here.

**Exercise 1: Bitwise XOR convolution****Exercise 2: Bitwise OR convolution****Exercise 3: Bitwise AND convolution**Exercise 4: An operation that ORs the first bit, ANDs the second bit, and then repeats.

Exercise 5: An operation that ORs the first bit, ANDs the second bit, XORs the third one, and then repeats.

Exercise 6: XOR in base 3 (addition with no carry).

#### Input and Output Specification

The first line contains the integers () and (), the exercise number and the length of the vectors and . The next line will contain and the line after will contain .

You will ouput a vector of length , the vector , where is the convolution operation of the respective subtask. **Please output these numbers modulo .**

#### Sample Input 1

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

#### Sample Output 1

`11 10 0 0`

#### Explanation

We are given that . , so let denote the bitwise XOR operation.

#### Sample Input 2

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

#### Sample Output 2

`13 8 0 0`

#### Explanation

We are given that . , so let denote the bitwise AND operation.

## Comments