Harryxun/stf_run huggingface dataset:
x = input().split(" ")
a = int(x[0])
b = int(x[1])
c = int(x[2])
d = int(x[3])

c_count = (b//c)-((a-1)//c)
d_count = (b//d)-((a-1)//d)

import math

cd = c*d // math.gcd(c,d)
cd_count = (b//cd) - ((a-1)//cd)

print((b+1-a)-c_count-d_count+cd_count)

### FIXED CODE ###

import fractions

x = input().split(" ")
a = int(x[0])
b = int(x[1])
c = int(x[2])
d = int(x[3])

c_count = (b//c)-((a-1)//c)
d_count = (b//d)-((a-1)//d)

cd = c*d // fractions.gcd(c,d)
cd_count = (b//cd) - ((a-1)//cd)
ans = (b+1-a)-c_count-d_count+cd_count

print(ans)
# /user/bin/python
# -*- coding: utf-8 -*-
import sys
 

class UnionFind():
  def __init__(self, size):
    self.par = [-1] * size

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

  def issame(self, x, y):
    if self.root(x) == self.root(y):
      return True
    else:
      return False
  
  def merge(self, x, y):
    if x == y:
      return False
    if self.par[x] > self.par[y]:
      x, y = y, x
    self.par[x] += self.par[y]
    self.par[y] = x
    return True

  def size(self, x):
    return -self.par[self.root(x)]


if __name__ == "__main__":
  n,m = map(int, sys.stdin.readline().rstrip().split())
  ab = [[0 for _ in range(2)] for _ in range(m)]
  for i in range(m):
    ab[m-i-1] = list(map(int, sys.stdin.readline().rstrip().split()))

  uf = UnionFind(n)
  ans = []
  cur = n * (n-1) // 2

  for a,b in ab:
    ans.append(cur)

    if uf.issame(a-1, b-1):
      continue

    sa, sb = [uf.size(a-1), uf.size(b-1)]
    cur -= sa * sb
    uf.merge(a-1,b-1)

  for i in ans[::-1]:
    print(i)






### FIXED CODE ###

# /user/bin/python
# -*- coding: utf-8 -*-
import sys
 

class UnionFind():
  def __init__(self, size):
    self.par = [-1] * size

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

  def issame(self, x, y):
    if self.root(x) == self.root(y):
      return True
    else:
      return False
  
  def merge(self, x, y):
    x, y = [self.root(x), self.root(y)]
    if x == y:
      return False
    if self.par[x] > self.par[y]:
      x, y = y, x
    self.par[x] += self.par[y]
    self.par[y] = x
    return True

  def size(self, x):
    return -self.par[self.root(x)]


if __name__ == "__main__":
  n,m = map(int, sys.stdin.readline().rstrip().split())
  A = [0] * m
  B = [0] * m
  for i in range(m):
    A[i], B[i] = list(map(int, sys.stdin.readline().rstrip().split()))

  uf = UnionFind(n)
  ans = []
  cur = n * (n-1) // 2

  for i in range(m):
    ans.append(cur)
    a, b = [A[m-i-1]-1, B[m-i-1]-1]

    if not uf.issame(a, b):
      sa = uf.size(a)
      sb = uf.size(b)
      cur -= sa * sb
      uf.merge(a, b)

  ans.reverse()
  for i in ans:
    print(i)
import numpy as np


n, m = [int(x) for x in input().split()]

costs = []
masks = []

for _ in range(m):
  costs.append(int(input().split()[0]))

  boxes = {int(x)-1 for x in input().split()}
  mask = ['1' if idx in boxes else '0' for idx in range(n)][::-1]
  mask = int(''.join(mask), 2)
  masks.append(mask)

  INF = int(10e8 + 1)
  #dp = np.full(1 << n, INF, dtype=int)
  dp = [INF] * (1 << n)
  dp[0] = 0

  for j in range(m):
    for i in range(1 << n):
      dp[i | masks[j]] = min(
        dp[i | masks[j]],
        dp[i] + costs[j]
      )

      res = dp[-1] if dp[-1] != INF else -1
      print(res)

### FIXED CODE ###

n, m = [int(x) for x in input().split()]

INF = int(10e8 + 1)
dp = [INF] * (1 << n)
dp[0] = 0

for j in range(m):
    cost = int(input().split()[0])

    boxes = [int(x)-1 for x in input().split()]
    mask = 0

    mask = sum(1 << box for box in boxes)
    
    for i in range(1 << n):
        if dp[i] + cost < dp[i | mask]:
            dp[i | mask] = dp[i] + cost

res = dp[-1] if dp[-1] != INF else -1
print(res)
A, B = map(int, input().split())

print(int(A * B))

### FIXED CODE ###

import math
from decimal import Decimal


A, B = input().split()

A = Decimal(A)
B = Decimal(B)

result = Decimal(A * B)

print(math.floor(result))
n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    print(min(ans))

### FIXED CODE ###

n= int(input())
spot = input().split()
ans = []
for i in spot:
    spot.append(int(spot[0]))
    del spot[0]
if n == 1:
    print(0)
else:
    if max(spot)==min(spot):
        ans.append(0)
    for s in range(min(spot),max(spot)):
        x = 0
        for t in spot:
            x += (s-t)**2
        ans.append(x)
if n != 1:
    ans.sort(reverse=False)
    print(ans[0])
a, b, c = map(int, input().split())
print(f'string value: { "bust" if a+b+c >= 22 else "win"}')

### FIXED CODE ###

array = map(int, input().split())
if sum(array) >= 22:
  print("bust")
else:
  print("win")
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N, M = map(int, input().split())
k = [[] for _ in range(N)]
flst = [list([0] * 2) for _ in range(M)]

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

d = [0] * M
def dfs(v):
    d[v] = 1
    for i in range(len(k[v])):
        if d[k[v][i]] == 0:
            dfs(k[v][i])
    return
ans = 0
for i in range(M):
    tmp1 = k[flst[i][0] - 1].index(flst[i][1] - 1)
    tmp2 = k[flst[i][1] - 1].index(flst[i][0] - 1)
    k[flst[i][0] - 1].pop(tmp1)
    k[flst[i][1] - 1].pop(tmp2)
    dfs(0)
    if sum(d) != N:
        ans += 1

    d = [0] * M
    k[flst[i][0] - 1].append(flst[i][1] - 1)
    k[flst[i][1] - 1].append(flst[i][0] - 1)

print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

N, M = map(int, input().split())
k = [[] for _ in range(N)]
flst = [list([0] * 2) for _ in range(M)]

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

d = [0] * N
def dfs(v):
    d[v] = 1
    for i in range(len(k[v])):
        if d[k[v][i]] == 0:
            dfs(k[v][i])
    return
ans = 0
for i in range(M):
    tmp1 = k[flst[i][0] - 1].index(flst[i][1] - 1)
    tmp2 = k[flst[i][1] - 1].index(flst[i][0] - 1)
    k[flst[i][0] - 1].pop(tmp1)
    k[flst[i][1] - 1].pop(tmp2)
    dfs(0)
    if sum(d) != N:
        ans += 1

    d = [0] * N
    k[flst[i][0] - 1].append(flst[i][1] - 1)
    k[flst[i][1] - 1].append(flst[i][0] - 1)

print(ans)
a = list(map(str,input().split()))
b = list(a)

if (a[0] == a[1] and a[1] == a[2]) or (a[1] == a[2] and a[2] == a[3]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = str(input())
b = list(a)

if (b[0] == b[1] and b[1] == b[2]) or (b[1] == b[2] and b[2] == b[3]):
  print("Yes")
else:
  print("No")
a = map(int, input().split())

if a[0] * b[1] % 2 == 0:
    print('Even')

else:
    print('Odd')

### FIXED CODE ###

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

if a[0] * a[1] % 2 == 0:
    print('Even')

else:
    print('Odd')
k,s=map(int,input().split())
u=min(k,s)
sum=0
for i in range(u+1):
    sum+=min(s-i,2k)+1
print(sum)


### FIXED CODE ###

k,s=map(int,input().split())
u=min(k,s)
sum=0
if s-2*k>=0:
    for i in range(s-2*k,u+1):
        if s-i<2*k:
            sum+=2*k-s+i+1
        else:
            sum+=1
    print(sum)
elif s-k>=0:
    for i in range(u+1):
        if s-i<k:
            sum+=s-i+1
        else:
            sum+=2*k-s+i+1
    print(sum)
else:
    for i in range(u+1):
        if s-i<2*k:
            sum+=s-i+1
        else:
            sum+=1
    print(sum)
n,m =map(int,input().split())
inf = 10**15

dist = [[inf for i in range(n)] for i in range(n)]
route = [[ [] for i in range(n)] for i in range(n)]
import copy

for i in range(m):
    ak,bk,ck = map(int,input().split())
    dist[ak-1][bk-1]  =ck
    dist[bk-1][ak-1]  =ck

for i in range(n):
    for k in range(n):
        route[i][k] = [i,k]
        route[k][i] = [k,i]

for a in range(n):
    for b in range(n):
        for c in range(n):
            if dist[b][a]+dist[a][c] < dist[b][c]:
                route[b][c] = copy.deepcopy(route[b][a]).extend(copy.deepcopy(route[a][c])[1:])
                dist[b][c] =  dist[b][a]+dist[a][c]
ans = 0
for i in range(n):
    for k in range(n):
        if route[i][k]:
            ans += 1

print(m-ans//2)


### FIXED CODE ###

n,M =map(int,input().split())
inf = 10**15

dist = [[inf for i in range(n)] for i in range(n)]
route = [[ [] for i in range(n)] for i in range(n)]
import copy

for i in range(M):
    ak,bk,ck = map(int,input().split())
    dist[ak-1][bk-1]  =ck
    dist[bk-1][ak-1]  =ck

for i in range(n):
    for k in range(n):
        route[i][k] = [i,k]
        route[k][i] = [k,i]


for a in range(n):
    for b in range(n):
        for c in range(n):
            #print(a,b,c)
            if dist[b][a]+dist[a][c] < dist[b][c]:
                route[b][c] = copy.deepcopy(route[b][a]) + (copy.deepcopy(route[a][c])[1:])
                dist[b][c] =  dist[b][a]+dist[a][c]


#for i in range(n):
    #print(route[i])

used = [[0 for i in range(n)] for i in range(n)]
for i in range(n):
    for k in range(n):
        for m in range(len(route[i][k])-1):
            used[route[i][k][m]][route[i][k][m+1]] = 1
            used[route[i][k][m+1]][route[i][k][m]] = 1
#for i in range(n):
    #print(used[i])

ans = 0
for i in range(n):
    for k in range(n):
        if used[i][k]:
            ans += 1

print(M-(ans//2))
import numpy as np

x1,y1,x2,y2 = [int(i) for i in input().split()]

vx = x2-x1
vy = y2-y1

vx2,vy2 = np.array([[0,-1],[1,0]])@np.array([vx,vy])

x3 = x2+vx2
y3 = y2+vy2

vx3,vy3 = np.array([[0,-1],[1,0]])@np.array([vx2,vy2])

x4 = x3+vx3
y4 = y3+vy3

print(x3,y3,x4,y4)

### FIXED CODE ###

x1, y1, x2, y2 = list(map(int, input().split()))

x = x2 - x1
y = y2 - y1

x3 = x2 - y
y3 = y2 + x

x4 = x1 - y
y4 = y1 + x

print(str(x3) + ' ' + str(y3) + ' ' + str(x4) + ' ' + str(y4))
N = int(input())
L = list(set(list(map(int, input().split()))))

count = 0
for i in range(N):
    for j in range(i+1, N):
        for k in range(j+1, N):
            if L[i] < L[j] + L[k]:
                if L[j] < L[i] + L[k]:
                    if L[k] < L[i] + L[j]:
                        count += 1

print(count)

### FIXED CODE ###

import sys
import bisect

N = int(sys.stdin.readline())
L = list(map(int, sys.stdin.readline().split()))
L = sorted(L)

count = 0
for a_i in range(N-1):
    for b_i in range(a_i+1, N):
        max_c = bisect.bisect_left(L, L[a_i]+L[b_i])
        if max_c > b_i:
            count += max_c - b_i - 1
        
print(count)
a=int(input())
b=float(input())
 
print((a*(b*100))//100)

### FIXED CODE ###

a, b = input().split()  # まず文字列で受け取ります
p = int(a) # aはそのままint型にします
q = int(b[0] + b[2] + b[3])  # b[0] + b[2] + b[3]を整数に変換すれば、bの100倍を正確に得られます

print(p * q // 100)  # 掛けて100で整数の割り算をすれば終わりです
a,b,c,d = map(int, input().split())

if a >= b && c >= d:
  print(a + c)
  
else:
  print(b + d)

### FIXED CODE ###

a,b,c,d = [int(input()) for i in range(4)]

print(min(a,b) + min(c,d))
A=list(map(int,input().split()))
B=[0 for i in range(N-1)]
for i in range(N-1):
  if A[i]<A[i+1]:
    B[i]=1
B=[0]+B
money=1000
tmp=0
up=[]
down=[]
for i in range(N-1):
  if B[i]==0 and B[i+1]==1:
    up.append(i)
  if B[i]==1 and B[i+1]==0:
    down.append(i)
   
if up:
  if down==[]:
    down.append(N-1)
  if down!=[] and down[-1]<up[-1]:
    down.append(N-1)

for i in range(len(up)):
  k=bisect.bisect_left(down,up[i])
  print(k)
  money+=(A[down[k]]-A[up[i]])*(money//A[up[i]])     
print(money)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
B=[0 for i in range(N-1)]
for i in range(N-1):
  if A[i]<A[i+1]:
    B[i]=1
B=[0]+B
money=1000
tmp=0
up=[]
down=[]
for i in range(N-1):
  if B[i]==0 and B[i+1]==1:
    up.append(i)
  if B[i]==1 and B[i+1]==0:
    down.append(i)
import bisect   
if up:
  if down==[]:
    down.append(N-1)
  if down!=[] and down[-1]<up[-1]:
    down.append(N-1)

for i in range(len(up)):
  k=bisect.bisect_left(down,up[i])
  money+=(A[down[k]]-A[up[i]])*(money//A[up[i]])     
print(money)
from itertools import accumulate
from collections import Counter
N,*A = map(int, open('0').read().split())
B = accumulate(A)
c = Counter(B)
ans = c[0]+sum(v*(v-1)//2 for v in c.values())
print(ans)

### FIXED CODE ###

from itertools import accumulate
from collections import Counter
N,*A = map(int, open(0).read().split())
B = accumulate(A)
c = Counter(B)
ans = c[0]+sum(v*(v-1)//2 for v in c.values())
print(ans)
n,k = map(int,input().split())
def Base_10_to_n(X, A):
    if (int(X/A)):
        return Base_10_to_n(int(X/A), A)+str(X%A)
    return str(X%A)
ans = Base_10_to_n(n,k)
print(len(ans))

### FIXED CODE ###

n,r = map(int,input().split())
if n >= 10:
    print(r)
else:
    print(r + (100 * (10 - n)))
n,x = map(int,input().split())
l = list(map(int,input().split()))
cur = ans = 0
while cur<=x and ans<=n:
    ans += 1
    cur += l[ans-1]
print(ans)


### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
cur = ans = 0
for i in range(n):
    cur += l[i]
    if cur<=x:
        ans += 1
print(ans+1)
a,b=map(int,input().split())
for i in (a,b,a+b):
  i%3==0:
    print("Possible")
    exit()
    
print("Impossible")


### FIXED CODE ###

a,b=map(int,input().split())
for i in (a,b,a+b):
  if i%3==0:
    print("Possible")
    exit()
    
print("Impossible")
sec = input()

for i in range(3):
    tmp = int(sec % 60)
    hms.append(tmp)
    input = int((sec-tmp)/60)

hms.reverse()

print(str(hms[0])+':'str(hms[1])+':'str(hms[2]))

### FIXED CODE ###

sec = int(input())

hms = [0]*3
for i in range(3):
    tmp = int(sec % 60)
    hms[i] = tmp
    sec = int((sec-tmp)/60)

hms.reverse()

print(str(hms[0])+':'+str(hms[1])+':'+str(hms[2]))
from math importsqrt
n, p = map(int, input().split())
r = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(x*x+y*y) <= p:
    r += 1
print(r)

### FIXED CODE ###

from math import sqrt
n, p = map(int, input().split())
r = 0
for i in range(n):
  x, y = map(int, input().split())
  if sqrt(x*x+y*y) <= p:
    r += 1
print(r)
s=input();ans=""
for i in range(len(s)):
    if s[i].islower():
        ans+=s[i].upper(),end=""
    else:
        ans+=s[i].lower(),end=""
print(ans)


### FIXED CODE ###

s=input();ans=""
for i in range(len(s)):
    if s[i].islower():
        ans+=s[i].upper()
    else:
        ans+=s[i].lower()
print(ans)
#周期m以下

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

used = [0]*(m+1)
used_list=[]
pre=x

flag0=False
s=-1;t=-1
for i in range(m+1):
    if pre==0:
        flag0=True
        break
    now=(pre*pre)%m
    if used[pre]:
        s=used[pre]
        break
    used[pre]=i
    used_list.append(pre)
    pre=now
    
l=len(used_list[s:])
ans=sum(used_list[:s])+sum(used_list[s:])*((n-s)//l)+sum(used_list[s:s+(n-s)%l])
if not flag0:
    print(ans)
else:
    print(sum(used_list))

### FIXED CODE ###

#周期m以下

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

used = [0]*(m+1)
used_list=[]
pre=x

flag0=False
s=-1;t=-1
for i in range(m+1):
    if pre==0:
        flag0=True
        break
    now=(pre*pre)%m
    if used[pre]:
        s=used[pre]
        break
    used[pre]=i
    used_list.append(pre)
    pre=now
    
l=len(used_list[s:])
try:
    ans=sum(used_list[:s])+sum(used_list[s:])*((n-s)//l)+sum(used_list[s:s+(n-s)%l])
    if not flag0:
        print(ans)
    else:
        print(sum(used_list))
except:
    print(sum(used_list))
n,q=[*map(int,input().split())]
s=input()
count=0
for _ in range(q):
    l,r=[*map(int,input().split())]
    for i in range(l,r):
        if s[i-1]=="A":
            if s[i]=="C":
               count+=1 
    print(count)
    count=0

### FIXED CODE ###

n,q=(map(int,input().split()))
s=input()
count=0
c=[0]*n
for i in range(1,n):
        if s[i-1]=='A':
            if s[i]=='C':
               count+=1
        c[i]=count
for _ in range(q):
    l,r=(map(int,input().split())) 
    print(c[r-1]-c[l-1])
import Queue

def s(m, v, q):
    if q.empty(): return -1
    k, i, j = q.get()
    if i == len(m) - 1 and j == len(m[i]) - 1: return k
    if i > 1 and m[i - 1][j] == '.' and (i - 1, j) not in v:
        q.put((k + 1, i - 1, j))
        v.add((i - 1, j))
    if i < len(m) - 1 and m[i + 1][j] == '.' and (i + 1, j) not in v:
        q.put((k + 1, i + 1, j))
        v.add((i + 1, j))
    if j > 1 and m[i][j - 1] == '.' and (i, j - 1) not in v:
        q.put((k + 1, i, j - 1))
        v.add((i, j - 1))
    if j < len(m[i]) - 1 and m[i][j + 1] == '.' and (i, j + 1) not in v:
        q.put((k + 1, i, j + 1))
        v.add((i, j + 1))
    return s(m, v, q)

h, w = map(int, raw_input().split())
m = [raw_input() for _ in range(h)]
q = Queue.PriorityQueue()
q.put((1, 0, 0))
v = set((0, 0))
c = s(m, v, q)
if c == -1: print -1
else:
    a = 0
    for row in m:
        a += row.count('#')
    print h * w - c - a


### FIXED CODE ###

import sys
import Queue

sys.setrecursionlimit(1000000)

def s(m, h, w, d, q):
    if q.empty(): return d[h - 1][w - 1]
    k, i, j = q.get()
    if i > 0 and m[i - 1][j] == '.' and k + 1 < d[i - 1][j]:
        d[i - 1][j] = k + 1
        q.put((k + 1, i - 1, j))
    if i < h - 1 and m[i + 1][j] == '.' and k + 1 < d[i + 1][j]:
        d[i + 1][j] = k + 1
        q.put((k + 1, i + 1, j))
    if j > 0 and m[i][j - 1] == '.' and k + 1 < d[i][j - 1]:
        d[i][j - 1] = k + 1
        q.put((k + 1, i, j - 1))
    if j < w - 1 and m[i][j + 1] == '.' and k + 1 < d[i][j + 1]:
        d[i][j + 1] = k + 1
        q.put((k + 1, i, j + 1))
    return s(m, h, w, d, q)

h, w = map(int, raw_input().split())
m = [raw_input()[:w] for _ in range(h)]
q = Queue.PriorityQueue()
d = [None] * h
for i in range(h):
    d[i] = [1000000] * w
d[0][0] = 1
for i in range(h):
    for j in range(w):
        if m[i][j] == '.':
            q.put((d[i][j], i, j))
c = s(m, h, w, d, q)
if c == 1000000: print -1
else:
    a = 0
    for row in m:
        a += row.count('#')
    print h * w - c - a
K,S=map(int,inpit().split())
conut=0
for x in range(K+1):
    for y in range(K+1):
        for z in range(K+1):
            if x+y+z=S:
                count+=1
print(count)
            

### FIXED CODE ###

K,S=map(int,input().split())
count=0
for x in range(K+1):
    for y in range(K+1):
        sumz=S-x-y
        if sumz>=0 and sumz<=K:    
            count+=1
print(count)
s,t=input(),input()
count=0
for i in range(3):
    if s[i]==t[i]:
        count+=1

print(count)

### FIXED CODE ###

a,s=int(input()),input()
if a>=3200:
    print(s)
else:
    print('red')
x = imput().split()
y = int(x[0])*int(x[1])
if y % 2:
  print("Odd")
else:
  print("Even")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
  print("Odd")
else:
  print("Even")
n, a* = map(int, open(0).read().split())
t = 0
for i in range(1, n-1):
  if sorted([i-1:i+2]).index(a[i]) == 1:
    t += 1
print(t)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
t = 0
for i in range(1, n-1):
  if sorted(a[i-1:i+2]).index(a[i]) == 1:
    t += 1
print(t)
import numpy as np
S = input()
  
dp = np.zeros((100005, 13), dtype=np.uint64)

dp[0][0] = 1

for i in range(n):
    if S[i] == '?':
        c = -1
    else:
        c = int(S[i])
    # print(c)
    
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i+1][(ki * 10 + j) %13] += dp[i][ki]
            
    for j in range(13):
        dp[i+1][j] %= MOD
        
    res = dp[n][5]
    
print(res)

### FIXED CODE ###

import sys
input = sys.stdin.readline
# import numpy as np

S = input().rstrip()

MOD = 10 ** 9 + 7
n = len(S)

# dp = np.zeros((100005, 13), dtype=np.uint64)

dp = [[0 for i in range(13)] for j in range(100005)]

dp[0][0] = 1

for i in range(n):
    if S[i] == '?':
        c = -1
    else:
        c = int(S[i])
    
    for j in range(10):
        if c != -1 and c != j:
            continue
        for ki in range(13):
            dp[i+1][(ki * 10 + j) %13] += dp[i][ki]
            
    for j in range(13):
        dp[i+1][j] %= MOD
        
        
    res = dp[n][5]
    
print(res)
N=int(input())
V=list(map(input().split()))

V_sorted=sorted(V)

now_value=(V_sorted[0]+V_sorted[1])/2
for i in range(2,N):
    now_value=(new_value+V_sorted[i])/2

print(now_value)


    

    


### FIXED CODE ###

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

V_sorted=sorted(V)

now_value=(V_sorted[0]+V_sorted[1])/2
for i in range(2,N):
    now_value=(now_value+V_sorted[i])/2

print(now_value)
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

def resolve():
    N, M = map(int, input().split())
    G = np.zeros((N + 1, N + 1), dtype=np.int64)

    for _ in range(M):
        x, y = map(int, input().split())
        G[x, y] += 1
        G[y, x] += 1
    csr = csr_matrix(G)
    dist, pred = dijkstra(csgraph=csr ,return_predecessors=True, directed=False)

    ans = pred[1,2:]
    impos = any(ans >=0)
    if impos:
        print("Yes")
        print(*ans, sep="\n")
    else:
        print("No")

if __name__ == "__main__":
    resolve()

### FIXED CODE ###


from collections import deque
def resolve():
    N, M = map(int, input().split())
    G = [[] for _ in range(N)]
    for _ in range(M):
        x, y = map(lambda x:int(x)-1, input().split())
        G[x].append(y)
        G[y].append(x)

    dist = [-1]*N
    ans = [0]*N
    q = deque()
    q.append(0)
    while q:
        fm = q.popleft()
        for to in G[fm]:
            if dist[to] != -1:
                continue
            dist[to] += 1
            ans[to] = fm
            q.append(to)

    print("Yes")
    for i in range(1, N):
        print(ans[i] + 1)
        
if __name__ == "__main__":
    resolve()
a,b,c = input().split()

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

import math

if ((math.sqrt(a/c**2) + math.sqrt(/c**2)) < 1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

if 4 * a * b < (c - a- b)**2 and c - a- b > 0:
    print("Yes")
else:
    print("No")
N, K = input().split()
N = int(N)
K = int(K)

middle = N % K
answer = middle
while True:
  if abs(answer-k) > N:
    answer = N
    break
  if abs(answer - K) < answer:
    answer = abs(answer-K)
  else:
    break
    
print(str(answer))

### FIXED CODE ###

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

middle = N % K
answer = middle
while True:
  if abs(answer-K) > N:
    answer = N
    break
  if abs(answer - K) < answer:
    answer = abs(answer-K)
  else:
    break
    
print(str(answer))
N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = [K for _ in range(N)]

for A in As:
    Score -= 1
    Score[A - 1] += 1

for ans in Score:
    if(ans > 0):
        print("Yes")
    
    else:
        print("No")


### FIXED CODE ###

N,K,Q = list(map(int , input().split()))
As = [int(input()) for _ in range(Q)]

#特典初期設定
Score = [0 for _ in range(N)]

for A in As:
    Score[A-1] +=1

for ans in Score:
    if(K + ans - Q > 0):
        print("Yes")
    
    else:
        print("No")
Q = int(input())

def solve(x,ans):
    X = str(x)
    if len(X) == 1:
        print(ans)
        return
    ret= 0
    for i in range(1,len(X)):
        n = int(X[i:]) * int(X[:i])
        ret = max(ans,n)
        
    #print(ret)
    return solve(ret,ans + 1)

for i in range(Q):
    solve(int(input()),0)



### FIXED CODE ###

Q = int(input())

def solve(x,ans):
    #X = str(x)
#    print(x,ans)
    if len(x) == 1:
        print(ans)
        return
    ret= 0
    for i in range(1,len(x)):
        n = int(x[i:]) * int(x[:i])
        ret = max(ret , n)
        
    #print(ret)
    return solve(str(ret),ans + 1)

for i in range(Q):
    solve(input(),0)
from collections import Counter
int = int(input())
word = [input() for i in range(int)]
s = Counter(word)
u = a.most_common()
u.sort()
for j in range(len(u)):
    print(u[j])


### FIXED CODE ###

from collections import Counter
int = int(input())
word = [input() for i in range(int)]
s = Counter(word).most_common()
u = s[0][1]
v = []
for i, j in s:
  if j == u:
    v.append(i)
v.sort()
print(*v)