Harryxun/stf_run huggingface dataset:
N,M=map(int,input().split(' '))
R=[list(map(int,input().split(' '))) for i in range(M)]
Mat=[[0]*N]*N
for r in R:
	Mat[r[0]-1][r[1]-1]=1
	Mat[r[1]-1][r[0]-1]=1

stack=[1]
island=[]

ans=0
Matmini=[]

def dfs():
	global stack
	global island
	global Matmini
	if stack==[]:
		return None
	if len(set(island))==N:
		#全頂点が網羅できていたらそこで終了
		return None
	else:
		#たどれるノードがあるかどうかを確認
		for i in range(1,N+1):
			#iが未訪問のときのみ処理続行
			if i not in stack:
				#実際に辺が存在するか
				if Matmini[stack[0]-1][i-1]==1:
					stack = [i] + stack
					dfs()
		#これ以上先に進めなくなったら島の構成要素を更新
		island += stack
		stack.pop(0)

for r in R:
	#Rからi番目の辺だけ除去したもの
	Matmini = Mat
	Matmini[r[0]-1][r[1]-1]=0
	Matmini[r[1]-1][r[0]-1]=0
	stack = [1]
	island = []
	dfs()
	if len(set(island))!=N:
		ans += 1
		
print(ans)


### FIXED CODE ###

n = list(map(int,input().split(' ')))
print(str(max([i if n.count(i)==1 else -10000 for i in list(dict.fromkeys(n))])))
import math
from functools import reduce

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

def f(m, a):
    re = 0
    for i in a:
        re += m % i
    return re

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

m = lcm_list(a) - 1
print(f(m, a))

### FIXED CODE ###

import fractions
from functools import reduce

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

def f(m, a):
    re = 0
    for i in a:
        re += m % i
    return re

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

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

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

m = lcm_list(a) - 1
print(f(m, a))
import sys

def I(): return int(sys.stdin.readline().rstrip())

N = I()
T = [I() for _ in range(N)]

from math import gcd

ans = T[0]
for i in range(N-1):
    ans = (ans*T[i+1])//gcd(ans,T[i+1])

print(ans)

### FIXED CODE ###

import sys

def I(): return int(sys.stdin.readline().rstrip())

N = I()
T = [I() for _ in range(N)]

from fractions import gcd

ans = T[0]
for i in range(N-1):
    ans = (ans*T[i+1])//gcd(ans,T[i+1])

print(ans)
N, W = map(int, input().split())

items = [list(map(int, input().split())) for _ in range(N)]
v_sum = sum([item[1] for item in items])

inf = float("inf")
dp = [inf for _ in range(v_sum + 1)]

dp[0] = 0
for i in range(N):
    for j in range(v_sum, -1, -1):
        if dp[j] >= dp[j - items[i][1] + items[i][0]]:
            dp[j] = dp[j - items[i][1]] + items[i][0]

for i in range(v_sum, -1, -1):
    if dp[i] <= W:
        print(i)
        exit()


### FIXED CODE ###

N, W = map(int, input().split())
goods = [list(map(int, input().split())) for i in range(N)]
v_sum = sum([i[1] for i in goods])
dp = [float("inf") for i in range(v_sum + 1)]
dp[0] = 0
for i in range(N):
    for j in range(v_sum, -1, -1):
        dp[j] = min(dp[j - goods[i][1]] + goods[i][0], dp[j])

for i in range(v_sum, -1, -1):
    if dp[i] <= W:
        print(i)
        break
A = int(input())
B = int(input())

if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")

### FIXED CODE ###

A, B = map(int, input().split())
if A <= 8 and B <= 8:
    print("Yay!")
else:
    print(":(")
import math

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

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

for i in range(1, k + 1):
    answer = combinations_count(k-1, i - 1) * combinations_count(n - k + 1, i)
    # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
    print(answer % (10 ** 9 + 7))

### FIXED CODE ###

import math

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


