Harryxun/stf_run huggingface dataset:
import sys
from collections import Counter

n, *s = sys.stdin.read().split()

def main():
    c = Counter(s)
    m = max(c.values())
    ans = [s for s, c in cnt.items() if c == m]
    print(*sorted(ans), sep='\n')
         
if __name__ ==  '__main__':
    main()

### FIXED CODE ###

import sys
from collections import Counter

n = int(sys.stdin.readline().rstrip())
s = sys.stdin.read().split()

def main():
    c = Counter(s)
    ma = max(c.values())
    res = []
    for l, v in c.items():
        if v == ma:
            res.append(l)
    return sorted(res)

if __name__ == '__main__':
    ans = main()
    print(*ans, sep='\n')
s  = list(str(input()))
t  = list(str(input()))

sd = {}
td = {}

for k in range(ord('a'),ord('z')+1):   
    sd[chr(k)] = 0
    td[chr(k)] = 0

for i in range(len(s)) :
    if s[i] in sd :
        sd[s[i]] = sd[s[i]] + 1

    if t[i] in td :
        td[t[i]] = td[t[i]] + 1
""" 
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in sd :
        print(str(sd[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print()
for k in range(ord('a'),ord('z')+1):   
    print(str(chr(k)) + ":",end="")
    if chr(k) in td :
        print(str(td[chr(k)]) + " ",end="")
    else:
        print("0 ",end="")
print() """

ta = []
sa = []
for k in range(ord('a'),ord('z')+1):
    if td[chr(k)] != sd[chr(k)] : 
        if td[chr(k)] > 0 :
            ta.append(td[chr(k)])
        if sd[chr(k)] > 0 :    
            sa.append(sd[chr(k)])
#print(ta)
#print(sa)

ta.sort()
sa.sort()

if ta == sa :
    print("Yes")
else :
    print("No")

### FIXED CODE ###

l = list(map(int,input().split()))
l.sort(reverse=True)
print(l[0]*10+l[1]+l[2])
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

plus = []
minus = []
for i in a:
    if i > 0: plus.append(i)
    if i < 0: minus.append(i)

ans = 1
if k > len(plus) + len(minus):
    ans = 0
elif len(minus) == 0:
    plus.sort(reverse=True)
    if k > len(plus):
        ans = 0
    else:
        for i in range(k):
            ans = (ans * plus[i]) % mod
elif len(plus) == 0:
    if k % 2 == 0:
        if k > len(minus):
            ans = 0
        else:
            minus.sort()
            for i in range(k):
                ans = (ans * minus[i]) % mod
    else:
        if n != len(minus) or k > len(minus):
            ans = 0
        else:
            minus.sort(reverse=True)
            for i in range(k):
                ans = (ans * minus[i]) % mod
elif k == len(plus) + len(minus) and (len(minus) % 2) == 1:
    if n != len(plus) + len(minus):
        ans = 0
    else:
        for x in plus:
            ans = (ans * x) % mod
        for y in minus:
            ans = (ans * y) % mod
else:
    plus.sort(reverse=True)
    minus.sort()
    i, j = 0, 0
    if k % 2 == 1:
        ans = plus[0]
        i = 1
    while i + j < k:
        tmp_p = plus[i] * plus[i + 1] if i <= len(plus) - 2 else 1
        tmp_m = minus[j] * minus[j + 1] if j <= len(plus) - 2 else 1
        if tmp_p >= tmp_m:
            ans = (ans * (tmp_p % mod)) % mod
            i += 2
        else:
            ans = (ans * (tmp_m % mod)) % mod
            j += 2
print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

plus = []
minus = []
for i in a:
    if i > 0: plus.append(i)
    if i < 0: minus.append(i)

ans = 1
if k > len(plus) + len(minus):
    ans = 0
elif len(minus) == 0:
    plus.sort(reverse=True)
    for i in range(k):
        ans = (ans * plus[i]) % mod
elif len(plus) == 0:
    if k % 2 == 0:
        minus.sort()
        for i in range(k):
            ans = (ans * minus[i]) % mod
    else:
        if n != len(minus):
            ans = 0
        else:
            minus.sort(reverse=True)
            for i in range(k):
                ans = (ans * minus[i]) % mod
elif k == len(plus) + len(minus) and (len(minus) % 2) == 1:
    if n != k:
        ans = 0
    else:
        for x in plus:
            ans = (ans * x) % mod
        for y in minus:
            ans = (ans * y) % mod
