Harryxun/stf_run huggingface dataset:
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = [2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 
     131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 
     67108864, 134217728, 268435456, 536870912]

t = []
bIdx = 0
for aa in a :
    while b[bIdx] <= aa:
        bIdx += 1   
    t.append(b[bIdx]-aa)

t.reverse()
a.sort(reverse=True)

sum = 0
i = 0

#print(t,a)

while True:
    
    first = i+1
    last = len(a)-1
    found = False

    while first<=last and not found:
        midpoint = (first + last)//2
        if a[midpoint] == t[i] :
            found = True
            sum += 1
            a = a[:midpoint]
            a.extend(a[midpoint:])
            #print(a)
        else:
            if t[i] > a[midpoint]:
                last = midpoint-1
            else:
                first = midpoint+1
            
    i = i + 1
    if i >= len(a)-1:
        break

print(sum)

### FIXED CODE ###

from bisect  import bisect_left

n = int(input())
a = list(map(int,input().split()))
a.sort()
#print(a)

sum = 0
for i in range (len(a)-1,-1,-1):

    b = 1
    while b <= a[i]:
        b = b<<1
    t = b - a[i]
    #print("2^",t)

    k = bisect_left(a,t)
    if a[k] == t and k < i:
        sum += 1
        a[k] -= 0.1
        a[i] += 0.1
print(sum)
import math, itertools

n = int(input())
a = list(map(int, input().split()))

gcdl = []
coml = list(itertools.combinations(a,2))

for x in range(len(coml)) :
    gcdl.append(math.gcd(coml[x][0], coml[x][1])) 

gcdl.sort()
min = gcdl[0]
for x in range(1, len(coml)) :
    if min != gcdl[x] :
        break

print(gcdl[x])

### FIXED CODE ###

import fractions

n = int(input())
a = list(map(int, input().split()))

gcdl = [0]
gcdr = [0]

for i in range(n-1) :
    gcdl.append(fractions.gcd(gcdl[i], a[i]))
    gcdr.append(fractions.gcd(gcdr[i], a[-(i+1)]))
gcdr = gcdr[::-1]

ans = []
for i in range(n) :
    ans.append(fractions.gcd(gcdl[i], gcdr[i]))

print(max(ans))
N = int(input())

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(b)

print(ans)


### FIXED CODE ###

N = int(input())

ans = float("inf")