def combinations_count(N, R):
    return math.factorial(N) // (math.factorial(N - R) * math.factorial(R))


for i in range(1, k + 1):
    # 注意！もし青玉の置く場所がiより少なかったら置くことができないので、0通り
    if n - k + 1 < i:
        print(0)
    else:
        answer = combinations_count(k - 1, i - 1) * combinations_count(n - k + 1, i)
        # print(combinations_count(i - 1 + k, i - 1), combinations_count(n - k + 1, i))
        print(answer % (10 ** 9 + 7))
a=int(input())
b=int(input())
if a>b:
 print("GREATER")
elif a==b:
 print("EQUAL")
else:
 print("LESS")

### FIXED CODE ###

s1, s2, s3 =map(str, input().split())
print(s1[0].upper() + s2[0].upper() + s3[0].upper())
s1,s2,s3=list(map(str,input().split(,)))
print(s1 , s2 , s3)

### FIXED CODE ###

s1,s2,s3=list(map(str,input().split(',')))
print(s1 , s2 , s3)
def typical_stairs():
    n, m, *dangerous = map(int, open(0).read().split())
    dangerous = set(*dangerous)
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = (dp[i - 2] + dp[i - 1]) % mod
    print(dp[-1])


if __name__ == '__main__':
    typical_stairs()


### FIXED CODE ###

def typical_stairs():
    n, m = map(int, input().split())
    dangerous = set(int(input()) for _ in range(m))
    mod = 1000000007
    dp = [0] * (n + 1)
    dp[0] = 1
    if 1 not in dangerous:
        dp[1] = 1
    for i in range(2, n + 1):
        if i not in dangerous:
            dp[i] = dp[i - 2] + dp[i - 1]
    print(dp[-1] % mod)


if __name__ == '__main__':
    typical_stairs()
n,m,x = map(int,input().split())
ca = [list(map(int,input().split())) for _ in range(n)]
c = [ca[i][0] for i in range(n)]
a = [ca[i][1:] for i in range(n)]
l = 0
for i in range(2 ** n):
    ans = sum(c)
    get = [0] * m
    kari = 0
    for j in range(n):
        if (i >> j) & 1:　#i(ex.5)を2進数(ex.101)に一桁ずつ変換
            get = [x + y for (x, y) in zip(get, a[j])]
            kari += c[j]
    if all([z >= x for z in get]):
        ans = min(ans,kari)
        l += 1
if l == 0:
    ans = -1

print(ans)

            
            

### FIXED CODE ###

n,m,x = map(int,input().split())
ca = [list(map(int,input().split())) for _ in range(n)]
c = [ca[i][0] for i in range(n)]
a = [ca[i][1:] for i in range(n)]
l = 0
ans = sum(c) 
for i in range(2 ** n):
    get = [0] * m
    kari = 0
    for j in range(n):
        if (i >> j) & 1: #i(ex.5)を2進数(ex.101)に一桁ずつ変換
            get = [x + y for (x, y) in zip(get, a[j])]
            kari += c[j]
    #print(get,kari)
    #print([k >= x for k in get])
    if all([k >= x for k in get]):
        ans = min(ans,kari)
        l += 1
if l == 0:
    ans = -1
    
print(ans)
n=int(input())
l=[int(x) for x in input().split()]
l.sort()
s=0
for a in range(0,n-2):
    for b in range(a+1,n-1):
        c=b+1
        while l[c]<l[a]+l[b]:
            s=s+1
            c=c+1
print(s)

### FIXED CODE ###

def bis_right(lis,dev):
    a=0
    b=len(lis)-1
    while a<b:
        c=(a+b)//2
        if lis[c]>dev:
            b=c
        else:
            a=c+1
    if lis[a]<=dev:
        return a
    return a-1



n=int(input())
l=[int(x) for x in input().split()]
l.sort()
s=0
for a in range(n-2):
    for b in range(a+1,n-1):
        c=bis_right(l[b+1:],l[a]+l[b]-1)
        s+=c+1
