Harryxun/stf_run huggingface dataset:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors



n=int(input())


l=list(make_divisors(n))

l.sort()

for i,ll in enumerate(l):
  if i!=len(l)-1 and ll*l[i+1]==n:
    ans=ll+l[i+1]-2
if n==1:
  print(0)
else:
  print(ans)


### FIXED CODE ###

n=int(input())
import math
ans=10**12
i=0
while i*i<=n:
  i+=1
  if n%i!=0:
    continue
  j=n/i
  ans=min(ans, i+j-2)
if ans ==10**12:
  print(n-1)
else:
  print(int(ans))
a = input()
b = input()
X = b - a 
s = (X*(X+1))/2 - b
print(s)

### FIXED CODE ###

N = int(input())
if N > 999:
    print('ABD')
elif N <= 999:
    print('ABC')
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))


def solve():
    n, k = rl()
    A = rl()
    # leaps = [A]
    # leap_size = 2
    # while leap_size <= k:
        # new_leap = []
        # for i in range(n):
    curr = 1
    seen = {1:0}

    for i in range(1, k + 1):
        curr = A[curr - 1]
        if i == k:
            print (curr)
            return
        elif curr in seen:
            break
        seen[curr] = i

    cycle_len = i - seen[curr]
    # print (cycle_len)

    while 1:
        if i % cycle_len == k % cycle_len:
            print (curr)
            return
        i += 1
        curr = A[curr - 1]






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()


### FIXED CODE ###

from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

def rl():
    return list(map(int, input().split()))