A = 0
B = N
for i in range(N//2):

    A += 1
    B -= 1

    if A + B > N:
        break

    else:

        s_a = str(A)
        s_b = list(str(B))

        a = [int(i) for i in s_a]
        b = [int(i) for i in s_b]

        ans = min(ans, sum(a)+sum(b))

print(ans)
n = int(input())
list = []

for i in range(n+1): #nまでの数字について扱うよ
  for j in range(n): #それぞれの数字が割り切れなくなるまで割るよ
    if j % 2 != 1:
      j = j % 2
      cnt += 1
      continue
    else:
      list.append(j)
      
print(list.index(max(list))

### FIXED CODE ###

n = int(input())
list = [2**i for i in range(7)]

ans = 1

for k in list:
  if k <= n:
    ans = k
    if ans == 64:
      print(ans)
      break
    else:
      continue
  else:
    print(ans)
    break
import math
A,B = list(map(int,input().split()))
s =""
for i in range(int(math.log2(B))+1):
    if i == 0:
        a =0
        for j in range(A,4*(divmod(A,4)[0]+1)):
            #print(divmod(j,2)[1])
            a += divmod(j,2)[1]
        for j in range(4*(divmod(B,4)[0]),B+1):
            #print(divmod(j,2)[1])
            a += divmod(j,2)[1]
        s = str(divmod(a,2)[1])
    else:
        # int(divmod(16/16 ,2)[1])
        s = str(divmod((2**i-divmod(A,2**i)[1]) * int(divmod(A/2**i ,2)[1])+(divmod(B,2**i)[1]+1) * int(divmod(B/2**i ,2)[1]),2)[1]) + s
print(int(s,2))

### FIXED CODE ###

import math
A,B = list(map(int,input().split()))
s =""
if B == 0:
    print(0)
else:
    for i in range(int(math.log2(B))+1):
        if i == 0:
            a =0
            for j in range(A,4*(divmod(A,4)[0]+1)):
                #print(divmod(j,2)[1])
                a += divmod(j,2)[1]
            for j in range(4*(divmod(B,4)[0]),B+1):
                #print(divmod(j,2)[1])
                a += divmod(j,2)[1]
            s = str(divmod(a,2)[1])
        else:
            # int(divmod(16/16 ,2)[1])
            s = str(divmod((2**i-divmod(A,2**i)[1]) * int(divmod(A/2**i ,2)[1])+(divmod(B,2**i)[1]+1) * int(divmod(B/2**i ,2)[1]),2)[1]) + s
    print(int(s,2))
from collections import Counter

def cmb(n):
    if n < 2:
        return 0
    else:
        return n * (n-1) / 2

n = int(input())
ls = list(map(int,input().split()))

cs = Counter(a)
s = 0

for v in cs.values():
    s += cmb(v)

for a in ls:
    print(s - cmb(c[a]) + cmb(c[a] - 1))

### FIXED CODE ###

from collections import Counter
def cmb(n):
    if n < 2:
        return 0
    else:
        return (n * (n-1)) // 2

n = int(input())
ls = list(map(int,input().split()))

cs = Counter(ls)
s = 0

for v in cs.values():
    s += cmb(v)

for a in ls:
    print(s - cmb(cs[a]) + cmb(cs[a] - 1))
n = int(input())
x = set(n)
cnt = 1

while True:
    
    cnt += 1
    
    if n%2 == 0:
        n //=2
        
    else:
        n = n * 3 + 1

    if n in x:
        print(cnt)
        break
    else:
        x.add(n)

### FIXED CODE ###

n = int(input())
x = set()
cnt = 1
x.add(n)

while True:
    
    cnt += 1
    
    if n%2 == 0:
        n /=2
        
    else:
        n = n * 3 + 1

    if n in x:
        print(cnt)
        break
    else:
        x.add(n)
N,K = map(int,input().split())
S = input()

now=S[0]
smartS=now
for subs in S:
    if now != subs:
        smartS+=subs
        now=subs

smartS = list(smartS)

if len(smartS)>=2:
    now=smartS[1]
    for i in range(K):
        smartS[2*i]=now
    
    count=0
    
    for i,subs in enumerate(smartS):
        if subs=="L":
            if i==0 :
                count+=1
            else:
                if smartS[i-1] != "L":
                    count+=1
        if subs=="R":
            if i==len(smartS)-1:
                count += 1
            else:
                if smartS[i+1] != "R":
                    count+=1
    print(N-count+1)
else:
    print(N-1)

### FIXED CODE ###

N,K = map(int,input().split())
S = input()

count=0
for i in range(N-1):
    if S[i]==S[i+1]:
        count+=1
print(min(N-1, count+2*K))
N = int(input())

value = []
for part in input().split():
  value.append(int(part))

print(max(value) - min(value))

### FIXED CODE ###

n = int(input())

if (n % 2) == 0:
  print(n)
else:
  print(n * 2)
# -*- coding: utf-8 -*-

import sys
import os
import math

for s in sys.stdin:

    n = int(s)
    if n == 0:
        break
    P = []

    for i in range(n):
        x, y = map(float, input().split(','))
        P.append(complex(x, y))

    def get_intersections(p0, p1):
        """
        :type p0: complex
        :type p1: complex
        :return:
        """
        dist = abs(p0 - p1)

        if dist > 2:
            return []
        elif dist == 2:
            return [(p0 + p1) / 2]
        else:
            m = (p0 + p1) / 2
            v = m - p0
            w = complex(v.imag, -v.real)
            n = w / abs(w)
            d = abs(v)
            l = math.sqrt(1 - d ** 2)

            inter0 = m + l * n
            inter1 = m - l * n
            return [inter0, inter1]


    intersections = []
    for i in range(n):
        for j in range(i+1, n):
            intersections += get_intersections(P[i], P[j])

    counts = []

    # each intersection, it is in how many circles?
    for intersection in intersections:
        cnt = 0
        for p in P:
            if abs(intersection - p) <= 1:
                cnt += 1
        counts.append(cnt)

    print(max(counts))

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
import os
import math

for s in sys.stdin:

    n = int(s)
    if n == 0:
        break
    P = []

    for i in range(n):
        x, y = map(float, input().split(','))
        P.append(complex(x, y))

    def get_intersections(p0, p1):
        """
        :type p0: complex
        :type p1: complex
        :return:
        """
        dist = abs(p0 - p1)

        if dist > 2:
            return []
        elif dist == 2:
            return [(p0 + p1) / 2]
        else:
            m = (p0 + p1) / 2
            v = m - p0
            w = complex(v.imag, -v.real)
            n = w / abs(w)
            d = abs(v)
            l = math.sqrt(1 - d ** 2)

            inter0 = m + l * n
            inter1 = m - l * n
            return [inter0, inter1]


    intersections = []
    for i in range(n):
        for j in range(i+1, n):
            intersections += get_intersections(P[i], P[j])

    counts = []

    # each intersection, it is in how many circles?
    for intersection in intersections:
        cnt = 0
        for p in P:
            if abs(intersection - p) <= 1.01:
                cnt += 1
        counts.append(cnt)

    if counts:
        print(max(counts))
    else:
        print(1)
N=int(input())
A=[int(i) for i in input().split()]
T=[[A[0],A[1]]]
B=[0]
k=0
for i in range(2,N):
    if len(T[k])<=1:
        T[k].append(A[i])
        continue
    if not(T[k][0]>=A[i-2]>=A[i-1]>=A[i] or T[k][0]<=A[i-2]<=A[i-1]<=A[i]):
        k+=1
        T.append([])
        T[k].append(A[i])
    else:
        T[k].append(A[i])
print(len(T))


### FIXED CODE ###

N=int(input())
A=[int(i) for i in input().split()]
if N==1:
    print(1)
    exit()
T=[[A[0],A[1]]]
k=0
for i in range(2,N):
    if len(T[k])<=1:
        T[k].append(A[i])
        continue
    if not((T[k][0]>=A[i-2]>=A[i-1]>=A[i]) or (T[k][0]<=A[i-2]<=A[i-1]<=A[i])):
        k+=1
        T.append([A[i]])
    else:
        T[k].append(A[i])
print(len(T))
A,B=map(int, input().split())
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(A,2)+comb(B,2))

### FIXED CODE ###

A,B=map(int, input().split())
import math
def comb(n, r):
  if n < 2:
    return 0
  else:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(A,2)+comb(B,2))
