'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    # n個の量子ビットの長さ"n"を"len(x)"で取得する。
    n = len(x)

    #n個の各量子ビットを制御ビットとして、1量子ビットに制御Xゲートを作用させる。
    i = 0
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister
import numpy as np

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(len(x)):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    length = len(x)
    for i in range(length):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)

    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x(i),y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
      qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i, n-1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
       qc.cx(x[i],y[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
       qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    # Apply CNOT gates from each x_i to y
    for i in range(n):
        qc.cx(x[i], y[0])  # CNOT from x[i] to y

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.h(i)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for idx in range(n):
        qc.cx(x[idx], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(y,x[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[0], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister
import math
def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
      qc.cx(y, x[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
      qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    qc.cx(y,x)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    qc.cx(x,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.ccx(0,1,2)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cnot(i,len(n))
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cnot(i,n)
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(0,2)
    qc.cx(1,2)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(n,2)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    qc.cx(y,x)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    qc.cx(y,x)
    qc.iden(x)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    qc.cx(x, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(0, 2)
    qc.cx(1, 2)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
      qc.cx(y, x[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
      qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x.index(i),y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cnot(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for xi in x:
        qc.cx(xi,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
      qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for xi in x:
        qc.cx(xi,y)
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for xi in x:
        qc.cx(xi, y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for _ in range(n):
        qc.cx(x[_],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
import math
from qiskit import QuantumCircuit

def solve(n: int) -> QuantumCircuit:
    qc = QuantumCircuit(n + 1)

    qc.cx(range(n), n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(y, x[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(i)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(i+1,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cnot(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x[range(n)], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    [qc.cx(x[i], y) for i in range(n)]

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for xi in x:
        qc.cx(xi, y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n + 1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i,x)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.mct(x[:], y[0], None, mode='noancilla')

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.mct(x, y[0], None, mode='noancilla')

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(len(x)):
        qc.cx(x[i])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(len(x)):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x))
        qc.cx(i,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x))
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x))
        qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in n:
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i,n-1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n+1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i, n-1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    n = len(x)
    for i in n:
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for xi in x:
        qc.cx(xi, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    nn = len(x)
    for i in range(nn):
        gc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        gc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    nn = len(x)
    for i in range(nn):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    n = len(x)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n - 1):
        qc.cx(i, n - 1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister
def solve(n: int) -> QuantumCircuit:
  x, y = QuantumRegister(n), QuantumRegister(1)
  qc = QuantumCircuit(x, y)
  for i in range(n):
    qc.cx(i, n)
  return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x[range(n)],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for _ in range(n):
        qc.cx(x[_],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n): qc.cx(x[i], n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister
import math

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in range(n):
        qc.cx(x[i],n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x[range(n)], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x[range(n)], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.mcx(x,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, i+1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n-1)
    qc.cx(y[i+1], x[i+1])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
      qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n): qc.cx(i, i + 1)
    for i in range(n - 1): qc.cx(i, i + 1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n): qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i],0)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i]+1,0)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i],n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
     for i in range(n):
        qc.cx(i,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
     for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i,i+1)
    qc.cx(n-1,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(len(x)):
        qc.cx(x[i],y)
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in n:
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i, i+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n+1):
        qc.cx(i, i+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i, i+1)

    qc.cx(n-1, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
      qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    circuit.h(0)
    circuit.cx(0, 1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])  # 各 x_i と y の間に CX ゲートを配置
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(i, n)
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in n:
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.h(x[i])
    for i in range(n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,11):
        qc.h(x[i])
    for i in range(1,11):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,11):
        qc.h(x[i])
    for i in range(1,11):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,11):
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n+1):
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n+1):
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.h(x[i])
    for i in range(1,n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,x)
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.h(x[i])
    for i in range(1,n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x'),
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.h(x[i])
    for i in range(1,n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x')
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.h(x[i])
    for i in range(1,n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x')
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.h(x[i])
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x')
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.cnot(qc.h(x[i]),y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x')
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        z= qc.h(x[i])
        qc.cnot(z,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x')
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(1,n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n,'x')
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n+1):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n)
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x = QuantumRegister(n)
    y = QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n-1):
        qc.cx(x[i],x[i+1])
    qc.cx(x[n-1],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n-1):
        qc.cx(x[i],x[i+1])
    qc.cx(x[n-1],y)
    for i in range(n-1):
        qc.cx(x[i],x[i+1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n-1):
        qc.cx(x[i],x[i+1])
    qc.cx(x[n-1],y)
    for i in range(n-1):
        qc.cx(x[n-i-2],x[n-i-1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n - 1):
        qc.cx(x[i], x[i + 1])

    qc.cx(x[n - 1], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n)
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    qc.mcx(x, y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    qc.mcx([range(n)], n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, i+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for xi in x:
        qc.cx(xi, y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1, n):
        qc.cx(i, 0)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(0, n - 1):
        qc.cx(i, n - 1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1, n + 1):
        qc.cx(i, 0)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.x(x[0:n], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x[0:n], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n=len(x)
    for i in range(n)
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n=len(x)
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in x:
        qc.cnot(i,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
	x, y = QuantumRegister(n), QuantumRegister(1)
	qc = QuantumCircuit(x, y)
	for i in range(n):
		qc.cx(x[i], y)
	return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n):
        qc.cx(0, i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1, n):
        qc.cx(i, 0)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1, n):
        qc.cx(0, i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(0, n - 1):
        qc.cx(n - 1, i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(0, n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(range(n),y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i],y[0])
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
      qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    circ = QuantumCircuit(x, y)
    # Write your code here:

    circ = QuantumCircuit(2)
    for i in range(n):
        circ.cx(i, n)
    return circ
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    circ = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        circ.cx(i, n)
    return circ
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(i, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1, n+1):
        qc.cx(0, i)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1, n+1):
        qc.cx(i, 0)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(0,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(n,0)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i, n-1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in n:
        qc.cx(i,y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(y,i)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Apply CX
    for i in range(n):
        qc.cx(control_qubit=x[i], target_qubit=y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit,QuantumRegister
#from qiskit.quantum_info import Statevector
import numpy as np

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)

    return qc

qc = solve(10)
print(qc)
#print(Statevector(qc)) #こことimportを消す
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i],y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for x_qubit in range(n):
        qc.x(x_qubit, n+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for x_qubit in range(n):
        qc.x(x_qubit, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for x_qubit in range(n):
        qc.cx(x_qubit, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n-1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i],n-1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(i,n-1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    qc.cx(x, y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.xc(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n):
        qc.cx(0,i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(i,n-1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n):
        qc.cx(i-1,i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(1,n+1):
        qc.cx(0,i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x,i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], yo)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in x:
        qc.cx(i, y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(0,1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n=len(x)
    if n=1:
        qc.cx(0,1)
    elif n=2:
        qc.cx(0,2)
        qc.cx(1,2)
    elif n=3:
        qc.cx(0,3)
        qc.cx(1,3)
        qc.cx(2,3)
    elif n=4:
        for i in range(4):
            qc.cx(i,4)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n=len(x)
    if n=1:
        qc.cx(0,1)
    elif n=2:
        qc.cx(0,2)
        qc.cx(1,2)
    elif n=3:
        qc.cx(0,3)
        qc.cx(1,3)
        qc.cx(2,3)
    elif n=4:
        qc.cx(0,4)
        qc.cx(1,4)
        qc.cx(2,4)
        qc.cx(3,4)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(n, i)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(0, n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(len(x)):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in len(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.mct([i for i in range(n)], n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n)
    qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in n:qc.cx(i,n + 1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
      qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(n,i)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(0,i+1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(y,x[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i,n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cnx(x,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.mcx(x,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.x(x)
    qc.mcx(x,y)
    qc.x(x)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.x(x)
    qc.mcx(x,y)
    qc.x(x)
    qc.x(y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(n,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i,y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(range(n-1), range(1,n))
    qc.cx(x[n-1], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(range(n-1), range(1,n))
    n = len(x)
    qc.cx(x[n-1], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    qc.cx(range(x[n-1]), range(x[1],x[n]))
    qc.cx(x[n-1], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n-1):
        qc.cx(x[i], x[i+1])
    qc.cx(x[n-1], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cnot(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.c(x)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.x(x[n-1])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.x(x[n])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.x(x[range(n)])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(0, x[i])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(y[0], x[i])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(x[i], x[i+1])
    qc.cx(x[n-1], y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    qc.cx(x[0], y[0])
    for i in range(1, n):
        qc.cx(x[i-1], x[i])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y[0])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx[x[i]]
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)-1):
        qc.cx(x[i+1],x[i])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(len(x)):
        qc.cx(x[i],y)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    n = len(x)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n+1)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    for i in range(n):
        qc.cx(i,n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n=len(x)
    for i in range(n):
        qc.cx(x[i],y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(n, i)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    n = len(x)
    for i in range(n-1):
        qc.(i, i+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    n = len(x)
    for i in range(n-1):
        qc.cx(i, i+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    n = len(x)
    qc.cx(n-1,0)
    for i in range(1, n-1):
        qc.cx(i, i+1)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:

    n = len(x)
    qc.cx(x[n-1],x[0])
    for i in range(1, n-):
        qc.cx(x[i], x[i+1])

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in range(n - 1):
        qc.cx(x[i], x[i + 1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in reversed(range(n - 1)):
        qc.cx(x[i], x[i + 1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in range(0, n, 2):
        qc.cx(x[i], x[i + 1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in range(0, n - 1):
        qc.cx(x[i], x[n - 1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in reversed(range(0, n - 1)):
        qc.cx(x[i], x[n - 1])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    n = len(x)
    for i in range(0, n):
        qc.cx(x[i], y[0])
    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    # B1と同様，cxでOK
    for i in range(n):
        qc.cx(i, n)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    for i in range(n):
        qc.cx(x[i],y)
    # Write your code here:

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n):
        qc.cx(x(i),y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(x(i),y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    for i in range(n-1):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)
    # Write your code here:
    n = len(x)
    for i in range(n):
        qc.cx(x[i],y)

    return qc
'''


'''python
from qiskit import QuantumCircuit, QuantumRegister

def solve(n: int) -> QuantumCircuit:
    x, y = QuantumRegister(n), QuantumRegister(1)
    qc = QuantumCircuit(x, y)

    for i in range(n):
        qc.cx(x[i], y)

    return qc
'''