Harryxun/stf_run huggingface dataset:
from sys import exit
from math import sqrt
n = int(input())
a = [int(input()) for _ in range(n+1)]
x = 0
while True:
	m = abs(sum([a[i]*pow(x, n-i) for i in range(n+1)]))
	if m != 0:
		break
	x += 1
if x > 0:
	m *= x
#print(m)
ans, ps = [], []
for i in range(2, int(sqrt(m))+1):
	if m%i == 0:
		ps.append(i)
		while m%i == 0:
			m //= i
if m != 1:
	ps.append(m)
if n == 0:
	if ps:
		print(*ps, sep="\n")
	exit()
a = a[::-1]
for p in ps:
	if p-1 > n:
		ng = False
		for i in range(1, n+1):
			if a[i]%p != 0:
				ng = True
				break
		if not ng:
			print(p)
	else:
		mods = [0 for _ in range(p-1)]
		for i in range(1, n+1):
			mods[i%(p-1)] += a[i]
			mods[i%(p-1)] %= p
		if mods[0] == 0:
			ng = False
			for i in range(1, p-1):
				if mods[i] != 0:
					ng = True
					break
			if not ng:
				print(p)

### FIXED CODE ###

import sys
from fractions import gcd
n = int(input())
a = [int(input()) for _ in range(n+1)]
x = 0
while True:
	m = abs(sum([a[i]*pow(x, n-i) for i in range(n+1)]))
	if m != 0:
		break
	x += 1
ps = []

i = 2
while i**2 <= m and i <= n+1:
#for i in range(2, int(sqrt(m))+1):
	if m%i == 0:
		ps.append(i)
		while m%i == 0:
			m //= i
	i += 1
if m != 1 and n != 0:
	ps.append(m)
#print(ps)
g = a[0]
for i in range(1, n+1):
	g = gcd(g, abs(a[i]))

#print(g)
ans = []

i = 2
while i**2 <= g:
#for i in range(2, int(sqrt(m))+1):
	if g%i == 0:
		if i >= n+1:
			ans.append(i)
		while g%i == 0:
			g //= i
	i += 1
if g != 1 and g >= n+1:
	ans.append(g)

a = a[::-1]
for p in ps:
	if p-1 > n:
		ng = False
		for i in range(1, n+1):
			if a[i]%p != 0:
				ng = True
				break
		if not ng:
			ans.append(p)
	else:
		mods = [0 for _ in range(p-1)]
		for i in range(1, n+1):
			mods[i%(p-1)] += a[i]
			mods[i%(p-1)] %= p
		if mods[0] == 0:
			ng = False
			for i in range(1, p-1):
				if mods[i] != 0:
					ng = True
					break
			if not ng:
				ans.append(p)
ans = sorted(list(set(ans)))
if ans:
	print(*ans, sep="\n")
n = int(input())

if N == 0:
    print(0)
    exit()

s = ""
while n != 0:
    s += str(n%2)
    n = (n-n%2)//(-2)

print(s[::-1])

### FIXED CODE ###

n = int(input())

if n == 0:
    print(0)
    exit()

s = ""
while n != 0:
    s += str(n%2)
    n = (n-n%2)//(-2)

print(s[::-1])
import numpy as np
A, B = list(map(int,input().split()))
ans = np.lcm(A, B)
print(ans)

### FIXED CODE ###

import numpy as np
def gcd(m, n):
    x = max(m, n)
    y = min(m, n)
    if x%y == 0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y
            y = z
        else:
            return z
        
def lcm(m, n):
    return int(m*n/gcd(m,n))

A, B = list(map(int,input().split()))
ans = lcm(A, B)
print(ans)
a, b = map(int, input().split())
n = 3
unit = [
    '####',
    '#.#.',
    '#.#.',
    '....'
]
row = [
    '.' + unit[0]*n + '#',
    '.' + unit[1]*n + '#',
    '.' + unit[2]*n + '#',
    '.' + unit[3]*n + '#'
]
grid = []
for i in range(n):
    grid.append(list(row[0]))
    grid.append(list(row[1]))
    grid.append(list(row[2]))
    grid.append(list(row[3]))