def egcd(a, b):
    if a == 0:
        return (b, 0, 1)
    else:
        g, y, x = egcd(b % a, a)
        return (g, x - (b // a) * y, y)

def modinv(a, m):
    g, x, y = egcd(a, m)
    if g != 1:
        raise Exception('modular inverse does not exist')
    else:
        return x % m

def solve():
    n, m, k = rl()
    mod = 998244353
    ans = 0
    C = 1
    for d in range(k + 1):
        # print (d)
        ans += m * pow(m - 1, n - 1 - d, mod) * C
        ans %= mod
        C = (C * (n - 1 - d) * modinv(d + 1, mod)) % mod
    print (ans)





mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True  and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,p = inm()
acc = [0]*(n+1)
a = [0]*(n+1)
ss = ins()
s = ss[::-1]
if p in [2,5]:
    x = 0
    for i in range(n):
        if int(s[i])%p==0:
            x += n-i
    print(x)
    exit()

q = 1
for i in range(n):
    x = int(s[i])
    r = q*x
    acc[i+1] = (acc[i]+r)%p
    ddprint(f"i {i} x {x} r {r} q {q} ai {acc[i+1]}")
    q = (q*10)%p
ddprint(acc)
h = [0]*p
for i in range(n+1):
    h[acc[i]] += 1
ddprint(h)
sm = 0
for i in range(p):
    x = h[i]
    sm = (sm+x*(x-1)//2)
print(sm)


### FIXED CODE ###

printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True  and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n,p = inm()
acc = [0]*(n+1)
a = [0]*(n+1)
ss = ins()
s = ss[::-1]
if p in [2,5]:
    x = 0
    for i in range(n):
        if int(s[i])%p==0:
            x += n-i
    print(x)
    exit()

q = 1
for i in range(n):
    x = int(s[i])
    r = q*x
    acc[i+1] = (acc[i]+r)%p
    #ddprint(f"i {i} x {x} r {r} q {q} ai {acc[i+1]}")
    q = (q*10)%p
ddprint(acc)
h = [0]*p
for i in range(n+1):
    h[acc[i]] += 1
ddprint(h)
sm = 0
for i in range(p):
    x = h[i]
    sm = (sm+x*(x-1)//2)
print(sm)
import sys
input = sys.stdin.readline

from bisect import bisect_left, bisect_right

INF = 10**18 + 100
N,A,B = map(int,input().split())
S = [-INF] + [int(x) for x in sys.stdin.read().split()]

MOD = 10**9 + 7

dpX = [0] * (N+1) # 最後にYを選んだとして、直前に選んだXがどこにあるか
dpY = [0] * (N+1) # 最後にXを選んだとして、直前に選んだYがどこにあるか
dpX[0] = 1
dpY[0] = 1
dpX_cum = [1] * (N+1) + [0]
dpY_cum = [1] * (N+1) + [0]
dpX_left = 0
dpY_left = 0
for n,x in enumerate(S[2:],2):
    iA = bisect_right(S,x-A)
    iB = bisect_right(S,x-B)
    # ....XY
    xy = dpY_cum[iB-1] - dpY_cum[dpY_left-1]
    # ....YX
    yx = dpX_cum[iA-1] - dpX_cum[dpX_left-1]
    # ....XX が不可能なら捨てる。明示的に捨てるのではなく、生きている番号だけ持つ
    if iA != n:
        dpY_left = n-1
    if iB != n:
        dpX_left = n-1
    dpX[n-1] = xy
    dpX_cum[n-1] = (dpX_cum[n-2] + xy) % MOD
    dpX_cum[n] = dpX_cum[n-1]
    dpY[n-1] = yx
    dpY_cum[n-1] = (dpY_cum[n-2] + yx) % MOD
    dpY_cum[n] = dpY_cum[n-1]

answer = dpX_cum[n] - dpX_cum[dpX_left-1]
answer += dpY_cum[n] - dpY_cum[dpY_left-1]
answer %= MOD
print(answer)

dpX



### FIXED CODE ###

import sys
input = sys.stdin.readline

from bisect import bisect_left, bisect_right

INF = 10**18 + 100
N,A,B = map(int,input().split())
S = [-INF] + [int(x) for x in sys.stdin.read().split()]

MOD = 10**9 + 7

dpX = [0] * (N+1) # 最後にYを選んだとして、直前に選んだXがどこにあるか
dpY = [0] * (N+1) # 最後にXを選んだとして、直前に選んだYがどこにあるか
dpX[0] = 1
dpY[0] = 1
dpX_cum = [1] * (N+1) + [0] # -1
dpY_cum = [1] * (N+1) + [0] # -1
dpX_left = 0
dpY_left = 0
for n,x in enumerate(S[2:],2):
    iA = bisect_right(S,x-A)
    iB = bisect_right(S,x-B)
    # ....XY
    xy = dpY_cum[iB-1] - dpY_cum[dpY_left-1] if iB >= dpY_left else 0
    # ....YX
    yx = dpX_cum[iA-1] - dpX_cum[dpX_left-1] if iA >= dpX_left else 0
    # ....XX が不可能なら捨てる。明示的に捨てるのではなく、生きている番号だけ持つ
    if iA != n:
        dpY_left = n-1
    if iB != n:
        dpX_left = n-1
    dpX[n-1] = xy
    dpX_cum[n-1] = (dpX_cum[n-2] + xy) % MOD
    dpX_cum[n] = dpX_cum[n-1]
    dpY[n-1] = yx
    dpY_cum[n-1] = (dpY_cum[n-2] + yx) % MOD
    dpY_cum[n] = dpY_cum[n-1]

answer = dpX_cum[N-1] - dpX_cum[dpX_left-1]
answer += dpY_cum[N-1] - dpY_cum[dpY_left-1]
answer %= MOD
print(answer)
import itertools

N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

N_list = [i for i in range(1,N)]
conbination = list(itertools.permutations(N_list, N))

a = conbination.index(tuple(P))
b = conbination.index(tuple(Q))

print(abs(a-b))


### FIXED CODE ###

import itertools

N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

N_list = [i for i in range(1,N+1)]
conbination = list(itertools.permutations(N_list, N))

a = conbination.index(tuple(P))
b = conbination.index(tuple(Q))

print(abs(a-b))
length = input()
input_str = input()

if len(input_str) > length:
    print(input_str + '...')
else:
    input_str

### FIXED CODE ###

k = int(input())
s = input()

if len(s) > k:
    print(s[0:k] + '...')
else:
    print(s)
#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = []
b = []
xb = 10**9+1
for i in range(n):
    aa,bb = inm()
    a.append(aa)
    b.append(bb)
    if aa>bb and xb>bb:
        xb = bb
        xi = i
if n==2 and a[0]==1:
    3/0
print(0 if xb>10**9 else sum(a)-b[xi])


### FIXED CODE ###

#from collections import deque,defaultdict
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7
#R = 998244353

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = []
b = []
xb = 10**9+1
for i in range(n):
    aa,bb = inm()
    a.append(aa)
    b.append(bb)
    if aa>bb and xb>bb:
        xb = bb
        xi = i
if n==-2 and a[0]==1:
    3/0
print(0 if xb>10**9 else sum(a)-b[xi])
from math import ceil
n,a,b=map(int,input().split())
h=[int(input()) for i in range(n)]
def enough(x):
  cnt=0
  for i in range(n):
    if h[i]-x*b<=0:
      continue:
    cnt+=ceil((h[i]-x*b)/(a-b))
  if cnt<=x:
    return True
  else:
    return False
l=0
r=10**9
while r-l>0:
  mid=(r+l)//2
  if enough(mid):
    r=mid
  else:
    l=mid+1
print(r)

### FIXED CODE ###

from math import ceil
n,a,b=map(int,input().split())
h=[int(input()) for i in range(n)]
def enough(x):
  cnt=0
  for i in range(n):
    if h[i]-x*b<=0:
      continue
    cnt+=ceil((h[i]-x*b)/(a-b))
  if cnt<=x:
    return True
  else:
    return False
l=0
r=10**9
while r-l>0:
  mid=(r+l)//2
  if enough(mid):
    r=mid
  else:
    l=mid+1
print(r)
D=int(input())
c=input().split()
c=[int(a) for a in c]
S=[]
for _ in range(D):
    s=input().split()
    s=[int(a) for a in s]
    S.append(s)
T=[]
for _ in range(D):
    t=int(input())-1
    T.append(t)

for d in range(D):
    if d%27==0:
        print(20)
    else:
        print(d%27)
        

### FIXED CODE ###

D=int(input())
c=input().split()
c=[int(a) for a in c]
S=[]
for _ in range(D):
    s=input().split()
    s=[int(a) for a in s]
    S.append(s)

for d in range(D):
    if d%27==0:
        print(20)
    else:
        print(d%27)
import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()
    # input()
    A,B,N=map(int, input().split())

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    max=0
    max_x=0
    reg=[0]*B+1

    for x in range(N+1):
        rem = x%B
        if reg[rem]==1:
            break
        else:
            reg[rem]=1
        if rem > max:
            max=rem
            max_x=x

    # min,_=math.modf(max_x/B)

    print(int(A*max_x/B)-A*int(max_x/B))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os

def file_input():
    f = open('../Beginner_Contest_165/input.txt', 'r')
    sys.stdin = f

def main():
   # file_input()
    # input()
    A,B,N=map(int, input().split())

    max=0
    # for x in range(N+1):
    #     # ans=int(A*x/B)-A*int(x/B)
    #     min,_=math.modf(x/B)
    #     # ans=int(A*min)
    #     # print(min)
    #     if x==0:
    #         max=min
    #     elif min > max:
    #         max=min
    #     else:
    #         break

    # max=0
    # max_x=0
    # first=0
    #
    # for x in range(N+1):
    #     rem = x%B
    #     if x == 0:
    #         first=rem
    #     elif rem == first:
    #         break
    #     if rem > max:
    #         max=rem
    #         max_x=x

    if N<B:
        max_x=N
    else:
        max_x=B-1

    # min,_=math.modf(max_x/B)

    print(int(A*max_x/B)-A*int(max_x/B))

if __name__ == '__main__':
    main()
n,m = map(int,input().split())
a_array = [int(x) for x in input().split()]
d = dict()
for a in a_array:
    d.setdefault(a, 0)
    d[a] += 1
for _ in range(m):
    b,c = map(int, input().split())
    d.setdefault(c, 0)
    d[c] += b
key = sort(d.keys(),reverse=True)
ans = 0
index = 0
while n > 0:
    num = key[index]
    if d[num] >= n:
        ans += num * n
        break
    ans += num * d[num]
    n -= d[num]
    index += 1

print(ans)

### FIXED CODE ###

import bisect

n, m = map(int, input().split())
a_array = sorted([int(x) for x in input().split()])
bc_array = sorted([[int(x) for x in input().split()] for x in range(m)], key=lambda x: x[1], reverse=True)

# 何枚入れ替えられるか
candidate_replace_cnt = n
for b, c in bc_array:
    if a_array[0] >= c or candidate_replace_cnt < 0:
        break
    for i in range(b):
        a_array.append(c)
    candidate_replace_cnt -= b
a_array.sort(reverse=True)
print(sum(a_array[:n]))
N = input()
ans = 0
i = 1

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        ans += 1
        
print(ans)

### FIXED CODE ###

N = int(input())
ans = 0
i = 1

for i in range(N):
    s = str(i+1)
    if len(s) == 1 or len(s) == 3 or len(s) == 5:
        ans += 1

print(ans)
A, B, C = sorted(map(int, input().split()))

def calculate(P, Q, R):
    num = 0
    if abs(P - Q) % 2 == 0:
        num += abs(P - Q) // 2
    else:
        num += 1 + (abs(P - Q) + 1) // 2
        P += 1
        R += 1

    if  P - R >= 0:
        if abs(P - R) % 2 == 0:
            num += abs(P - R) // 2
        else:
            num += 1 + (abs(P - R) + 1) // 2

    else:
        num += abs(P - R)

    return num

ans = min(calculate(C, B, A), calculate(C, A, B), calculate(B, A, C))

print(ans)

### FIXED CODE ###

S = input()
if len(S) == 3 and "a" in S and "b" in S and "c" in S:
    print("Yes")
else:
    print("No")
import copy
n,k,c = map(int,input().split())
dp = [0]*(n+c+2)
s = input()
idx = []
for i in range(n):
    if s[i]=='o':
        idx.append(i+1)
for i in idx:
    dp[i] += 1
    dp[i+c+1] -= 1
for i in range(1,len(dp)):
    dp[i] = dp[i]+dp[i-1]       

for i in idx:
    tmp = copy.deepcopy(dp)
    for j in range(i, i+c+1):
        tmp[j] -= 1
    cnt = 0
    flg = False
    for j in range(len(tmp[1:-1])):
        if tmp[1+j]!=0 and flg==False:
            flg = True
            cnt += 1
        if tmp[1+j]!=0 and flg:
            continue
        if tmp[1+j]==0:
            flg = False
    if cnt<k:
        print(i)

### FIXED CODE ###

k = int(input())
ans = [str(i) for i in range(1, 10)]
tmp = [str(i) for i in range(1, 10)]
cnt = 10
if k<=9:
    print(k)
else:
    while cnt<=k:
        ap = []
        for t in tmp:
            if t[-1]=='0':
                ap.append(t+'0')
                ap.append(t+'1')
            elif t[-1]=='9':
                ap.append(t+'8')
                ap.append(t+'9')
            else:
                l = int(t[-1])
                ap.append(t+str(l-1))
                ap.append(t+str(l))
                ap.append(t+str(l+1))
        cnt += len(ap)
        tmp = ap
    print(tmp[k-cnt])
import math
n = int(input())
S = list(map(int,input().split()))

def merge(A, left, mid, right):
    global count
    n1 = mid - left
    n2 = right - mid
    L = []
    for i in range(n1+1):
        L.append(i)
    R = []
    for i in range(n2+1):
        R.append(i)
    for i in range(n1):
        L[i] = A[left + i]
    for i in range(n2):
        R[i] = A[mid + i]
    L[n1] = math.inf
    R[n2] = math.inf
    i = 0
    j = 0
    sum = 0
    for k in range(left,right):
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
    count += right - left

def mergeSort(A, left, right):
    if left + 1 < right:
        mid = int((left + right) / 2)
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

count = 0
mergeSort(S,0,len(S))
print(*S)
print(count)

### FIXED CODE ###

n = int(input())
S = list(map(int,input().split()))
M = 10**9 + 1
def merge(A, left, mid, right):
    global count
    n1 = mid - left
    n2 = right - mid
    L = A[left:left + n1]
    R = A[mid:mid + n2]
    L.append(M)
    R.append(M)
    i = 0
    j = 0
    for k in range(left,right):
        count += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1


def mergeSort(A, left, right):
    if left + 1 < right:
        mid = (left + right) // 2
        mergeSort(A, left, mid)
        mergeSort(A, mid, right)
        merge(A, left, mid, right)

count = 0
mergeSort(S,0,len(S))
print(*S)
print(count)
S = input()
S0 = S[0]
S1 = len(S) - 2
S2 = S[-1]
print(S0+S1+S2)

### FIXED CODE ###

S = input()
S0 = S[0]
S1 = str(len(S) - 2)
S2 = S[-1]
print(S0+S1+S2)
N=int(input())
li=list(map(int,input().split()))
p=0
for i in range(N):
  p+=1
  print(li.count(p))
  

### FIXED CODE ###

R = int(input())
print(R*2*3.14)
from sys import setrecursionlimit
setrecursionlimit(10**9)


def main():
    from sys import stdin
    import pandas as pd
    readline = stdin.readline

    n = int(readline())
    S = pd.Series([readline()[:-1] for _ in [0]*n])

    S = S.value_counts().copy()
    cond = S[0]
    answers = list(S[S == cond].sort_index().index)

    for ans in answers:
        print(ans)


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    from sys import stdin
    from collections import Counter
    readline = stdin.readline

    n = int(readline())
    S = [readline()[:-1] for _ in [0]*n]

    s = Counter(S)
    most = s.most_common(1)[0][1]

    answers = [i[0] for i in s.items() if i[1] == most]
    answers = sorted(answers)

    for ans in answers:
        print(ans)


if __name__ == '__main__':
    main()
S = input()
MOD =2019
count = [0]*MOD
r = 0
t = 1
for i in reversed(S):
    r += int(i) * t
    r %= MOD
    t *= 10
    t %= MOD
    d[r] += 1

d[0] += 1
print(sum(i*(i-1)/2 for i in count))

### FIXED CODE ###

S = input()
MOD =2019
count = [0]*MOD
r = 0
t = 1
for i in reversed(S):
    r += int(i) * t
    r %= MOD
    t *= 10
    t %= MOD
    count[r] += 1

count[0] += 1
print(int(sum(i*(i-1)/2 for i in count)))
x = int(input())

if　x>29:
  print("yes")
else:
  print("no")


### FIXED CODE ###

N = int(input())
 
if N < 30:
    print("No")
else:
    print("Yes")
A, B, C = map(int, input().split())
b = str(B)
print(A+C if b == "+" else A-C)

### FIXED CODE ###

A, B, C = map(str, input().split())
print(int(A)+int(C) if B=="+" else int(A)-int(C))
n = int(input())
l = [list(map(int,input().split())) for _ in range(n-1)]
q,k = map(int,input().split())
k -= 1
#kからの距離
tree = [[] for _ in range(n)]
for a,b,c in l:
    a -= 1
    b -= 1
    tree[a].append([b,c])
    tree[b].append([a,c])

bit = [0 for _ in range(n)]
depth = [0 for _ in range(n)]
def dfs(v,d=0):
    bit[v] = 1
    depth[v] = d
    for j,k in tree[v]:
        if bit[j]==0:
            dfs(j,d+k)
dfs(k)

for _ in range(q):
    x,y = map(int,input().split())
    x-= 1
    y-= 1
    print(depth[x] + depth[y])

### FIXED CODE ###

import sys

sys.setrecursionlimit(200000)

n = int(input())
l = [list(map(int,input().split())) for _ in range(n-1)]
q,k = map(int,input().split())
k -= 1
#kからの距離
tree = [[] for _ in range(n)]
for a,b,c in l:
    a -= 1
    b -= 1
    tree[a].append([b,c])
    tree[b].append([a,c])

bit = [0 for _ in range(n)]
depth = [0 for _ in range(n)]
def dfs(v,d=0):
    bit[v] = 1
    depth[v] = d
    for j,k in tree[v]:
        if bit[j]==0:
            dfs(j,d+k)
dfs(k)

for _ in range(q):
    x,y = map(int,input().split())
    x-= 1
    y-= 1
    print(depth[x] + depth[y])
def inpl(): return [int(i) for i in input().split()]

N, M = inpl()
inf = float('inf')
path = [0 for _ in range(N)]
score = [-inf]*N
score[0] = 0
ans = 0
for i in range(M):
    a, b, c = inpl()
    path[i] = (a-1,b-1,c)

for i in range(N-1):
    update = False
    for na, nb, nc in path:
        if score[na] != -inf and score[nb] < score[na] + nc:
            score[nb] = score[na]+nc
            update = True
    if not update:
        break
ans = score[N-1]
for na, nb, nc in path:
        if score[na] != -inf and score[nb] < score[na] + nc:
            score[nb] = score[na]+nc
print(ans if ans == score[N-1] else 'inf')

### FIXED CODE ###

def inpl(): return [int(i) for i in input().split()]

N, M = inpl()
inf = float('inf')
path = [0 for _ in range(M)]
score = [-inf]*N
score[0] = 0
ans = 0
for i in range(M):
    a, b, c = inpl()
    path[i] = (a-1,b-1,c)

for i in range(N-1):
    update = False
    for na, nb, nc in path:
        if score[na] != -inf and score[nb] < score[na] + nc:
            score[nb] = score[na]+nc
            update = True
    if not update:
        break
ans = score[N-1]
for na, nb, nc in path:
        if score[na] != -inf and score[nb] < score[na] + nc:
            score[nb] = score[na]+nc
print(ans if ans == score[N-1] else 'inf')
x = int(input())
print(2*x*3.14)

### FIXED CODE ###

x,y = map(int, input().split())
a,b = map(int, input().split())
print((x-a)*(y-b))
N = int(input())
Ts = list(map(int, input().split()))
M = int(input())
Ds = []
O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")

### FIXED CODE ###

O = str(input())
E = str(input())

ma = max(len(O), len(E))

for i in range(ma):
    if (i < len(O)):
        print(O[i], end="")
    if (i < len(E)):
        print(E[i], end="")
N=input()#整数Nを受け取る
#Nのi文字目とi＋1文字目が同じであればカウントを増やす。
j_count=0
for i in range(0,3):
    if N[i]==N[i+1]:
        j_count+=1

#カウントが2以上かつ2文字目＝3文字目であればYes、でなければNoを返す。
if j_count>=2　and N[1]==N[2]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N=input()
j_count=0
for i in range(0,3):
    if N[i]==N[i+1]:
        j_count+=1
if j_count>=2 and N[1]==N[2]:
    print("Yes")
else:
    print("No")
while True:                                                                 
      (a, op, b) = [int(i) if i.isdigit() else i for i in input().split()]
  
      if op == '?':
          break
      elif op =='+':
          print(a+b)
      elif op == '-':
          print(a-b)
      elif op == '*':
          print(a*b)
      elif op == '/':
          print(a//b)
      else :
          break
                                      

### FIXED CODE ###

while True:
    (a, op, b) = [int(i) if i.isdigit() else i for i in input().split()]

    if op == '?':
        break
    elif op =='+':
        print(a+b)
    elif op == '-':
        print(a-b)
    elif op == '*':
        print(a*b)
    elif op == '/':
        print(a//b)
    else :
        break
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def all_pattern(n):
    ans=0
    for ds in make_divisors(n):
        k=n
        if ds==1:
            continue
        while k%ds==0:
            k//=ds
        ans+=(k%ds==1 or k-k%ds==1)

n=int(input())
print(all_pattern(n)+all_pattern(n-1))

### FIXED CODE ###

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
n=int(input())
x=make_divisors(n)
l=len(x)
ans=0
for i in range(l):
    k=n
    if x[i]==1:
        continue
    while k%x[i]==0:
        k//=x[i]
    if k%x[i]==1 or k-k%x[i]==1:
        #print(x[i])
        ans+=1
#print(ans)
y=make_divisors(n-1)
#print(y)
l2=len(y)
ans2=0
for i in range(l2):
    k=n
    if y[i]==1:
        continue
    while k%y[i]==0:
        k//=y[i]
    if k%y[i]==1 or k-k%y[i]==1:
        #print(y[i])
        ans2+=1
print(ans+ans2)
from collections import OrderedDict
n, m = map(int,input().split())
a = OrderedDict()

for i in range(m):
  p, s = input().split()
  if a.get(p) == None:
    a[p] = list()
  a[p].append(s)

for k, v in a.items():
  sum += a.find('AC')

print(sum)

### FIXED CODE ###

from collections import OrderedDict
n, m = map(int,input().split())

aclist = [0]*n
walist = [0]*n
ac = 0
wa = 0
for i in range(m):
  pp, s = input().split()
  p = int(pp) - 1
  if s == 'AC' and not aclist[p]:
    aclist[p] = 1
    ac += 1
    wa += walist[p]
  else:
    walist[p] += 1
  

print(ac, wa)
n,x=map(int,input())
m=[int(input()) for _ in range(n)]
print((x - sum(m)) // min(m) + m)

### FIXED CODE ###

n,x=map(int,input().split())
m=[int(input()) for _ in range(n)]
print((x - sum(m)) // min(m) + n)