else:
    plus.sort(reverse=True)
    minus.sort()
    i, j = 0, 0
    if k % 2 == 1:
        ans = plus[0]
        i = 1
    while i + j < k:
        tmp_p = plus[i] * plus[i + 1] if i <= len(plus) - 2 else 1
        tmp_m = minus[j] * minus[j + 1] if j <= len(minus) - 2 else 1
        if tmp_p >= tmp_m:
            ans = (ans * (tmp_p % mod)) % mod
            i += 2
        else:
            ans = (ans * (tmp_m % mod)) % mod
            j += 2
print(ans)
N = innt(input())
A = list(map(int, input().split()))
count = 0
for i in range(0, N-1):
    minj = i
    for j in range(i, N-1):
        if (A[j] < A[minj]):
            minj = j
    A[i], A[minj] = A[minj], A[i]
    count += 1
print(*A)
print(count)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
count = 0
for i in range(N):
    m = i
    for j in range(i, N):
        if (A[j] < A[m]):
            m = j
    if (m != i):
        A[i], A[m] = A[m], A[i]
        count += 1
print(*A)
print(count)
N,K=map(int,input().split())
S=input()
if S[k-1]=="A":
    S[k-1]="a"
elif S[k-1]=="B":
    S[k-1]="b"
if S[k-1]=="C":
    S[k-1]="c"
print(S)



### FIXED CODE ###

N,K=map(int,input().split())
S=input()
if S[K-1]=="A":
    ans=S[:K-1]+"a"+S[K:]
elif S[K-1]=="B":
    ans=S[:K-1]+"b"+S[K:]
if S[K-1]=="C":
    ans=S[:K-1]+"c"+S[K:]
print(ans)
import math
N=int(input()) 
D=int(input())
c=0
ans=0
while c<N:
    x=int(input()) 
    y=int(input()) 
    if x*x+y*y<=D*D:
        ans+=1
    c+=1
print(ans)

### FIXED CODE ###

import math
N,D=map(int,input().split())
c=0
ans=0
while c<N:
    x,y=map(int,input().split()) 
    if x*x+y*y<=D*D:
        ans+=1
    c+=1
print(ans)
if __name__ == '__main__':
    t = int(input())
    s = set()
    for i in range(t):
        s.add(int(input()))
    print(len(s))

### FIXED CODE ###

if __name__ == '__main__':
    t = list(input())

    t[3] = '8'
    print(''.join(t))
N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))


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

ans=[]

for i in range(3):
    B=A[:]
    del B[i]
    sol=0
    for b in B:
        sol=gcd(sol,b)
    ans.append(sol)

print(max(ans))



### FIXED CODE ###

N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))


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

list1=[0]
L=0
for a in A:
    L=gcd(L,a)
    list1.append(L)

list2=[0]
R=0
for a in reversed(A):
    R=gcd(R,a)
    list2.append(R)

list2.reverse()

ans=[]

for i in range(N):
    ans.append(gcd(list1[i],list2[i+1]))

print(max(ans))
w, h, x, y = map(int, input().split())
print(w*h)
flag = 0
if w % x == 0 and h % y == 0:
  flag = 1
print(flag)

### FIXED CODE ###

w, h, x, y = map(int, input().split())
flag = 0
if w == 2*x and h == 2*y:
  flag = 1
print(w*h/2, flag)
s = input()

for i in range(len(s))
	if i%2==0 and s(i)=='R':
    print('No')
    exit
    elif i%2==1 and s(i)=='L':
    print('No')
    exit
print('Yes')

### FIXED CODE ###

s = input()
 
for i in range(len(s)):
	if i%2==1 and s[i]=='R':
		print('No')
		exit()
	elif i%2==0 and s[i]=='L':
		print('No')
		exit()
 
print('Yes')
string = input().split()
for i in range(len(string) - 1):
  if string[i] == string[i+1]
  	return print('Bad')
  
return print('Good')

### FIXED CODE ###

def main():
    string = input()
    for i in range(len(string) - 1):
        if string[i] == string[i + 1]:
            return "Bad"
    return "Good"

print(main())
from numpy import average
n = int(input())
x_list = list(map(int, input().split()))
m = int(average(x_list) + 0.5)
print(sum((x - m)**2 for x in x_list))

### FIXED CODE ###

n = int(input())
x_list = list(map(int, input().split()))
m = int(sum(x_list)/n + 0.5)
print(sum((x - m)**2 for x in x_list))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.append(b[0])
a.append(b[1])
a.append(c[0])
a.append(c[1])
x = [0] * 4