print(s)
a=int(input())
b=list(map(int,input().split()))(A1,A2...AN)
t=0
for i in A:
	if x % 2 ==0 and x % 3 != 0 and x % 5 != 0:
		t=t+1
if t>0:
	print('DENIED')
else:
	print('APPROVED')

### FIXED CODE ###

import sys
N = int(input())
A = [int(i) for i in input().split()]
for i in A:
  if i%2 == 0 and (not i%3 == 0 and not i % 5 == 0):
    print("DENIED")
    sys.exit()
  else :
    continue
print("APPROVED")
import math
a,b,c,d = map(int,input().split())
l = (c*d) // math.gcd(c,d)

x = b//c - (a-1)//c
y = b//d - (a-1)//d
z = b//l - (a-1)//l

s = (x+y-z)
print(b-a+1-s)

### FIXED CODE ###

s = ''
for i in input():
    if s == i:
        print("Bad")
        exit()
    s = i
print("Good")
a,b,c,d = input()
print("Yes" b==c and(a==b or c==d) else "No" )

### FIXED CODE ###

a,b,c,d = input()
print("Yes" if b==c and( a==b or c==d ) else "No" )
a,b=input.split()

if(a=b):
  print("Yes")
  
if(a!=b):
  print("No")

### FIXED CODE ###

a,b=input().split()
if(a==b):
  print("Yes")
if(a!=b):
  print("No")
N = int(input())
arr = []
for i in range(N):
  arr.append(int(input()))
for i range(N):
  cop = arr.copy()
  del cop[i]
  cop.sort()
  print(cop[-1])

### FIXED CODE ###

N = int(input())
arr = []
for i in range(N):
  arr.append(int(input()))
max_inds = []
max_v = arr[0]
for i in range(N):
  if arr[i] > max_v:
    max_v = arr[i]
for i in range(N):
  if arr[i] == max_v:
    max_inds.append(i)