n = int(input())
p = [int(s) - 1 for s in input().split()]

a = [40_000 * (i + 1) for i in range(n)]
b = list(reversed(a))
for i in range(n):
    a[p[i]] += i

print(' '.join(map(str, a)))
print(' '.join(map(str, b)))

### FIXED CODE ###

n = int(input())
p = [int(s) - 1 for s in input().split()]

a = [40000 * (i + 1) for i in range(n)]
b = list(reversed(a))
for i in range(n):
    a[p[i]] += i

print(' '.join(map(str, a)))
print(' '.join(map(str, b)))
import itertools
prod = functools.partial(functools.reduce, operator.mul)
n,k=map(int,input().split())
price=list(map(int,input().split()))

n_list=[]
for com in itertools.combinations(price,k):
    s=sum(com)
    n_list.append(s)
print(min(n_list))

### FIXED CODE ###

N, K = map(int, input().split())
p = list(map(int, input().split()))
print(sum(sorted(p)[:K]))
import math

N, M = list(map(int, input().split()))
S = input()
T = input()

L = N * M // math.gcd(N, M)

d = dict()

for i in range(N):
    index = 1 + (L // N) * i
    d[index] = S[i]

for j in range(M):
    index = (1 + (L // M) * j)
    if index in d:
        if d[index] != T[j]:
            print(-1)
            exit()
print(L)


### FIXED CODE ###

import math

N, M = list(map(int, input().split()))
S = input()
T = input()
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

L = N * M // gcd(N, M)

d = dict()

for i in range(N):
    index = 1 + (L // N) * i
    d[index] = S[i]

for j in range(M):
    index = (1 + (L // M) * j)
    if index in d:
        if d[index] != T[j]:
            print(-1)
            exit()
print(L)
n = int(input())
word = input()
ans = ""
if len(word) <= n:
	print(word)
else:
	for i in range(n):
    	ans += word[i]
	ans +=("...")
	print(ans)

### FIXED CODE ###

k = int(input())
s = input()
if len(s)<=k:
	print(s)
else:
    print(s[:k]+"...")
# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
 T, X = map(int, input().split())
 print(T / X)

### FIXED CODE ###

# -*- coding: <encoding name> -*-
'''
T, X = int(input())
print(T / X)
'''
T, X = map(int, input().split())
print(T / X)
N, A, B = map(int, input().split())

if B< A:
	print(0)
elif B = A:
	print(1)
elif B-A+1 > N:
	print(0)
else:
	print((N-2)*B-(N-2)*A+1)

### FIXED CODE ###

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

if A == B :
	print(1)
	exit()

print(max(B*(N-1)+A-(A*(N-1)+B)+1,0))
import math
N=int(input())
A=list(map(int,input().split()))
ans1 = A[0]
ans2 = 0
f = True
for i in range(1, N):
    ans1 = math.gcd(ans1, A[i])
    for j in range(i+1, N):
        ans2 = math.gcd(A[i-1],A[j-1])
        if (ans2 > 1):
            f = False
            break
    if f==False and ans !=1:
        break


if f:
    print('pairwise coprime')
else:
    if ans1==1:
        print('setwise coprime')
    else:
        print('not coprime')


### FIXED CODE ###

from math import gcd

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

# setwise validation
tmp = 0
for a in A:
    tmp = gcd(tmp, a)
isSetwise = (tmp == 1)

# pairwise validation
M = 10 ** 6
sieve = [0] * (M + 1)
for a in A:
    sieve[a] += 1

cnt = 0
isPairwise = True
for i in range(2, M + 1):
    isPairwise &= (sum(sieve[j] for j in range(i, M + 1, i)) <= 1)

# check
if isPairwise:
    ans = 'pairwise coprime'
elif isSetwise:
    ans = 'setwise coprime'
else:
    ans = 'not coprime'
print(ans)
N = int(input())


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


P = prime_factorize(N)

ans = len(str(N))

for i in range(2 ** (len(P) - 1)):
    a = 1
    b = 1
    for j in range(len(P)):
        if (i >> j) & 1 == 1:
            a *= P[j]
        else:
            b *= P[j]

    ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)


### FIXED CODE ###

import sys
N = int(input())

if N == 1:
    print(1)
    sys.exit(0)


def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


P = prime_factorize(N)

ans = len(str(N))

for i in range(2 ** (len(P) - 1)):
    a = 1
    b = 1
    for j in range(len(P)):
        if (i >> j) & 1 == 1:
            a *= P[j]
        else:
            b *= P[j]

    ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)
h,a=map(int,input().split())
if h%a==0:
  print((int(h/a))
else:
  print((int(h/a)+1))

### FIXED CODE ###

h,a=map(int,input().split())
if h%a==0:
  print((int(h/a)))
else:
  print((int(h/a)+1))
# B - Balance
N = int(input())
W = list(map(int, input().split()))
sum1 = 0

i = 0
while sum1 < sum(W)/2:
    sum1 += W[i]
    i += 1
    sum2 = sum1 + W[i+1]

ans = min(abs(sum(W)-sum1-sum1),abs(sum(W)-sum2-sum2))

print(ans)

### FIXED CODE ###

# B - Balance
N = int(input())
W = list(map(int, input().split()))
sum_l = 0
sum_r = sum(W)
abs_W =[]
for i in range(N):
    sum_l += W[i]
    sum_r -= W[i]
    abs_W.append(abs(sum_r - sum_l))

print(min(abs_W))
_input = input()
number = _input.split()
N = number[0]
R = number[1]
if N<10:
  R += 100 * (10-N)
print(R)
            

### FIXED CODE ###

_input = input()
number = _input.split()
N = int(number[0])
R = int(number[1])
if N<10:
  R += 100 * (10-N)
print(R)
from sys import exit
import copy
import numpy as np
#from collections import deque


h, w, k = map(int, input().split())
c = [list(input()) for _ in range(h)]
# print(c)


def count(arr):
    cnt = 0
    for l in arr:
        for i in l:
            if i == "#":
                cnt += 1

    return cnt


ans = 0
for i in range(2 ** w):
    tmp = copy.deepcopy(c)
    for j in range(w):
        if ((i >> j) & 1):
            for s in range(h):
                tmp[s][j] = '$'

    for t in range(2 ** h):
        tmp2 = copy.deepcopy(tmp)
        for j in range(h):
            if ((t >> j) & 1):
                for s in range(w):
                    tmp2[j][s] = '$'
        # for l in tmp2:
        #     print(l)
        if count(tmp2) == k:
            ans += 1

print(ans)


### FIXED CODE ###

from sys import exit
import copy
import numpy as np
#from collections import deque


h, w, k = map(int, input().split())
c = [list(input()) for _ in range(h)]
# print(c)


def count(arr):
    cnt = 0
    for l in arr:
        for i in l:
            if i == "#":
                cnt += 1

    return cnt


ans = 0
for i in range(2 ** w):
    tmp = copy.deepcopy(c)
    for j in range(w):
        if ((i >> j) & 1):
            for s in range(h):
                tmp[s][j] = '$'

    for t in range(2 ** h):
        tmp2 = copy.deepcopy(tmp)
        for j in range(h):
            if ((t >> j) & 1):
                for s in range(w):
                    tmp2[j][s] = '$'
        # for l in tmp2:
        #     print(l)
        if count(tmp2) == k:
            ans += 1

print(ans)
n,t=map(int,input().split())
dp=[[[0,0] for i in range(t)] for j in range(n+1)]
food=[list(map(int,input().split())) for i in range(n)]
foodmax=[0]*n
food.sort(key=lambda x:x[1],reverse=True)
food.sort(key=lambda x:x[0])
foodmax[-1]=food[-1][1]
for i in range(n-1)[::-1]:
  foodmax[i]=max(foodmax[i+1],food[i][1])
for i in range(n):
  for j in range(t):
    if j<food[i][0]:
      dp[i+1][j]=dp[i][j]
    else:
      dp[i+1][j][0]=max(dp[i][j][0],dp[i][j-food[i][0]][0]+food[i][1])
      if dp[i][j][0]>=dp[i][j-food[i][0]][0]+food[i][1]:
        dp[i+1][j][1]=dp[i][j][1]
      else:
        dp[i+1][j][1]=i
ans=0
for i in range(n+1):
  if ans<dp[i][t-1][0]+foodmax[dp[i][t-1][1]+1]:
    ans=dp[i][t-1][0]+foodmax[dp[i][t-1][1]+1]
print(ans)

### FIXED CODE ###

import sys
input=sys.stdin.readline
n,t=map(int,input().split())
dp=[[0 for i in range(t)] for j in range(n+1)]
food=[list(map(int,input().split())) for i in range(n)]
foodmax=[0]*n
food.sort(key=lambda x:x[1],reverse=True)
food.sort(key=lambda x:x[0])
foodmax[-1]=food[-1][1]
for i in range(n-1)[::-1]:
  foodmax[i]=max(foodmax[i+1],food[i][1])
foodmax+=[0]
for i in range(n):
  for j in range(t):
    if j<food[i][0]:
      dp[i+1][j]=dp[i][j]
    else:
      dp[i+1][j]=max(dp[i][j],dp[i][j-food[i][0]]+food[i][1])
      
ans=0
for i in range(n):
  if ans<dp[i+1][t-1]+foodmax[i+1]:
    ans=dp[i+1][t-1]+foodmax[i+1]
print(ans)
n,h=map(int,input().split())
a=[list(map(int,input().split()))for i in range(n)]
b=max(a,key=lambda x:x[0])[0]
c=sorted(t for(s,t)in a if t>b)[::-1]
d=0
for i in c:
    h-=i
    d+=1
    if h<0:
        print(d)
        exit()
if h>0:
    d+=max(h-1,-1)//b+1
print(d)

### FIXED CODE ###

a,b,c=input().split("/");print("2018/"+b+"/"+c)
N=int(input())
li = [0] * 1000000000000

for n in range(N):
  li[int(input())] += 1

ans = 0

for i in li:
  if i % 2 == 1:
    ans += 1

print(ans)

### FIXED CODE ###

N=int(input())
sets = set()

for n in range(N):
  a = int(input())
  
  if a in sets:
    sets.remove(a)
  else:
    sets.add(a)

print(len(sets))
from itertools import permutations
"""
どの順番に出てくるかをすべて（6通り）ためす
そこからa,b,cのずれ幅の組み合わせ（2000**2）をためす
判定をO(1)ですると
2000*2*6 = 2.4*10**7
x: aとbのずれ幅
y: aとcのずれ幅
"""
def main():
    ss = sorted([input() for _ in range(3)])
    n = len(max(ss, key=len))
    d = [[[None]*n for _ in range(3)] for _ in range(3)]
    ans = n*3
    for s in permutations(ss):
        for i in range(3):
            li = len(s[i])
            for j in range(i, 3):
                lj = len(s[j])
                for k in range(li):
                    ok = True
                    for ni in range(k, len(li):
                        nj = ni - k
                        if nj >= lj:
                            break
                        if s[i][ni] == "?" or s[j][nj] == "?":
                            continue
                        if s[i][ni] != s[j][nj]:
                            ok = False
                    d[i][j][k] = ok
        f = lambda i, j, k: True if k>=len(s[i]) else d[i][j][k]
        for x in range(n):
            for y in range(n):
                if not f(0, 1, x):
                    continue
                if not f(1, 2, y):
                    continue
                if not f(0, 2, x+y):
                    continue
                now = max([0, len(s[0]), x+len(s[1]), x+y+len(s[2])])
                ans = min(ans, now)
    print(ans)
                
if __name__ == "__main__":
    main()

### FIXED CODE ###

from itertools import permutations
"""
どの順番に出てくるかをすべて（6通り）ためす
そこからa,b,cのずれ幅の組み合わせ（2000**2）をためす
判定をO(1)ですると
2000*2*6 = 2.4*10**7
x: aとbのずれ幅
y: aとcのずれ幅
"""
def main():
    ss = sorted([input() for _ in range(3)])
    n = len(max(ss, key=len))
    d = [[[None]*n for _ in range(3)] for _ in range(3)]
    ans = n*3
    for s in permutations(ss):
        for i in range(3):
            li = len(s[i])
            for j in range(i, 3):
                lj = len(s[j])
                for k in range(li):
                    ok = True
                    for ni in range(k, li):
                        nj = ni - k
                        if nj >= lj:
                            break
                        if s[i][ni] == "?" or s[j][nj] == "?":
                            continue
                        if s[i][ni] != s[j][nj]:
                            ok = False
                    d[i][j][k] = ok
        f = lambda i, j, k: True if k>=len(s[i]) else d[i][j][k]
        for x in range(n):
            for y in range(n):
                if not f(0, 1, x):
                    continue
                if not f(1, 2, y):
                    continue
                if not f(0, 2, x+y):
                    continue
                now = max([0, len(s[0]), x+len(s[1]), x+y+len(s[2])])
                ans = min(ans, now)
    print(ans)
                
if __name__ == "__main__":
    main()
mx, h = [], []
for ch in input():
    print(h)
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    print(max([len(l) for l in mx]))


### FIXED CODE ###

mx, h = [], []
for ch in str(input()):
    if ch in ['A', 'C', 'G', 'T']:
        h += ch
    else:
        mx += [h]
        h = []
else:
    mx += [h]
    print(max([len(l) for l in mx]))
p=lambda x:print(x,end=' ')
m=n=input();p(n+':')
n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)


### FIXED CODE ###

p=lambda x:print(x,end=' ')
n=input();p(n+':')
m=n=int(n)
while n%2==0 and n>3:p(2);n//=2
d=3
while d*d<m and n>d:
 if n%d>0:d+=2
 else:p(d);n//=d
print(n)
n = int(input())
A = list(map(int, input().split()))
b = []
for i in reversed(range(n)):
    if A[i]:
        num = i + 1
        b.append(num)
        tmp = 1
        while tmp * tmp <= num:
            if num % tmp == 0:
                A[num] ^= 1
                if tmp != num // tmp:
                    A[num//tmp]
            tmp += 1
print(len(b))
print(*b)


### FIXED CODE ###

def div(n):
    lower_div, upper_div = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_div.append(i)
            if i != n // i:
                upper_div.append(n // i)
        i += 1
    return lower_div + upper_div[::-1]

def main():
    n = int(input())
    A = list(map(int, input().split()))
    L = [0] * n
    b = []
    for i in reversed(range(n)):
        if A[i] != L[i] % 2:
            b.append(i+1)
            d = div(i + 1)
            for j in d:
                L[j-1] += 1
    print(len(b))
    print(*b)

main()
from math import gcd
from functools import reduce


def lcm_base(a, b):
    return (a * b) // gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())
T = []

for _ in range(n):
    T.append(int(input()))

print(lcm(*T))


### FIXED CODE ###

from functools import reduce


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm_base(a, b):
    return a * b // gcd(a, b)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


n = int(input())
T = []

for _ in range(n):
    T.append(int(input()))

print(lcm(*T))