for i in a:
    x[a] += 1

for i in range(4):
    if x[i] in [1, 2]:
        print('YES')
    else:
        print('NO')

### FIXED CODE ###

a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.append(b[0])
a.append(b[1])
a.append(c[0])
a.append(c[1])
x = [0] * 4

for i in a:
    x[i-1] += 1

f = 0
for i in range(4):
    if x[i] in [1, 2]:
        f += 1

if f == 4:
    print('YES')
else:
    print('NO')
import functools
import fractions
n = int(input())
t = [int(input()) for _ in range(n)]

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
    
ans = functools.reduce(lcm, t)
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline().rstrip
n = input()
print('Yes' if n == n[::-1] else 'No')
X Y = map(int, input().split())
print(int(X + Y/2))

### FIXED CODE ###

X, Y = map(int, input().split())
print(int(X+Y/2))
S=list(input())
E=[]
O=[]
for i in range(len(S)):
  if i%2==0:
    E.append(S[i])
  else:
    O.append(S[i])
if R in E or L in O:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

S=input()
if all(c  in 'RUD' for c in S[::2]) and all(c in 'LUD' for c in S[1::2]):
  print("Yes")
else:
  print("No")
from math import factorial


n, m, k = list(map(int, input().split()))
# 　ある配置を固定した時、その2つの配置でmanhattan距離が計算される回数は、他の組み合わせ数。
combination = factorial(n*m-2)//factorial(k-2)//factorial((n*m-2)-(k-2))
# n=5なら1,2,3,4それぞれにm**2をかける。
print((sum([m**2*i*(n-i) for i in range(1, n)]) + sum([n**2*i*(m-i) for i in range(1, m)])) * combination)
# あるマンハッタン距離の時の配置の数

### FIXED CODE ###

from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate
import sys



def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n, m = LI()
nums = LI()
que = []
for k, v in Counter(nums).items():
    heappush(que, (-k, v))
for i, j in LIR(m):
    heappush(que, (-j, i))


ret = 0
ans = 0
while ret < n:
    k, v = heappop(que)
    ret += v
    ans += -k * v


print(ans + (ret - n) * k)
from scipy.special import comb
a = comb(n, r, exact=True)

import numpy as np
n, a, b = map(int, input().split())

p = 10 ** 9 + 7

print((2**n-comb(n, a, exact=True)-comb(n, b, exact=True))%p-1)

### FIXED CODE ###

k = 2 *10**5
mod = 10**9+7

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

modinv_table = [-1]*(k+1)
for i in range(1,k+1):
    modinv_table[i] = pow(i,-1,mod)

def binomial_coefficients(n,k):
    ans = 1
    for i in range(k):
        ans *= n-i
        ans *= modinv_table[i+1]
        ans %= mod
    return ans
print((pow(2,n,mod)-binomial_coefficients(n,a)-binomial_coefficients(n,b)-1)%mod)
a,b,h=map(int,input().split())
print((a+b)*h/2)


### FIXED CODE ###

a=int(input())
b=int(input())
h=int(input())
print(int((a+b)*h/2))
a=int(input("input a"))
b=int(input("input b"))
print(a*b," ",2*(a+b))



### FIXED CODE ###

a,b=map(int,input().split())
x=a*b
y=2*(a+b)
print(x,y)
n, m = map(int, input().split())
edges = [[0 for _ in range(n)] for _ in range(n)]
for i in range(m):
    a,b = map(int, input().split())
    edges[a-1][b-1] = 1
    edges[b-1][a-1] = 1

def dfs(start):
    if visited[start]:
        return
    visited[start] = 1
    for i in range(n):
        if edges[start][i]:
            dfs(i)

ans = m
# edgeを一つづつ見ていく
for i in range(m-1):
    for j in range(i+1, m):
        if not edges[i][j]:
            continue
        # エッジを削除した場合に、連結しているかをdfsで確認
        #   visited: 訪れたかどうかを表す変数
        visited = [0] * n
        edges[i][j] = 0
        edges[j][i] = 0
        dfs(0)
        # お片付け、削除したedgeを元に戻しておく
        edges[i][j] = 1
        edges[j][i] = 1

        # 全て訪れられていたら、そのエッジはなくても非連結にならないので、bridgeではない
        if sum(visited) == n:
            ans -=1

print(ans)

### FIXED CODE ###

n, m = map(int, input().split())
edges = [[0 for _ in range(50)] for _ in range(50)]
for _ in range(m):
    a,b = map(int, input().split())
    edges[a-1][b-1] = 1
    edges[b-1][a-1] = 1

