Harryxun/stf_run huggingface dataset:
def FACT(DICT, N):
    FACT = DICT
    LIM = int((N**0.5)//1)+1
    for i in range(2, LIM):
        if N%i == 0:
            FACT[i] = 0
        while N%i == 0:
            FACT[i] += 1
            N //= i
        if len(FACT) == len(DICT):
            FACT[N] = 1
            return FACT
    return FACT(FACT, N)

def comb_rep(n, r):
    N = n+r-1
    ANS = 1
    for R in range(r):
        ANS *= N-R
        ANS /= R+1
    return int(ANS)

MOD = 10**9+7
n, m = map(int, input().split())
factor = FACT({}, m)
ans = 1
for i in factor:
    ans *= comb_rep(n, factor[i])
    ans %= MOD
print(ans)

### FIXED CODE ###

def FACTOR(DICT, N):
    FACT = DICT
    LIM = int(N**0.5)+2
    for i in range(2, LIM):
        if N%i == 0:
            FACT[i] = 0
        while N%i == 0:
            FACT[i] += 1
            N //= i
    if len(FACT) == len(DICT):
        if N != 1:
            FACT[N] = 1
        return FACT
    return FACTOR(FACT, N)

def comb_rep(n, r):
    N = n+r-1
    ANS = 1
    for R in range(r):
        ANS *= N-R
    for R in range(r):
        ANS //= r-R
    return int(ANS)

MOD = 10**9+7
n, m = map(int, input().split())
factor = FACTOR({}, m)
ans = 1
for i in factor:
    ans *= (comb_rep(n, factor[i])%MOD)
    ans %= MOD
print(ans)
AopB=input().split()
if AopB[1]=='+':
  print(int(AopB[0]+int(AopB[2])))
else:
  print(int(AopB[0]-int(AopB[2])))


### FIXED CODE ###

AopB=input().split()
if AopB[1]=='+':
  print(int(AopB[0])+int(AopB[2]))
else:
  print(int(AopB[0])-int(AopB[2]))
a,b,c,d=[int(_) for _ in input().split()]
if a<0 or b<0 or c<0 or d<0:
    print(min(a,b)*max(c,d))
else:
    print(max(a,b)*max(c,d))
5 -4 8 -1

### FIXED CODE ###

a,b,c,d=[int(_) for _ in input().split()]
ans=max(a*c,a*d,b*c,b*d)
print(ans)
n, k = list(map(int, input().split()))
s = input()

end = []
start = []

if s[0] == "1":
	start.append(0)
	end.append(0)
else:
	#仮想的な1の区間を作る
	start.append(0)
	end.append(0)

for i in range(1, n-1):
	if s[i-1] == "0" and s[i] == "1":
		start.append(i)
	if s[i] == "1" and s[i+1] == "0":
		end.append(i)

if s[-1] == "1":
	start.append(n-1)
	end.append(n-1)
else:
	#仮想的な1の区間を作る
	start.append(n-1)
	end.append(n-1)

ans = 0

"""print(start, end, ans)
print(len(start), len(end), ans)
"""
for j in range(len(start) - k):
	temp = end[j+k] - start[j] + 1 
	if temp > ans:
		ans = temp

if len(start) <= k:
	ans = n

print(ans)


### FIXED CODE ###

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

end = []
start = []

if s[0] == "1":
	start.append(0)
else:
	#仮想的な1の区間を作る
	start.append(0)
	end.append(0)

for i in range(n-1):
	if s[i] == "1" and s[i+1] == "0":
		end.append(i)
for i in range(1, n):
	if s[i-1] == "0" and s[i] == "1":
		start.append(i)

if s[-1] == "1":
	end.append(n-1)
else:
	#仮想的な1の区間を作る
	start.append(n-1)
	end.append(n-1)

ans = 0

"""print(start, end, ans)
print(len(start), len(end), ans)"""

for j in range(len(start) - k):
	temp = end[j+k] - start[j] + 1 
	if temp > ans:
		ans = temp

if len(start) <= k:
	ans = n

print(ans)
K = int(input())
A = int(input())
B = int(input())
i = A
while A <= i <= B :
    if str(K) in str(i) :
        print("OK")
        break
    i = i + 1
else :
    print("NG")

### FIXED CODE ###

from sys import stdin, stdout
import math
import bisect
import queue

k = int(stdin.readline().strip())
a, b = map(int, stdin.readline().strip().split())

flag = 0

for i in range(a, b + 1):
    if i % k == 0:
        flag = 1
        break

stdout.writelines('OK\n' if flag == 1 else 'NG\n')
while True:
    h,w = map(int, input().split())
    if h==w==0:break
    for y in range(h):
        for x in range(1,w+1):
            if (x+y)%2==0:prnt('#',end='')
            else print('.',end='')
        print()
    print()

### FIXED CODE ###

while 1:
    h,w = map(int, input().split())
    if h==w==0:break
    for y in range(h):
        for x in range(w):
            if (x+y)%2==0:print('#',end='')
            if (x+y)%2==1: print('.',end='')
        print()
    print()
from mpmath import

R = float(input())
mp.dps = 30
round(2*pi*R, 30)

### FIXED CODE ###

import math
R = int(input())
print(2*math.pi*R)
k,x = map(int,input().split)
print("Yes" if 500*k>=x else "No")

### FIXED CODE ###

k,x = map(int,input().split())
print("Yes" if 500*k>=x else "No")
def Fib(n):    
    if n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        return Fib(n-1)+Fib(n-2)
        
        
        
        
n, m = [int(i) for i in input().split()]
a = [int(input()) for i in range(m)]
MOD = 1000000007

#出来ない判定
for i in range(m-1):
    if (a[i+1] - a[i]) == 1:
        print(0)
        exit()

#壊れてる床前後で組み合わせ

allnum = 1
i = 0
for b in range(m):
    #print(b, i, allnum)
    buf= Fib(a[b]-1 - i + 2)
    allnum *= buf
    i = a[b]+1
    #print(b, i, allnum)

buf = Fib(n - i + 2)
# print(n, i, buf)

allnum *= buf

print(allnum%MOD)

### FIXED CODE ###

import sys
 
n, m = list(map(int, input().split()))
if m > 0:
    aaa = set(map(int, sys.stdin))
else:
    aaa = set()
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1 if 1 not in aaa else 0
MOD = 10 ** 9 + 7
 
for i in range(2, n + 1):
    if i in aaa:
        continue
    dp[i] = (dp[i - 2] + dp[i - 1]) % MOD
print(dp[n])
n=int(input())
y=[]
for i in range(1,round(n**0.5)+1):
    if n%i==0:
        y.append(i)
ans=0
for i in y:
    if n//(i-1)==n%(i-1):
        ans+=(i-1)
print(ans)

### FIXED CODE ###

n=int(input())
y=[]
for i in range(1,round(n**0.5)+1):
    if n%i==0:
        y.append(i)
        y.append(n//i)
ans=0
for i in y: 
    if i>1 and n//(i-1)==n%(i-1):
        ans+=(i-1)
print(ans)
n,m = map(int,input().split())
a_list = list(map(int,input().split()))
a_list.sort()
b_c_list = []
for i in range(m):
  b_c_list.append(list(map(int,input().split())))

b_c_list.sort(key=lambda x: x[1],reverse = True)
                  
count = 0
d = []
for b_c in b_c_list:
  for i in range(b_c[0]):
    d.append(b_c[1])
    count += 1
  if count == n:
    break
    

for i in range(n):
  if a_list[i] < d[i]:
    a_list[i] = d[i]
  else:
    break
    
print(sum(a_list))

### FIXED CODE ###

n,m = map(int,input().split())
a_list = list(map(int,input().split()))
a_list.sort()
b_c_list = []
for i in range(m):
  b_c_list.append(list(map(int,input().split())))

b_c_list.sort(key=lambda x: x[1],reverse = True)
                  
count = 0
d = []
for b_c in b_c_list:
  for i in range(b_c[0]):
    d.append(b_c[1])
    count += 1
    if count >= n:
      break
  if count >= n:
    break
    

for i in range(min(n,len(d))):
  if a_list[i] < d[i]:
    a_list[i] = d[i]
  else:
    break
    
print(sum(a_list))
m=[]
a=[]
r=[]
c=[]
h=[]
ans=1
for i in range(n):
    if s[i][0] == "M" and not s[i] in m:
        m.append(s[i])
    elif s[i][0] == "A" and not s[i] in a:
        a.append(s[i])
    elif s[i][0] == "R" and not s[i] in r:
        r.append(s[i])
    elif s[i][0] == "C" and not s[i] in c:
        c.append(s[i])
    elif s[i][0] == "H" and not s[i] in h:
        h.append(s[i])
num=len(m)+len(a)+len(r)+len(c)+len(h)
if num == 0:
    print(0)
else:
    lis = list(len(m),len(a),len(r),len(c),len(h))
    for i in range(5):
        ans = ans*lis[i] 
    print(ans)

### FIXED CODE ###

n=int(input())
s=list(input() for i in range(n))
mc=ac=rc=cc=hc=0
cnt=0
for i in range(n):
    if s[i][0] == "M":
        mc+=1
    elif s[i][0] == "A":
        ac+=1
    elif s[i][0] == "R":
        rc+=1
    elif s[i][0] == "C":
        cc+=1
    elif s[i][0] == "H":
        hc+=1
lis = [mc,ac,rc,cc,hc]
if sum(lis) == 0:
    print(0)
else:
    for i in range(5):
        for j in range(i+1,5):
            for k in range(j+1,5):
                cnt+=lis[i]*lis[j]*lis[k]
    print(cnt)
import math
import string


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


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


a = int(input())
b = int(input())

print("Odd" if (a*b) % 2 == 0 else "Even")


### FIXED CODE ###

import math
import string


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


def nCr(n, r):
    return math.factorial(n)//math.factorial(n-r)*math.factorial(r)


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

print("Even" if (a*b) % 2 == 0 else "Odd")
import math
a,b=map(int, input().split())
n = math.gcd(a,b)


def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


divs = divisor(n)
ans = 0

for d in divs:
    ans += is_prime(d)


print(ans+1)

### FIXED CODE ###

import fractions
a,b=map(int, input().split())
n = fractions.gcd(a,b)


def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


divs = divisor(n)
ans = 0

for d in divs:
    ans += is_prime(d)


print(ans+1)
import sys
import numpy as np

def main(N, S):
    dp = np.zeros((N + 1, N + 1), dtype=int)
    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i, j] = min(j - i, dp[i - 1, j - 1] + 1) if S[i] == S[j] else 0
        ans = max(ans, np.max(dp[i]))
    return ans


if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8(i8,i8[:])')(main)
    # b1: bool, i4: int32, i8: int64, double: f8, [:], [:, :]
    cc.compile()
else:
    from my_module import main
    N = int(input())
    S = np.array([ord(_) for _ in input()])
    print(main(N, S))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
S, T = input()
print(T+S)

### FIXED CODE ###

S, T = raw_input().split()
print T+S
A,B=map(int,input().split())
if　(A+B)%2 !=0:
  print('IMPOSSIBLE')
else:
  print((A+B)//2)


### FIXED CODE ###

A,B=map(int,input().split())
if (A+B)%2 !=0:
  print('IMPOSSIBLE')
else:
  print((A+B)//2)
import collections as c
 
d=c.defaultdict(list)
n=int(input())
for s in range(n-1):
    a,b,c=map(int,input().split())
    d[a].append([b,c])
    d[b].append([a,c])

def DFS(point,d,cost,TFlist): #入力と同じindex系
    for s in d[point]:
        p=s[0]
        c=s[1]+cost[point]
        if TFlist[p-1]:
            continue
        cost[p]+=c
        TFlist[p-1]=1
        DFS(p,d,cost,TFlist)
    return cost[point]

cost=[None]+[0 for i in range(n)]
q,k=map(int,input().split())
TFlist=[0 for i in range(n)]
TFlist[k-1]=1
DFS(k,d,cost,TFlist)

for t in range(q):
    a,b=map(int,input().split())
    print(cost[a]+cost[b])

### FIXED CODE ###

from collections import *
from heapq import*
import sys
input=lambda:sys.stdin.readline()

d=defaultdict(list)
n=int(input())

for s in range(n-1):
    a,b,c=map(int,input().split())
    d[a].append([b,c])
    d[b].append([a,c])
#defaultdict(<class 'list'>, {1: [[2, 1], [3, 1]], 2: [[1, 1], [3, 3]], 3: [[1, 1], [2, 3]]})

def DIJKSTRA(point,d):
    cost      = {node:float("inf") for node in d.keys()}
    Q         = []  #頂点のリスト
    cost[point]=0  #開始地点のコストをゼロとする（当たり前
    heappush(Q,(point,cost[point]))
    while Q:
        prefnd,tmpC=heappop(Q)
        if cost[prefnd]<tmpC:
            continue
        for node,c in d[prefnd]:
            altC=c+tmpC
            if cost[node]>altC:
                cost[node]=altC
                heappush(Q,(node,altC))
    return cost

q,k=map(int,input().split())
y=DIJKSTRA(k,d)

for i in range(q):
    a,b=map(int,input().split())
    print(y[a]+y[b])
S=input()

h = S//3600
S = S%3600

m = S//60
s = S%60

print(h,m,s,sep=":")

### FIXED CODE ###

S=int(input())

h = S//3600
S = S%3600

m = S//60
s = S%60

print(h,m,s,sep=":")
a,p = map(int,raw_input().split())
print (3*a+p)/2

### FIXED CODE ###

a,p = map(int,raw_input().split())
print (3*a+p)/2
a = int(input())-1
b = int(input())-1
print(a*b)

### FIXED CODE ###

a, b = list(map(lambda x: int(x)-1, input().split()))
print(a*b)
N, M, C = map(int, input().split())
 
B = list(map(int, input().split()))
 
ans = 0
 
src = []

for i in range(N):
  src.append(list(map(int, input().split()))) 
  
for i in range(N):
  d += C
  for n in range(M):
    d += src[i][n]*B[n]
  print(d)
  if (d > 0):
    ans+= 1

print(ans)

### FIXED CODE ###

N, M, C = map(int, input().split())
 
B = list(map(int, input().split()))
 
ans = 0
 
src = []

for i in range(N):
  src.append(list(map(int, input().split()))) 
  
for i in range(N):
  d = C
  for n in range(M):
    d += src[i][n]*B[n]
  if (d > 0):
    ans+= 1

print(ans)
class UnionFind():
    def __init__(self,n):
        self.n=n
        self.root=[-1]*(n+1)
        self.rnk=[0]*(n+1)

    def Find_Root(self,x):
        if self.root[x]<0:
            return x
        else:
            self.root[x]=self.Find_Root(self.root[x])
            return self.root[x]

    def Unite(self,x,y):
        x=self.Find_Root(x)
        y=self.Find_Root(y)
        if x==y:
            return
        elif self.rnk[x]>self.rnk[y]:
            self.root[x]+=self.root[y]
            self.root[y]=x
        else:
            self.root[y]+=self.root[x]
            self.root[x]=y
            if self.rnk[x]==self.rnk[y]:
                self.rnk[y]+=1

    def isSameGroup(self,x,y):
        return self.Find_Root(x)==self.Find_Root(y)

    def Count(self,x):
        return -self.root[self.Find_Root(x)]

h,w=map(int,input().split())
g=[list(input()) for _ in range(h)]
uf=UnionFind(h*w)
for i in range(h):
    for j in range(w-1):
        if g[i][j]!=g[i][j+1]:
            uf.Unite(i*3+j,i*3+j+1)

for j in range(w):
    for i in range(h-1):
        if g[i][j]!=g[i+1][j]:
            uf.Unite(i*3+j,(i+1)*3+j)

x=[]
for i in range(h*w):
    x.append(uf.Find_Root(i))

d=[[0,0] for _ in range(h*w)]
for i in range(h):
    for j in range(w):
        now=i*w+j
        nr=x[now]
        if g[i][j]=="#":
            d[nr][0]+=1
        else:
            d[nr][1]+=1
ans=0
for i in range(h*w):
    ans+=d[i][0]*d[i][1]
print(ans)


### FIXED CODE ###

class UnionFind():
    def __init__(self,n):
        self.n=n
        self.root=[-1]*(n+1)
        self.rnk=[0]*(n+1)

    def Find_Root(self,x):
        if self.root[x]<0:
            return x
        else:
            self.root[x]=self.Find_Root(self.root[x])
            return self.root[x]

    def Unite(self,x,y):
        x=self.Find_Root(x)
        y=self.Find_Root(y)
        if x==y:
            return
        elif self.rnk[x]>self.rnk[y]:
            self.root[x]+=self.root[y]
            self.root[y]=x
        else:
            self.root[y]+=self.root[x]
            self.root[x]=y
            if self.rnk[x]==self.rnk[y]:
                self.rnk[y]+=1

    def isSameGroup(self,x,y):
        return self.Find_Root(x)==self.Find_Root(y)

    def Count(self,x):
        return -self.root[self.Find_Root(x)]

h,w=map(int,input().split())
g=[list(input()) for _ in range(h)]
uf=UnionFind(h*w)
dyx=[(1,0),(-1,0),(0,1),(0,-1)]
for i in range(h):
    for j in range(w):
        if g[i][j]==".":
            continue
        p=i*w+j
        for dy,dx in dyx:
            y=i+dy
            x=j+dx
            if 0<=y<h and 0<=x<w:
                if g[y][x]==".":
                    np=y*w+x
                    uf.Unite(p,np)

rt=[0]*(h*w)
for i in range(h*w):
    rt[i]=uf.Find_Root(i)

m=min(rt)
rt=list(map(lambda x:x-m, rt))
m=max(rt)
a=[[0,0] for _ in range(m+1)]
for i in range(h*w):
    y=i//w
    x=i%w
    if g[y][x]=="#":
        a[rt[i]][0]+=1
    else:
        a[rt[i]][1]+=1
ans=0
for i,j in a:
    ans+=i*j

print(ans)
N,T = map(int,input().split())
t = list(map(int,input().split()))
ans = T
for i in range(N-1):
    now = t[i+1]-t[i]
    ans += min(now,T)


print(ans)

### FIXED CODE ###

N,T = map(int,input().split())
t = list(map(int,input().split()))
ans = T
for i in range(N-1):
    now = t[i+1]-t[i]
    ans += min(now,T)


print(ans)
a = int(input())
i = 1
while i < 10:
  if a%i = 0 and 1<= a//i <=9:
    print("Yes")
    break
  else:
    i += 1

### FIXED CODE ###

a = int(input())
i = 1
while i < 10:
  if a%i == 0 and 1<= a//i <=9:
    print("Yes")
    break
  else:
    i += 1
if i >=10:
    print("No")
from collections import deque
import sys
sys.setrecursionlimit(200000)
N, M = map(int, input().split())
graph = [[] for j in range(M)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

for room, depth in enumerate(depth_array):
    for node in graph[room]:
        if depth_array[node] + 1 == depth_array[room]:
            mark_array[room] = node
if -1 in mark_array[1:]:
    print("No")
else:
    print("Yes")
    for m in mark_array[1:]:
        print(m+1)

### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(200000)
N, M = map(int, input().split())
graph = [[] for j in range(N)]
q = deque([])
depth_array = [-1 for i in range(N)]

for i in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)

def bfs(graph, q, depth_array):
    # 終了条件
    if len(q) == 0:
        return depth_array

    cur_room = q.popleft()

    # キューに追加
    for r in graph[cur_room]:
        if depth_array[r] == -1: #未訪問なら
            q.append(r)
            depth_array[r] = depth_array[cur_room] + 1

    return bfs(graph, q, depth_array)
    
# init
q.append(0)
depth_array[0] = 0
depth_array = bfs(graph, q, depth_array)

mark_array = [-1 for i in range(N)]
#print(depth_array)

for room, depth in enumerate(depth_array):
    for node in graph[room]:
        if depth_array[node] + 1 == depth_array[room]:
            mark_array[room] = node

if -1 in mark_array[1:]:
    print("No")
else:
    print("Yes")
    for m in mark_array[1:]:
        print(m+1)
N=int(input())
M=int(input())
arr=list(map(int,input().rstrip().split()))
summ=0
for i in range(M) :
	summ+=arr[i]  
if summ>=N :
	print(-1)
else :
  print(N-summ)

### FIXED CODE ###

arr=list(map(int,input().rstrip().split()))
N=arr[0]
M=arr[1]
arr=list(map(int,input().rstrip().split()))
summ=0
for i in range(M) :
    summ+=arr[i]
if summ>N :
    print(-1)
else :
    print(N-summ)
N, K = map(int, input().split())
import numpy as np
S = np.array(list(input()))
count = 0
if S[0] == 'R' and S[1] == 'R':
    count += 1
if S[-1] == 'L' and S[-2] == 'L':
    count += 1
for i in range(1, N-1):
    if S[i] == 'R' and S[i+1] == 'R':
        count += 1
    if S[i] == 'L' and S[i-1] == 'L':
        count += 1
count += K * 2
print(min(count, N-1))

### FIXED CODE ###

N, K = map(int, input().split())
import numpy as np
S = np.array(list(input()))
count = 0
if len(S) >= 2:
    if S[0] == 'R' and S[1] == 'R':
        count += 1
    if S[-1] == 'L' and S[-2] == 'L':
        count += 1
for i in range(1, N-1):
    if S[i] == 'R' and S[i+1] == 'R':
        count += 1
    if S[i] == 'L' and S[i-1] == 'L':
        count += 1
count += K * 2
print(min(count, N-1))
from scipy.special import comb


N, M = map(int, input().split())
result = 0
if N >= 2:
    result += comb(N, 2)
if M >= 2:
    result += comb(M, 2)
print(int(result))

### FIXED CODE ###

from operator import mul
from functools import reduce
def combinations(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


N, M = map(int, input().split())
result = 0
if N >= 2:
    result += combinations(N, 2)
if M >= 2:
    result += combinations(M, 2)
print(int(result))
n,*L = map(int,open(0).read().split())
sum1 = sum(L)
L.sort()
if sum1%10 != 0:
    print(sum1)
    exit()
else:
    i = 0
    while sum1%10==0:
        sum1 -= L[i]
        i +=1
print(sum1)

### FIXED CODE ###

n = int(input())
li = []
for i in range(n):
    li.append(int(input()))
li.sort()
flag1 = False
flag2 = False
flag3 = False
if sum(li)%10 != 0:
    flag2 = True

for i in range(n):
    if (sum(li) - li[i])%10 != 0 and flag2 == False:
        flag1 = True
        break
    else:
        flag3 =True
    
if flag1:
    print (sum(li) - li[i])
elif flag2:   
    print(sum(li))
elif flag3:
    print(0)
def main():
    o = input()
    e = input()

    pw = [0]*(len(o)+len(e))

    for i in range(len(o)):
        pw[i*2] = o[i*2]

    for i in range(len(e)):
        pw[i*2 + 1] = e[i*2 + 1]

    print("".join(pw))

    # if len(o) == len(e):
    #     pw = [o[i]+e[i] for i in range(len(o))]
    # else:
    #     pw = [o[i]+e[i] for i in range(len(e))]
    #     pw.append(o[-1])
    # 
    # print("".join(pw))
    # 


if __name__ == "__main__":

    main()


### FIXED CODE ###

def main():
    o = input()
    e = input()

    if len(o) == len(e):
        pw = [o[i]+e[i] for i in range(len(o))]
    else:
        pw = [o[i]+e[i] for i in range(len(e))]
        pw.append(o[-1])

    print("".join(pw))


if __name__ == "__main__":

    main()
n,m=map(int,input().split())

N=[[0,0]*n]
co=0
pe=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s=='WA':
        N[p-1][0]+=1
    elif N[p-1][1]!=1:
        pe+=N[p-1][0]
        co+=1
        N[p-1][1]=1

print(str(co)+' '+str(pe))

### FIXED CODE ###

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

N=[]

for i in range(n):
    N.append([0,0])

co=0
pe=0
for i in range(m):
    p,s=input().split()
    p=int(p)
    if s=='WA':
        N[p-1][0]+=1
    elif N[p-1][1]!=1:
        pe+=N[p-1][0]
        co+=1
        N[p-1][1]=1

print(str(co)+' '+str(pe))
a, b, c, d = map(int, input())

if abs(a-b)<= d and abs(b-c)<=d:
  print("Yes")
elif abs(a-c) <= d:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a, b, c, d = map(int, input().split())
 
if abs(a-b)<= d and abs(b-c)<=d:
  print("Yes")
elif abs(a-c) <= d:
  print("Yes")
else:
  print("No")
#172B
def B()
  S = input()
  T = input()
  count=0
  for i in range(length(S)):
    if S[i]!=T[i]:
    count = count+1
print(count)
B()

### FIXED CODE ###

#172B
def B():
    s = input()
    t = input()
    count = 0
    for i in range(len(s)):
        if s[i] != t[i]:
            count += 1
    print(count)
B()
N = int(input())
A = tuple(map(int, input().split()))
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt) 

### FIXED CODE ###

N = int(input())
A = tuple(map(int, input().split()))
if len(A) == 1:
  print(1)
  exit()
r = 1
cnt = 1
T = A[0]
t = 1
flg = False
for l in range(N):
  while True:
    if T ^ A[r] == T + A[r]:
      t += 1
      cnt += t
      T += A[r]
      r += 1
    else:
      T -= A[l]
      t -= 1
      break
    if r == N:
      flg = True
      break
  if flg:
    break
print(cnt)
n,a,b = map(int, input().split())
def f(x):
  ret = 0
  while(x > 0):
    ret += x % 10
    x //= 10
  return ret
nums = filter(lambda x: f(x) >= a and f(x) <= b, range(1, n + 1))
print(sum(nums))

### FIXED CODE ###

a,b,c,d = map(int, input().split())
print("Left" if a + b > c + d else ("Right" if a + b < c + d else "Balanced"))