for i in range(N):
  if len(max_inds) >= 2:
    print(max_v)
  else:
    if i == max_inds[0]:
      cop = arr.copy()
      del cop[i]
      print(max(cop))
    else:
      print(max_v)
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
print("{}".format(max(max(a+b, a-b), a*b))

### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
# スペース区切りの整数の入力
a, b = map(int, input().split())
# 文字列の入力
# s = input()
# 出力
print("{}".format(max(max(a+b, a-b), a*b)))
n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = set(map(int, input().split()))

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    return res

for i in range(q):
    if solve(0, mi):
        print("yes")
    else:
        print("no")

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
q = int(input())
mi = map(int, input().split())
t = {}

def solve(i, m):
    if (m == 0):
        return True
    if (i >= n):
        return False
    if (i,m) in t:
        return t[(i,m)]
    res = solve(i + 1, m) or solve(i + 1, m - A[i])
    t[(i,m)] = res
    return res

for m in mi:
    if solve(0, m):
        print("yes")
    else:
        print("no")
def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5
g1 = [1]*(N+1) # 元テーブル
g2 = [1]*(N+1) #逆元テーブル
inverse = [1]*(N+1) #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1[i]=( ( g1[i-1] * i ) % mod )
    inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2[i]=( (g2[i-1] * inverse[i]) % mod )
inverse[0]=0

N,M=map(int,input().split())
A=[0]+list(map(int,input().split()))
start=time.time()
dp=[[0 for i in range(2**N)] for j in range(M+1)]

dp[0][0]=g1[2**N-1]

for i in range(1,M+1):
    for j in range(2**N):
        dp[i][j]=dp[i-1][j]
        for k in range(N):
            if j>>k &1==0 and 2**N-A[i]-j>=2**k-1:
                dp[i][j]=(dp[i][j]+((-1)*((g1[2**N-A[i]-j]*g2[2**N-A[i]+1-(j+2**k)])%mod)*((dp[i-1][j+2**k]+g1[2**N-1-j-2**k])*2**k)%mod)%mod)%mod

#for i in range(M+1):
    #print(dp[i])
print((dp[M][0]*pow(2,N,mod))%mod)


### FIXED CODE ###

def cmb(n, r, mod):#コンビネーションの高速計算　
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5
g1 = [1]*(N+1) # 元テーブル
g2 = [1]*(N+1) #逆元テーブル
inverse = [1]*(N+1) #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1[i]=( ( g1[i-1] * i ) % mod )
    inverse[i]=( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2[i]=( (g2[i-1] * inverse[i]) % mod )
inverse[0]=0

N,M=map(int,input().split())
A=[0]+list(map(int,input().split()))
dp=[[0 for i in range(2**N)] for j in range(M+1)]

dp[0][0]=g1[2**N-1]

for i in range(1,M+1):
    for j in range(2**N):
        dp[i][j]=dp[i-1][j]
        for k in range(N):
            if j>>k &1==0 and 2**N-A[i]-j>=2**k-1:
                dp[i][j]=(dp[i][j]+((-1)*((g1[2**N-A[i]-j]*g2[2**N-A[i]+1-(j+2**k)])%mod)*((dp[i-1][j+2**k]+g1[2**N-1-j-2**k])*2**k)%mod)%mod)%mod

#for i in range(M+1):
    #print(dp[i])
print((dp[M][0]*pow(2,N,mod))%mod)
length = int(input())
targ = [int(n) for n in input().split(' ')]
ans = 0
for l in range(length):
    value = l
    for init in range(l + 1,length):
        if targ[value] > targ[init]:
            value = init
    if value != l:
        disp = targ[l]
        targ[l] = targ[value]
        targ[value] = disp
        ans += 1
print(' '.join([str(n) for n in targ]))
print(ans)''

### FIXED CODE ###

length = int(input())
targ = [int(n) for n in input().split(' ')]
ans = 0
for l in range(length):
    value = l
    for init in range(l + 1,length):
        if targ[value] > targ[init]:
            value = init
    if value != l:
        disp = targ[l]
        targ[l] = targ[value]
        targ[value] = disp
        ans += 1
print(' '.join([str(n) for n in targ]))
print(ans)
N,M=map(int,input().split())
a=[]
b=0 in range(N)
for i in range(M):
    a.append(int(input()))
j=M-1
if j>=0 and a[0]==1:
    f1=0
    f2=1
elif j>=0 and a[0]==2:
    f1=1
    f2=1
else:
    f1=1
    f2=2
def f(n,a,j):
    if n>2:
        if j==-1 or ((n-1)!=a[j] and (n-2)!=a[j]):
            return f(n-1,a,j)+f(n-2,a,j)
        if j>0 and a[j]==a[j-1]+1:
            return 0
        if j+1<M and a[j+1]==a[j]+1:
            return 0
        elif (n-1)==a[j]:
            return f(n-2,a,j-1)
        elif (n-2)==a[j]:
            return f(n-1,a,j)
    elif n==1:
        return f1
    else:
        return f2
print(f(N,a,j))

### FIXED CODE ###

N,M=map(int,input().split())
a=[]
b=[0]*N
for i in range(M):
    a.append(int(input()))
if M==0:
    j=-1
else:
    j=0
if N==1:
    b[0]=1
elif M>0 and a[0]==1:
    b[0]=0
    b[1]=1
elif M>0 and a[0]==2:
    b[0]=1
    b[1]=1
else:
    b[0]=1
    b[1]=2
for i in range(N-2):
    if j==M-1 or (j>=0 and (i+2)!=a[j] and (i+1)!=a[j]):
        b[i+2]=b[i+1]+b[i]
    if j>0 and a[j]==a[j-1]+1:
        b[N-1]=0
    if j+1<M and a[j+1]==a[j]+1:
        b[N-1]=0
    elif j>=0 and (i+2)==a[j]:
        b[i+2]=b[i]
    elif j>=0 and j+1<M and (i+1)==a[j]:
        j+=1
        b[i+2]=b[i+1]
    elif j>=0 and (i+1)==a[j]:
        b[i+2]=b[i+1]
print(b[N-1]%1000000007)
N = int(input())
count = 0
N +=1
for i in range(1, N):
    if len(str(i)) % 2 != 0:
        count += 1
print(count)

### FIXED CODE ###

a, b, c = map(int, input().split())
x = (a - b - c) * -1
if x < 0:
    print(0)
else:
    print(x)
import itertools as it
N, M, X = map(int,input().split())
book = [[int(_) for _ in input().split()] for i in range(N)]

combs = it.product([0,1], repeat=N)
prices = []
for comb in combs:
    # print(comb)
    bag = [0]*M
    for i in range(N):
        if comb[i] == 0:
            continue
        else:
            for j in range(M):
                bag[j] += book[i][j]
    
    if min(bag[1:]) < X:
        continue
    else:
        prices.append(bag[0])

if len(prices) == 0:
    print(-1)
else:
    print(min(prices))


### FIXED CODE ###

import itertools as it

N, M, X = map(int, input().split())
book = [[int(_) for _ in input().split()] for i in range(N)]

combs = it.product([0, 1], repeat=N)
prices = []
for comb in combs:
    # print(comb)
    bag = [0] * (M+1)
    for i in range(N):
        if comb[i] == 0:
            continue
        else:
            for j in range(M+1):
                bag[j] += book[i][j]

    if min(bag[1:]) < X:
        continue
    else:
        prices.append(bag[0])

if len(prices) == 0:
    print(-1)
else:
    print(min(prices))
N = int(input(())

if N % 2 == 1:
    print(N/2 + 1)
else:
    print(N/2)


### FIXED CODE ###

N = int(input())

if N % 2 == 1:
    print(int(N/2 +1))
else:
    print(int(N/2))
from collections import deque
import sys
sys.setrecursionlimit(10 ** 9)
import numpy as np

h, w = map(int, input().split())
maze = [[-1 for i in range(w)] for j in range(h)]

ans = 0
for i in range(h):
    maze[i] = list( map(int, input().split()))


queue = deque()

ansN = 0
ans = []

for i in range(h):
    for j in range(w):
        if maze[i][j] % 2 != 0:
            if j+1 < w:
                maze[i][j] -= 1
                maze[i][j+1] += 1
                ansN+=1
                ans.append([i, j, i, j+1])


            elif i+1 < h:
                maze[i][j] -= 1
                maze[i+1][j] += 1
                ansN+=1
                ans.append([i, j, i+1, j])

print(ansN)

for i in range(ansN):
    print(*ans[i], sep =' ')


### FIXED CODE ###


from collections import deque
import sys
sys.setrecursionlimit(10 ** 9)

h, w = map(int, input().split())
maze = [[-1 for i in range(w)] for j in range(h)]

ans = 0
for i in range(h):
    maze[i] = list( map(int, input().split()))


queue = deque()

ansN = 0
ans = []

for i in range(h):
    for j in range(w):
        if maze[i][j] % 2 != 0:
            if j+1 < w:
                maze[i][j] -= 1
                maze[i][j+1] += 1
                ansN+=1
                ans.append([i+1, j+1, i+1, j+2])

            elif i+1 < h:
                maze[i][j] -= 1
                maze[i+1][j] += 1
                ansN+=1
                ans.append([i+1, j+1, i+2, j+1])

print(ansN)

for i in range(ansN):
    print(*ans[i], sep =' ')
A, B = map(int, input().split())
S = list(map(str, input().split(-)))
ans = "No"
if A == len(S[0]):
    if B == len(S[1]):
        ans = "Yes"
print(ans)


### FIXED CODE ###

A, B = map(int, input().split())
S = list(map(str, input().split("-")))
ans = "No"
if A == len(S[0]):
    if B == len(S[1]):
        ans = "Yes"
print(ans)
v = 0
read(v)
print(v ** 3)

### FIXED CODE ###

x=eval(input())
print(x**3)
A = int(input()) # num of 500 coins
B = int(input()) # num of 100 coins
C = int(input()) # num of  50 coins
X = int(input()) # amount of payment

ans = 0

Bmax = B * 100
Cmax = C * 50

for a in range(A+1):
    rest = X - 500 * a
    if rest < 0:
        break
    if rest > Bmax + Cmax:
        continue
    if rest = 0:
        ans += 1
        continue
    else: # 0 < rest <= Bmax + Cmax
        for b in range(B+1):
            rest = rest - 100 * b
            if rest < 0:
                break
            if rest > Cmax:
                continue
            else:
                ans += 1

print(ans)


### FIXED CODE ###

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

a = int(input()) # 500
b = int(input()) # 100
c = int(input()) # 50
x = int(input())

ans = 0

for i in range(a + 1):
    for j in range(b + 1):
        for k in range(c + 1):
            if 500 * i + 100 * j + 50 * k == x:
                ans += 1

print(ans)
import fractions
def myAnswer(N:int,A:list) -> int:
   A.sort()
   target = A.pop(0)
   for a in A:
      if(fractions.gcd(A[0],A[1])==1):
         return 1
   return target

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()

### FIXED CODE ###

import fractions
def myAnswer(N:int,A:list) -> int:
   A.sort()
   pre = A.pop(0)
   ans = 10**10
   for a in A:
      ans = min(fractions.gcd(pre,a),ans)
      pre = a
   return ans

def modelAnswer():
   return
def main():
   N = int(input())
   A = list(map(int,input().split()))
   print(myAnswer(N,A[:]))
if __name__ == '__main__':
   main()
n = int(raw_input())
q = []
bottom = 0
for i in range(n):
    cmd = raw_input()
    if cmd[0] == 'i':
        q.append(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.pop(~q[::-1].index(cmd[7:]))
        except:
            pass
    elif cmd[6] == 'F':
        q.pop()
    else:
        bottom += 1

print(' '.join(q[bottom:][::-1]))

### FIXED CODE ###

import sys
from collections import deque

n = int(sys.stdin.readline())
q = deque()
for i in range(n):
    cmd = sys.stdin.readline()[:-1]
    if cmd[0] == 'i':
        q.appendleft(cmd[7:])
    elif cmd[6] == ' ':
        try:
            q.remove(cmd[7:])
        except:
            pass
    elif cmd[6] == 'F':
        q.popleft()
    else:
        q.pop()

print(' '.join(q))
import sys
num = [int(i) for i in input().split()]
a = [[int(c) for c in l.strip()] for l in sys.stdin]
r = 0
ans = 0
for i in range(num[0]-1):
  for j in range(num[1]):
    d = (a[i][j]**2 + a[i+1][j]**2)
    r += d
  if int(r**0.5) == r**0.5:
    ans += 1
  r = 0

for j in range(num[1]):
  d = (a[num[0]-1][j]**2 + a[0][j]**2)
  r += d
if int(r**0.5) == r**0.5:
  ans += 1
print(ans)
               

### FIXED CODE ###

n, d = map(int, input().split())
x = []
r = 0
ans = 0
for i in range(n):
  x.append(list(map(int, input().split())))

for i in range(n-1):
  for k in range(1, n-i):
    for j in range(d):
      r_temp = (x[i][j] - x[i+k][j])**2 
      r += r_temp
    r = r**0.5
    if int(r) == r:
      ans += 1
    r = 0
    
print(ans)
n,m=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
num=[0,2,5,5,4,5,6,3,7,6]
canmake=dict()
b=[]
for i in a:
    b.append(num[i])
    if num[i] not in canmake.keys():
        canmake[num[i]]=i
b.sort()
c=[]
d=[]
amari=n%b[0]
longest=n//b[0]
if amari==0:print(str(b[0])*(n//b[0]))
#何ケタ減らすと丁度になるか求める
for i in range(1,len(b)):
    count=0
    now=amari
    while True:
        count+=1
        now+=b[0]
        if count>b[i]:break
        if now%b[i]==0:
            c.append(count-now//b[i])
            d.append((count,now//b[i],b[i]))
            break
res=min(c)
ans=[]
for i in range(c.count(res)):
    an=dict()
    idx=c.index(res)
    an[b[0]]=longest-d[idx][0]
    an[d[idx][2]]=d[idx][1]
    ans.append(an)
    c[idx]=-1

result=0
for i in ans:
    x=[]
    for i in an.keys():
        x.append((canmake[i],an[i]))
    x.sort(key=lambda y:y[0])
    re=''
    for i in range(len(x)):
        y=x.pop()
        re+=str(y[0])*y[1]
    ima=int(re)
    if ima>result:result=ima
        
if amari!=0:print(result)

### FIXED CODE ###

a,b=map(int,input().split())
if b%a==0:print(a+b)
else:print(b-a)
A,B,N=map(int,input().split())
if N>=B-1:
  print(int(A*(B-1)/B)-A*int((B-1)/B))
else:
  print(int(A*N/B))-A*int(N/B)

### FIXED CODE ###

A,B,N=map(int,input().split())
if N>=B-1:
  print(int(A*(B-1)/B)-A*int((B-1)/B))
else:
  print(int(A*N/B)-A*int(N/B))
s = str(input())
t = str(input())

T = t[：-1]

if s == T:
	print("Yes")
else:
  	print("No")

### FIXED CODE ###

s = str(input())
t = str(input())

if s == t[:-1]:
	print("Yes")
else:
  	print("No")
s = input()
t = input()

s_len =len(s)
t_len =len(t)
count = 0



for i in range(s_len - t_len):
    for j in range(t_len):
        if s[i:t_len][j] != t[j]
            count += 1
    print(count)

### FIXED CODE ###

s = input()
t = input()

s_len =len(s)
t_len =len(t)
count = 0
ans = []



for i in range(s_len - t_len + 1):
    for j in range(t_len):
        if s[i:t_len + i][j] != t[j]:
            count += 1
    ans.append(count)
    count = 0

min_ans = min(ans)
print(min_ans)
# 2019/09/28
from fractions import gcd

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


# 約数列挙

def divisors(n):
    div=[]
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            if i!=2 and i%2:
                div.append(i)
                if i!=n//i and n//i%2:
                    div.append(n//i)
    # div.sort()
    return div

diva=divisors(a)
divb=divisors(b)
div=set()
for aa,bb in zip(diva,divb):
    if aa in divb:
        div.add(aa)
    if bb in diva:
        div.add(bb)

# エラトステネスの篩
def sieve(n):
    end=int(pow(n,0.5))+1
    is_prime=[True]*(n+1) 
    is_prime[0]=False
    is_prime[1]=False

    for i in range(2,end):
        if not is_prime[i]:continue
        for j in range(i*2,n+1,i):
        #for j in range(i*(i|0),n+1,i):
            is_prime[j]=False
    return [i for i in range(n+1) if is_prime[i]]

prime=sieve(max(div))

cnt=1
res=[]
for e in div:
    if e in prime:
        res.append(e)


cnt+=len(res)
for i in div:
    if i==1:continue
    for j in res:
        if j==1:continue
        if i==j:continue
        if i in res and j in res:continue
        if gcd(i,j)==1:continue
        else:break
        cnt+=1
print(cnt)

### FIXED CODE ###

# 2019/09/30

from fractions import gcd

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

g=gcd(a,b)


def trial_div(n):
    from collections import Counter
    
    prime=Counter()

    for i in range(2,int(pow(n,0.5)+2)):
        while n%i==0:
            n//=i
            prime[i]+=1
    if n>1:prime[n]+=1
    
    return prime


res=trial_div(g)
print(1+len(res))