def dfs(start):
    if visited[start]:
        return
    visited[start] = 1
    for i in range(n):
        if edges[start][i]:
            dfs(i)

ans = m
# edgeを一つづつ見ていく
for i in range(m-1):
    for j in range(i+1, m):
        if not edges[i][j]:
            continue
        # エッジを削除した場合に、連結しているかをdfsで確認
        #   visited: 訪れたかどうかを表す変数
        visited = [0] * n
        edges[i][j] = 0
        edges[j][i] = 0
        dfs(0)
        # お片付け、削除したedgeを元に戻しておく
        edges[i][j] = 1
        edges[j][i] = 1
        # 全て訪れられていたら、そのエッジはなくても非連結にならないので、bridgeではない
        if sum(visited) == n:
            ans -=1

print(ans)
S = input()
res = ""
for i in range(0,N,2):
  res += S[i]
print(res)

### FIXED CODE ###

S = input()
res = ""
for i in range(0,len(S),2):
  res += S[i]
print(res)
n=int(input())
lamp=[]
status=1
count=0
possible=1
for i in range(n):
  p=int(input())
  lamp.append(p)
while status!=2 or count==n:
  status=lamp[status]
  count+=1
  if count==n and status!=2:
    possible=0
if possible==1:
  print(count)
else:
  print(-1)

### FIXED CODE ###

n=int(input())
lamp=[]
status=1
count=0
possible=0
for i in range(n):
  p=int(input())
  lamp.append(p)
while status!=2:
  if lamp[status-1]!=0:
    var=lamp[status-1]
    lamp[status-1]=0
    status=var
    count+=1
  else:
    possible+=1
    break
if possible==0:
  print(count)
else:
  print(-1)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]

N, K = IA()
AB = IM(N-1)

P = 1000000007

tree = {}
for a, b in AB:
    tree.setdefault(a, set()).add(b)
    tree.setdefault(b, set()).add(a)

root = AB[0][0]
import sys
sys.setrecursionlimit(10**6)
def f(grand_parent, parent, current, v):
    if parent is None:
        k = K - 1
    else:
        k = K - 2

    for i, child in enumerate(tree[current] - {parent}):
        v = f(parent, current, child, v*(k-i) % P)
    return v

print(f(None, None, root, K)) 


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

IA = lambda: [int(x) for x in input().split()]
IM = lambda N: [IA() for _ in range(N)]

N, K = IA()
AB = IM(N - 1)

P = 1000000007

tree = {}
for a, b in AB:
    tree.setdefault(a, set()).add(b)
    tree.setdefault(b, set()).add(a)


def f(root):
    stack = [(None, None, root, K - 1)]
    v = K
    while stack:
        grand_parent, parent, current, k = stack.pop()

        for i, child in enumerate(tree[current] - {parent}):
            v = v * (k - i) % P
            stack.append((parent, current, child, K - 2))
    return v


print(f(AB[0][0]) if AB else K)
s = int(input())
w = int(input())
if s < w :
    print("unsafe")
else :
    print("safe")

### FIXED CODE ###

s, w = map(int, (input().split()))

if s > w :
    print("safe")
else :
    print("unsafe")
while int(raw_input()) != 0
	print 'Case i: ',int(raw_input())

### FIXED CODE ###

a = int(1)
b = int(1)
while True:
	b = int(raw_input())
	if b != 0:
		print('Case ' + str(a) + ': ' + str(b))
		a += 1
		continue
	else:
		break
s = input()

nums = s.split()

if (nums[0] * nums[1]) / 2 == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

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

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

if (a * b) % 2 == 0:
  print("Even")
else:
  print("Odd")
import math
from fractions import Fraction
n = int(input())

x, y = map(int, input().split())
t, a = x, y

for _ in range(n - 1):
    tt, aa = map(int, input().split())

    #c = 1
    '''
    if (t >= a):
        c = math.ceil(tt / t)

    else:
        c = math.ceil(aa / a)
    '''
    #c = math.ceil(t / tt, a / aa)
    c = math.ceil(Fraction(t, tt), Fraction(a / aa))

    t = tt * c
    a = aa * c


ans = t + a
print(ans)


### FIXED CODE ###

import math
from fractions import Fraction
from decimal import *
# ex) Fraction(2,6) > 1/3 > 0.33333

n = int(input())
x, y = map(int, input().split())
t, a = x, y