"""
# 黒
for i in range(n):
    grid[0][4*(i+1)] = 'x'
for i in range(n):
    grid[4*i][4] = 'y'
# 白
for i in range(n):
    grid[2][4*(i+1)-2] = 'w'
for i in range(n):
    grid[4*(i+1)-2][2] = 'v'
"""
# 白
for i in range(a//n+1):
    for j in range(n):
        if i * n + j < a-1:
            #print('#',4*(j+1)-2,4*(i+1)-2)
            grid[4*(i+1)-2][4*(j+1)-2] = '#'

# 黒
for i in range(b//n+1):
    for j in range(n):
        if i * n + j < b-1:
            #print('.',4*j,4*(i+1))
            grid[4*i][4*(j+1)] = '.'

print(len(grid), len(grid[0]))
for i in grid:
    print(''.join(i))



### FIXED CODE ###

a, b = map(int, input().split())
n = 24
unit = [
    '####',
    '#.#.',
    '#.#.',
    '....'
]
row = [
    '.' + unit[0]*n + '#',
    '.' + unit[1]*n + '#',
    '.' + unit[2]*n + '#',
    '.' + unit[3]*n + '#'
]
grid = []
for i in range(n):
    grid.append(list(row[0]))
    grid.append(list(row[1]))
    grid.append(list(row[2]))
    grid.append(list(row[3]))
"""
# 黒
for i in range(n):
    grid[0][4*(i+1)] = 'x'
for i in range(n):
    grid[4*i][4] = 'y'
# 白
for i in range(n):
    grid[2][4*(i+1)-2] = 'w'
for i in range(n):
    grid[4*(i+1)-2][2] = 'v'
"""
# 白
for i in range(a//n+1):
    for j in range(n):
        if i * n + j < a-1:
            #print('#',4*(j+1)-2,4*(i+1)-2)
            grid[4*(i+1)-2][4*(j+1)-2] = '#'

# 黒
for i in range(b//n+1):
    for j in range(n):
        if i * n + j < b-1:
            #print('.',4*j,4*(i+1))
            grid[4*i][4*(j+1)] = '.'

print(len(grid), len(grid[0]))
for i in grid:
    print(''.join(i))
N = int(input())
S_P = []
for i in range(N):
    S , P = input().split()
    S_P.append([ S , int(P) , i])
S_P.sort( key = lambda x : x[0] )
state = S_P[0][0]
S_P_sort = []
temp = []
for S , P , i in S_P:
    if S != state:
        temp.sort( key = lambda x : x[1])
        S_P_sort.extend(temp)
        S_P_sort.append([S , P, i])
        state = S
        temp = []
    else:
        temp.append([S , P, i])
for j in range(N):
    print(S_P_sort[j][2]+1)

### FIXED CODE ###

N = int(input())
S_P = []
for i in range(N):
    S , P = input().split()
    S_P.append([ S , int(P) , i])
S_P.sort( key = lambda x : x[0] )
state = S_P[0][0]
S_P_sort = []
temp = []
for S , P , i in S_P:
    if S != state:
        temp.sort( key = lambda x : x[1] , reverse = True)
        S_P_sort.extend(temp)
        state = S
        temp = []
        temp.append([S , P, i])
    else:
        temp.append([S , P, i])
temp.sort( key = lambda x : x[1] , reverse = True)
S_P_sort.extend(temp)
for j in range(N):
    print(S_P_sort[j][2]+1)
a,b=int(input().split())
print(max(a+b,a-b,a*b))

### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int(b)

print(max(a+b,a-b,a*b))
s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == 2[3]:
    print("Bad")
else:
    print("Good")

### FIXED CODE ###

s = input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
    print("Bad")
else:
    print("Good")
from heapq import heappush,heappop,heapify

n,k = map(int,input().split())

# とりあえずネタは無視しておいしさが大きい寿司からk個を選び(hq)、満足ポイントを計算する。
# それに選ばれなかった寿司から、選ばれた寿司のネタにはないネタで、かつ、
# そのネタの中でおいしさが最大のものを選んでおく(rhq)。
# hqのうち、hqのネタ種類数が減らなように選んだおいしさが最小のものと、
# rhqのうちおいしさが最大のものを入れ替えて、満足ポイントを計算する。
# (こうすると、おいしさの合計は減るがネタの種類数は増える。)
# これを繰り返して、最大の満足ポイントを出力する。

tf = [False for _ in range(n)]
s = []
for i in range(n):
  t,d = map(int,input().split())
  t -= 1
  if tf[t]:
    s.append((0,d))
  else:
    s.append((1,d))
    tf[t] = True

s.sort(key = lambda x:-x[1])
hq = s[:k]
hq.sort()
heapify(hq)

rhq = []
for t,d in s[k:]:
  if t == 1:
    rhq.append(-d)
heapify(rhq)

ans = 0
tsum = 0
dsum = 0
for t,d in hq:
  tsum += t
  dsum += d
ans = dsum+tsum**2

while(True):
  t,d = heappop(hq)
  if t == 1:
    break
  if len(rhq) == 0:
    break
  newd = heappop(rhq)
  dsum += -newd-d
  tsum += 1
  ans = max(dsum+tsum**2,ans)
print(ans)


### FIXED CODE ###

from heapq import heappush,heappop,heapify

n,k = map(int,input().split())

# とりあえずネタは無視しておいしさが大きい寿司からk個を選び(hq)、満足ポイントを計算する。
# それに選ばれなかった寿司から、選ばれた寿司のネタにはないネタで、かつ、
# そのネタの中でおいしさが最大のものを選んでおく(rhq)。
# hqのうち、hqのネタ種類数が減らなように選んだおいしさが最小のものと、
# rhqのうちおいしさが最大のものを入れ替えて、満足ポイントを計算する。
# (こうすると、おいしさの合計は減るがネタの種類数は増える。)
# これを繰り返して、最大の満足ポイントを出力する。

td = []
for i in range(n):
  td.append(tuple(map(int,input().split())))
td.sort(key = lambda x:(x[0],-x[1]))

tf = [False for _ in range(n)]
s = []
for t,d in td:
  t -= 1
  if tf[t]:
    s.append((0,d)) #そのネタの中でおいしさ最大でないもの
  else:
    s.append((1,d)) #そのネタの中でおいしさ最大のもの
    tf[t] = True

s.sort(key = lambda x:-x[1])
#print(s)
hq = s[:k]
heapify(hq)

rhq = []
for t,d in s[k:]:
  if t == 1:
    rhq.append(-d)
heapify(rhq)

ans = 0
tsum = 0
dsum = 0
for t,d in hq:
  tsum += t
  dsum += d
ans = dsum+tsum**2

while(True):
  t,d = heappop(hq)
  if t == 1:
    break
  if len(rhq) == 0:
    break
  newd = heappop(rhq)
  dsum += -newd-d
  tsum += 1
  ans = max(dsum+tsum**2,ans)
print(ans)
a,b=map(int,input().split())
if a + b >= 10:
    print("error")
else:
    print(a + b)

### FIXED CODE ###

a,b,c=map(int,input().split())
if c >= a and c <= b:
    print("Yes")
else:
    print("No")
S=input()
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
    max=count
  else:
    count=0
print(count)

### FIXED CODE ###

S=list(input())
max=0
count=0
for i in range(len(S)):
  if S[i] == "A" or S[i] == "T" or S[i] == "C" or S[i] == "G":
    count+=1
    if max<count:
      max=count
  else:
    count=0
print(max)
import sys
from collections import defaultdict

n, m = tuple(map(int, sys.stdin.buffer.readline().split()))
L = tuple(tuple(map(int, sys.stdin.buffer.readline().split())) for _ in range(m))

# print(n, m)
# print(L)

X = [n + 1] * (n + 1)
X[1] = 0
Y = [0] * (n + 1)
d = defaultdict(set)
for a, b in L:
    d[a].add(b)
    d[b].add(a)
print(d)
def search(i):
    for b in d[i]:
        point = X[i] + 1
        # print(f' {X[i]}')
        if point < X[b]:
            print(i, b, X)
            X[b] = point
            Y[b] = i
            search(b)
    
search(1)
s = X[0]
try:
    X.index(X[0], 1)
except ValueError:
    print('Yes')
    # for v in X[2:]:
    #     print(v)
    for v in Y[2:]:
        print(v)
else:
    print('No')

### FIXED CODE ###

import sys
from collections import defaultdict, deque

n, m = tuple(map(int, sys.stdin.buffer.readline().split()))
L = tuple(tuple(map(int, sys.stdin.buffer.readline().split())) for _ in range(m))

# print(n, m)
# print(L)

X = [n + 1] * (n + 1)
Y = [0] * (n + 1)
d = defaultdict(set)
for a, b in L:
    d[a].add(b)
    d[b].add(a)
# print(d)

X0 = X[0]
X[1] = 0
qu = deque([1])
while qu:
  i = qu.popleft()
  cost = X[i]
  for b in d[i]:
    if X[b] == X0:
      X[b] = cost + 1
      qu.append(b)

# print(X)
s = X[0]
try:
    X.index(X[0], 1)
except ValueError:
    print('Yes')
    # for v in X[2:]:
    #     print(v)
    for i in range(2, n + 1):
      c = X[i]
      for v in d[i]:
        # print(i, c, v, X[v], c - 1== X[v])
        if c - 1 == X[v]:
          Y[i] = v
          break
    for v in Y[2:]:
        print(v)
else:
    print('No')
from functools import lru_cache
N = int(input())
def main():
    a = list(map(int, input().split()))
    d = {0:0, 1:0, 2:0, 3:0}
    for i in a:
        d[i] += 1
    print(dfs(d[1],d[2],d[3]))
@lru_cache(maxsize=None)
def dfs(a, b, c):
    if a + b + c == 0:
        return 0
    t1 = t2 = t3 = 0
    total = a + b + c
    if a > 0:
        t1 = (a/total) * dfs(a-1, b, c)
    if b > 0:
        t2 = (b/total) * dfs(a+1, b-1, c)
    if c > 0:
        t3 = (c/total) * dfs(a, b+1, c-1)
    return N/total + t1 + t2 + t3
main()



### FIXED CODE ###

N = int(input())
def main():
    a = list(map(int, input().split()))
    d = {0:0, 1:0, 2:0, 3:0}
    for i in a:
        d[i] += 1
    d1 = d[1]
    d123 = d[1] + d[2] + d[3]
    d23 = d[2] + d[3]
    d3 = d[3]
    d2 = d[2]
    l = [[[0] * (d123 + 1) for _ in range(d23 + 1)] for _ in range(d3 + 1)]
    for i in range(d3 + 1):
        for j in range(d23 + 1):
            for k in range(d123 + 1):
                if i + j + k == 0:
                    continue
                if i + j + k > d123:
                    continue
                if i + j > d23:
                    continue
                total = i + j + k
                a = b = c = 0
                if k > 0:
                    a = k * l[i][j][k-1]
                if j > 0:
                    b = j * l[i][j-1][k + 1]
                if i > 0:
                    c = i * l[i-1][j + 1][k]
                l[i][j][k] = (a + b + c + N)/total
    print(l[d3][d2][d1])
main()
a,b = map(int,input().split())
c,d = map(int,input().split())
e = input()

f = a + (b*e)
g = c + (d*e)

if f >= g:
	print("YES")
else:
	print("NO")

### FIXED CODE ###

a = str(input())
print(a[0:3])
import fractions
A, B = map(int, input().split())
C = fractions.gcd(A, B)
ans = 1
primes = [2]

if C % 2 == 0:
  ans += 1
  while C % 2 == 0:
    C //= 2

p = 3
while C > 1:
  for prime in primes:
    if p % prime == 0:
      continue
  primes.append(p)
  if C % P == 0:
    ans += 1
  while C % p == 0:
    C //= p
  p += 2
print(ans)

### FIXED CODE ###

import fractions
import math

A, B = map(int, input().split())
C = fractions.gcd(A, B)
pfac = []

def get_primes(n):
  primes = [2]
  for i in range(3, (n+1), 2):
    for p in primes:
      if i % p == 0:
        break
      if i < p ** 2:
        primes.append(i)
        break
    else:
      primes.append(i)
  return primes

def get_primes2(n):
    if not isinstance(n, int):
        raise TypeError('n is int type.')
    if n == 1:
        return []
    prime = []
    limit = math.sqrt(n)
    data = [i + 1 for i in range(1, n)]
    while True:
        p = data[0]
        if limit <= p:
            return prime + data
        prime.append(p)
        data = [e for e in data if e % p != 0]

for q in get_primes2(min(C, 10**6)):
  if q ** 2 > C:
    break
  if C % q == 0:
    pfac.append(q)
    while C % q == 0:
      C //= q
if C != 1:
  pfac.append(C)


print(len(pfac) + 1)
for i in x,input():

        if x == 0:
        break

print("Case " +i+ ": " + x)

### FIXED CODE ###

print(*sorted(input().split(" ")))
import numpy as np

n = int(input())

t = [int(input()) for _ in range(n)]

print(np.lcm.reduce(np.array(t)))


### FIXED CODE ###

from fractions import gcd

n = int(input())

t = [int(input()) for _ in range(n)]

ans = t[0]
for i in range(1, n):
    ans = ans * t[i] // gcd(ans, t[i])
print(ans)
from math import factorial
n,k = map(int, input().split())
mod = 10**9+7
def comb(n,r):
    return factorial(n) // (factorial(r) * factorial(n - r))
# a = comb(n, r)
for i in range(1,k+1):
    if n -k + 1 >= i :
        a = comb(n-k+1,i)
        b = comb(k-1,i-1)
        print((a*b)%mod)
    else:
        print(0)

### FIXED CODE ###

s = str(input())
s1 = set(s)
s2 = list(s)
cnt = 0
if len(s1) != 2:
    print("No")
else:
    for i in range(1,len(s2)):
        if s[0] == s[i]:
            cnt += 1
    if cnt == 1:
        print("Yes")
    else:
        print("No")
N, M = map(int,input().split())
PNs = [list(map(int,input().split())) for _ in range(N)]
#price_and_number_of_drinks

PNs.sort(key=lambda x: x[0])

ans = 0
sum_drinks = 0 #sum of drinks which Takahashi has bought
for i in range(N):
    nos = PNs[i][1] #number of drinks at i_th shop
    nob = min(M-sum_drinks, nos) #number of drinks which he can buy at the shop
    ans += nob*PNs[i][0] #add money he spent at the shop
    sum_drinks += nob
    if s>=M: break

print(ans)


### FIXED CODE ###

N, M = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N)]
AB = sorted(AB, key=lambda x: x[0])

ans = 0
s = 0
for i in range(N):
    t = AB[i][1]
    c = min(M-s, t)
    ans += c*AB[i][0]
    s += c
    if s>=M: break

print(ans)
from collections import deque

n,m = map(int,input().split())
G = [list() for _ in range(n+1)]
R = [list() for _ in range(n+1)]
for _ in range(m):
  u,v = map(int,input().split())
  G[u].append(v)
  R[v].append(u)

def find_cycle(visited = [1]):
  v = visited[-1]
  for x in G[v]:
    if x in visited:
      return visited[visited.index(x):]
    res = find_cycle(visited + [x])
    if len(res) > 0:
      return res
  return list()

def trash(i):
  dis = [n]*(n+1)
  dis[i] = 0
  q = deque([i])
  while q:
    v = q.popleft()
    for x in G[v]:
      if x == i: continue
      if dis[x] < dis[v] + 1:
        # print(dis,i,v,x)
        return v
      dis[x] = dis[v] + 1
      q.append(x)
  return False

for i in range(1,n+1):
  cyc = find_cycle([i])
  if cyc: break
  else: print(-1); exit(0)

while True:
  # print(cyc)
  for i in range(1,n+1):
    if i not in cyc:
      for x in G[i]:
        R[x].remove(i)
      G[i] = []
      for x in R[i]:
        G[x].remove(i)
      R[i] = []
     
  for i in cyc:
    if len(G[i]) > 1:
      st = i
      v = trash(st)
      for x in G[v]:
        R[x].remove(v)
      G[v] = []
      for x in R[v]:
        G[x].remove(v)
      R[v] = []
      # print(G)
      # print(R)
      cyc = set(find_cycle([st]))
      break
  else: break
if not cyc: print(-1); exit(0)     
print(len(cyc))
print(*cyc, sep='\n')

### FIXED CODE ###

from collections import deque

n,m = map(int,input().split())
g = [list() for _ in range(n+1)]
en = [0]*(n+1)
for _ in range(m):
  u,v = map(int,input().split())
  g[u].append(v)
  en[v] += 1
q = deque(i for i in range(1,n+1) if en[i] == 0)
done = list()
while q:
  v = q.popleft()
  for x in g[v]:
    en[x] -= 1
    if not en[x]:
      q.append(x)
  done.append(v)
print(-1 if len(done) == n else 0)
#include <bits/stdc++.h>
using namespace std;
 
 
long long LIMIT = 1000000000000000000;
 
int main(){
  int n;
  cin >> n;
  vector<long long> vec(n);
  
  for (int i = 0; i < n; i++) {
    cin >> vec.at(i);
  }
  
  if ( std::find(vec.begin(), vec.end(), 0) != vec.end() ) {
    cout << 0 << endl;
    return 0;
  }
  
  long long products = 1;
  for (int i = 0; i < n; i++) {
    products *= vec.at(i);
	if(products > LIMIT) {
      cout << -1 << endl;
      return 0;
    }
  }
  
  cout << products << endl;
  
  return 0;

### FIXED CODE ###


N = int(input())
A = list(map(int, input().split()))

def main():
  if(0 in A):
    print(0)
    return

  products = 1
  for a in A:
    products *= a
    if(products > 1000000000000000000):
      print(-1)
      return
  print(products)
  return

main()
r, c = [int(i) for i in input().split(" ")]
s_row = [0 for x in range(c + 1)]

for i in range(r):
    row = [int(n) for n in input().split(" ")]
   row =  row.append(sum(row))
    print(" ".join( [ str(s) for s in row ] ) )
    s_row = [ x + y for x, y in zip(s_row, row)]
print(" ".join( [str(s1) for s1 in s_row] ))

### FIXED CODE ###

r, c = [int(i) for i in input().split(" ")]
s_row = [0 for x in range(c + 1)]

for i in range(r):
    row = [int(n) for n in input().split(" ")]
    row.append(sum(row))
    print(" ".join( [ str(s) for s in row ] ) )
    s_row = [ x + y for x, y in zip(s_row, row)]
print(" ".join( [str(s1) for s1 in s_row] ))
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n,x = MAP()
    L = [1]*n
    P = [1]*n

    for  i in range(1,n):
        L[i] = 2* L[i-1] +3
        P[i] = 2* P[i-1] + 1

    def func(N, X):
        if N==0:
            return 0 if X <= 0 else 1

        elif X<= L[N-1] + 1:
            return func(N-1, X-1)

        else:
            return P[N-1] + 1 + func(N-1, X-L[N-1] -2)

    print(func(n,x))

if  __name__=='__main__':
    main()

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    n=INT()
    p = [INT() for _ in range(n)]

    p_max = max(p)

    print(sum(p) - int((p_max/2)))

if  __name__=='__main__':
    main()
n, x = map(int, raw_input().split())

if x == n:
	print 'Yes'
	for i in range(1, 2 * n):
		print i
else:
	print 'No'

### FIXED CODE ###

n = input()
s = raw_input()
t = raw_input()



z = n + n
for i in range(0, n + 1):
	if s[-i:] == t[:i]:
		z = min(z, n + n - i)

print z
from fractions import gcd
n=int(input())
a=list(map(int,input().split()))
left=right=[0]*n
for i in range(1,n):
    left[i]=gcd(left[i-1],a[i-1])
for i in range(n-1)[::-1]:
    right[i]=gcd(right[i+1],a[i+1])
ans=[gcd(x[i],y[i]) for i in range(n)]
print(max(ans))

### FIXED CODE ###

from fractions import gcd
n=int(input())
a=list(map(int,input().split()))+[0]
left=[0]*(n+1)
right=[0]*(n+1)
for i in range(1,n):
    left[i]=gcd(left[i-1],a[i-1])
for i in range(n,0,-1):
    right[i-1]=gcd(right[i],a[i])
ans=[gcd(right[i],left[i]) for i in range(n)]
print(max(ans))
import math, sys
sys.setrecursionlimit(1000000)
mod = 10**9+7
N, K = map(int, input().split())
edge = [[] for _ in range(N)]
flag = [False]*N
flag[0] = True
for i in range(N-1):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
P = [1]*(K+1)
T = [1]*(K+1)
for i in range(1, K+1):
    P[i] = (P[i-1]*(K-i))%mod
    T[i] = T[i-1]*(K-i-1)%mod
def count(x):
    flag[x]=True
    res = 1
    l = len(edge[x])-1
        
    for e in edge[x]:
        if flag[e]:
            continue
        res*=count(e)
    if x==0:
        return res*K*P[l+1]%mod
    return res*T[l]%mod
print(count(0))


### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
mod = 10**9+7
N, K = map(int, input().split())
edge = [[] for _ in range(N)]
flag = [False]*N
flag[0] = True
for i in range(N-1):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
P = [1]*(K+10)
T = [1]*(K+10)
for i in range(1, K+10):
    P[i] = (P[i-1]*(K-i))%mod
    T[i] = T[i-1]*(K-i-1)%mod
def count(x):
    flag[x]=True
    res = 1
    l = len(edge[x])-1
        
    for e in edge[x]:
        if flag[e]:
            continue
        res*=count(e)
    if x==0:
        if l+1> K-1:
            return 0
        return res*K*P[l+1]%mod
    if l>K-2:
        return 0
    return res*T[l]%mod
print(count(0))
while 1:
    t, d, l = map(int, raw_input().split())
    rest = ans = 0
    for i in xrange(t):
        x = int(raw_input())
        if l <= x:
            rest = d
        elif rest:
            rest -= 1
        if rest and i < t-1:
            ans += 1
    print ans

### FIXED CODE ###

while 1:
    t, d, l = map(int, raw_input().split())
    if t == d == l == 0:
        break
    rest = ans = 0
    for i in xrange(t):
        x = int(raw_input())
        if l <= x:
            rest = d
        elif rest:
            rest -= 1
        if rest and i < t-1:
            ans += 1
    print ans
n=int(input())
s=input()
if n%2==1:
  print("No")
  exit()
t=s[:n/2]
if t+t==s:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n=int(input())
s=input()
if n%2==1:
    print("No")
    exit()
t=s[:int(n/2)]
if t+t==s:
    print("Yes")
else:
    print("No")
n,m = map(int,input().split())
A = set([int(input()) for _ in range(m)])
mod = 1000000007
dp = [0]*(n+1)
dp[0],dp[1] = 1,1
for i in range(2,n+1):
    dp[i] = (dp[i-1] + dp[i-2])%mod
    if i in a:dp[i] = 0
print(dp[n])

### FIXED CODE ###

n,m=map(int,input().split())
a=set([int(input()) for i in range(m)])
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:dp[i]=0
print(dp[n])
A, B = map(int, input().split())

if A==B:
  ans = 'EQUAL'
elif A<B:
  ans = 'LESS'
else:
  ans = 'GREATER'

print(ans)

### FIXED CODE ###

A, B = int(input()), int(input())

if A==B:
  ans = 'EQUAL'
elif A<B:
  ans = 'LESS'
else:
  ans = 'GREATER'

print(ans)
n,m=[int(x) for x in input().split()]
a = [int(x) for x in input().split()]
total = sum(a)
cnt = n
for i in range(0, n):
  if a[i] < int(total / (4 * m)):
    cnt -= 1
  if cnt < m:
    print("No")
    return
print("Yes")

### FIXED CODE ###

import sys,math
n,m=[int(x) for x in input().split()]
a = [int(x) for x in input().split()]
total = sum(a)
cnt = n
for i in range(0, n):
  if a[i] < math.ceil(total / (4 * m)):
    cnt -= 1
  if cnt < m:
    print("No")
    sys.exit()
print("Yes")