for _ in range(n - 1):
    tt, aa = map(int, input().split())

    # c = 1
    '''
    if (t >= a):
        c = math.ceil(tt / t)

    else:
        c = math.ceil(aa / a)
    '''
    # c = math.ceil(max(t / tt, a / aa))
    # c = math.ceil(max(Fraction(t + tt - 1, tt), Fraction(a + aa - 1 / aa)))
    c = max(math.ceil(Fraction(t, tt)), math.ceil(Fraction(a, aa)))
    c = max(1, c)

    t = tt * c
    a = aa * c


ans = t + a
print(ans)
from decimal import *
import re
def solve2(m, n):
    maxlen = 80
    PREC=300
    getcontext().prec = PREC
    x = Decimal(m) / Decimal(n)
    s = x.to_eng_string()
    if len(s) < PREC:
        return(s[2:],'')
    rep = 1
    while True:
        clip = max(int((PREC-20)/rep),1)
        r = r'(.{%d})\1{%d,}' % (rep, clip)  #ex. '(.{6})\\1{12,}'
        a=re.search(r, s)
        if a:
            break
        rep += 1
        if rep > maxlen:
            raise ValueError('This cannot happen.rep=%d' % rep)

    u = s[2:a.start()+len(a.group(1))]
    v = (' '*PREC + '^'*len(a.group(1)))[-len(u):]
    return(u,v)

while True:
    try:
        m,n = map(int, input().strip().split())
        s,t = solve2(m, n)
        print(s)
        if t!='':
            print(t)
    except EOFError:
        break

### FIXED CODE ###

from decimal import *
import re
def solve2(m, n):
    maxlen = 80
    PREC=180
    getcontext().prec = PREC
    x = Decimal(m) / Decimal(n)
    s = x.to_eng_string()
    if len(s) < PREC:
        return(s[2:],'')
    rep = 1
    while True:
        r = r'(.{%d})\1{%d,}' % (rep, int(maxlen/rep))  #ex. '(.{6})\\1{13,}'
        a=re.search(r, s)
        if a:
            break
        rep += 1
        if rep > maxlen:
            raise ValueError('This cannot happen.rep=%d' % rep)

    u = s[2:a.start()+len(a.group(1))]
    v = (' '*PREC + '^'*len(a.group(1)))[-len(u):]
    return(u,v)

while True:
    try:
        m,n = map(int, input().strip().split())
        s,t = solve2(m, n)
        print(s)
        if t!='':
            print(t)
    except EOFError:
        break
N = int(input())
H = list(map(int, input().split()))
for i in range(N,-1,-1):
    if H[i]>H[i-1]:
        H[i] -= 1
        if H[i]>H[i-1]:
            print("No")
            break()
print("Yes")



### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
for i in reversed(range(N-1)):
    if H[i]>H[i+1]:
        H[i] -= 1
        if H[i]>H[i+1]:
            print("No")
            exit()
print("Yes")
N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
flag=False
for cx in range(101):
    if flag:
        break
    for cy in range(101):
        if flag:
            break
        for i in range(N):
            if a[i][2]!=0:
                if i==0:
                    H=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1])
                if H!=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1]):
                    break
            if i==N-1:
                x=cx
                y=cy
                flag=True
                for k in range(N):
                    if a[k][2]!=max(H-abs(x-a[k][0])-abs(y-a[k][1]),0):
                        flag=False
print(x,y,H)

### FIXED CODE ###

N=int(input())
a=[list(map(int,input().split())) for i in range(N)]
flag=False
for cx in range(101):
    if flag:
        break
    for cy in range(101):
        count=0
        if flag:
            break
        for i in range(N):
            if a[i][2]!=0:
                if count==0:
                    H=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1])
                    count+=1
                if H!=a[i][2]+abs(cx-a[i][0])+abs(cy-a[i][1]):
                    break
            if i==N-1:
                x=cx
                y=cy
                flag=True
                for k in range(N):
                    if a[k][2]!=max(H-abs(x-a[k][0])-abs(y-a[k][1]),0):
                        flag=False
print(x,y,H)
a,b=map(int,input().split())
c=0
for i in range(a,b+1)
	o=str(i)
  	if o==o[::-1]:c+=1
print(c)

### FIXED CODE ###

a,b=map(int,input().split())
c=0
for i in range(a,b+1):
  o=str(i)
  if o==o[::-1]:
    c+=1
print(c)
n=int(input())

ans = ''
while n:
    tmp = (n-1)%26
    ans += chr(ord('a')+tmp)
    n//=26
print(ans[::-1])n=int(input())

ans = ''
while n:
    tmp = (n-1)%26
    ans += chr(ord('a')+tmp)
    n//=26
print(ans[::-1])

### FIXED CODE ###

n=int(input())

ans = ''
while n:
    tmp = (n-1)%26
    ans += chr(ord('a')+tmp)
    n-=1
    n//=26
print(ans[::-1])
R={"*":2,"/":2,"+":1,"-":1,"(":0,")":0}
for _ in[0]*int(input()):
 L=[];t=''
 for e in input()[:-1]:
  if e.isdigit():t+=e
  else:
   if t:L+=[t];t=''
   L+=e
 if t:L+=[t]
 P,S=[],[]
 for i in L:
  if"("==i:S+=i
  elif")"==i:
   while"("!=S[-1]:P+=S.pop()
   S.pop()
  elif i in R:
   while S and R[S[-1]]>=R[i]:P+=S.pop()
   S+=i
  else:P+=[i]
 while S:P+=S.pop()
 for x in P:
  S+=[str(eval(s.pop(-2)+p+s.pop()))if x in"+-*/"else x]
 print(*S)


### FIXED CODE ###

R={"*":2,"/":2,"+":1,"-":1,"(":0,")":0}
for _ in[0]*int(input()):
 L=[];t=''
 for e in input()[:-1]:
  if e.isdigit():t+=e
  else:
   if t:L+=[t];t=''
   L+=e
 if t:L+=[t]
 P,S=[],[]
 for i in L:
  if"("==i:S+=i
  elif")"==i:
   while"("!=S[-1]:P+=S.pop()
   S.pop()
  elif i in R:
   while S and R[S[-1]]>=R[i]:P+=S.pop()
   S+=i
  else:P+=[i]
 while S:P+=S.pop()
 for x in P:
  S+=[str(int(eval(S.pop(-2)+x+S.pop())))if x in"+-*/"else x]
 print(*S)
import scipy.misc as scm

N, M = map(int, input().split())

a_s = []
flag = False

for i in range(M):
    a_m = int(input())
    a_s.append(a_m)
    if(i > 0 and a_m == a_s[i-1]+1):
        flag = True
        print(0)
        break


if not flag:
    way = 1
    now = 0
    for a in a_s:
        # print("a = " + str(a))

        step = a - 1 - now
        # print("now = " + str(now))
        # print("step = " + str(step))
        w = 0
        for i in range(step//2+1):
            # print(str(step-i) + " C " + str(i))
            # print (scm.comb(step-i, i))
            w += scm.comb(step-i, i)
        if(w != 0):
            way = w * way
        now = a+1
        # print(w)

    step = N - now
    # print("way = " + str(way))
    w = 0
    for i in range(step//2+1):
        # print(str(step-i) + " C " + str(i))
        # print (scm.comb(step-i, i))

        w += scm.comb(step-i, i)
    # print("w = " +str(w))
    if(w != 0):
        way = w * way

    print(int(way % 1000000007))


### FIXED CODE ###

N, M = map(int, input().split())

flag = [ 0 for i in range(N+1)]
dp = [0 for i in range(N+1)]

for _ in range(M):
    a = int(input())
    flag[a] = 1


dp[0] = 1
if flag[1] == 1:
    dp[1] = 0
else:
    dp[1] = 1;

for i in range(2, N+1):
    if flag[i] == 1:
        dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % 1000000007

print(dp[N])
n,m=map(int,input().split())
a=[]
b=[]
for i in range(m):
    a.append(input())
    b.append(input())
for j in range(n):
    print(a.count(j+1)+b.count(j+1))
    

### FIXED CODE ###

n,m=map(int,input().split())
A=[]
B=[]
for i in range(m):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)
for j in range(n):
    print(A.count(j+1)+B.count(j+1))
N=int(inout())
for i in range 26:
  price=4*i
  for j in range 16:
    price+=7*j
    if price==N:
      print('Yes')
      break
print('No')

### FIXED CODE ###

N=int(input())
for i in range(26):
  price=4*i
  for j in range(16):
    price+=7*j
    if price==N:
      print('Yes')
      break
  if price==N:
      break
else:
  print('No')
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)

print(distance[0])


### FIXED CODE ###

from functools import reduce
import fractions

N, X = map(int,input().split())
x = list(map(int,input().split()))
x = list(map(lambda x:abs(x-X), x))
x = reduce(lambda a,b: fractions.gcd(a,b), x)
print(x)