Harryxun/stf_run huggingface dataset:
A,B,C,D,E,F=map(int,input().split())
maxconc = 0.0
maxwater = 100*A
maxconc = 0

for i in range(F//(100*A)+1):
  for j in range((F-(100*A*i))//(100*B)+1):
    if i == 0 and j == 0:
      continue
    S =min(E*(A*i+B*j),F-100*(A*i+B*j))
    sugar=0
    for c in range(S//C+1):
      d = (S-c*C)//D
      sugar = max(sugar,c*C+d*D)
    conc = sugar / (sugar +100*(A*i+B*j))
    if conc > maxconc:
      maxconc = conc 
      maxwater = 100*(A*i+B*j)
      maxsugar = sugar
print('{0} {1}'.format(maxwater+maxsugar,maxsugar)) 

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split(' '))

max_sugar = 0
max_water = 100*A
max_conc = 0.0
A_limit = F // (100*A)
for i in range(A_limit + 1):
    B_limit = (F-100*A*i) // (100*B)
    for j in range(B_limit + 1):
        if i == 0 and j == 0:
            continue
        sugar_limit = min(E * (A*i+B*j), F-100*(A*i+B*j))

        sugar_ = 0
        for c in range(sugar_limit//C + 1):
            d = (sugar_limit-c*C)//D
            temp_sugar = c*C + d*D
            sugar_ = max(sugar_, temp_sugar)
        temp_conc = sugar_/(sugar_+100*(A*i+B*j))
        if temp_conc > max_conc:
            max_conc = temp_conc
            max_water = 100*(A*i + B*j)
            max_sugar = sugar_
print('{0} {1}'.format(max_water+max_sugar, max_sugar))
w,h,x,y = map(int,int.split())
flag = 0
if (x/W)==(y/W):
  flag = 1
print((w*h)/2,flag)


### FIXED CODE ###

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

a, b = map(int, input().split())
result = int(a*b / math.gcd(a, b))
print(result)


### FIXED CODE ###

from fractions import gcd
import sys
sys.setrecursionlimit(100000)

a, b = map(int, input().split())
gcd = gcd(a, b)
if gcd <= 0:
    print(0)
else:
    result = int(a*b / gcd)
    print(result)
vn=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort() ; B.sort() ; C.sort()
import bisect as bi

ans=0

for i in B:
    ans+= bi.bisect_left(A,i) * (n-bi.bisect_right(C,i))
print(ans)


### FIXED CODE ###

n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
A.sort() ; B.sort() ; C.sort()
import bisect as bi

ans=0

for i in B:
    ans+= bi.bisect_left(A,i) * (n-bi.bisect_right(C,i))
print(ans)
N,T=map(int,input())
res=2000
for i in N:
  c,t=map(int,input())
  if t>T:
    continue
  else:
    res=min(res,c)
if res=2000:
  print("TLE")
else:
  print(res)

### FIXED CODE ###

N,T=map(int,input().split())
res=2000
for i in range(N):
  c,t=map(int,input().split())
  if t>T:
    continue
  else:
    res=min(res,c)
if res==2000:
  print("TLE")
else:
  print(res)
a,b=map(int,input().split())
l=[]
k=0
c=0
for i in range(999):
    k+=i
    l.append(k)

for j in range(999):
   c=a+j
   if(c in l):
       d=l.index(c)
       if(l[d+1]-j==b):
           print(j)
       else:
           continue
   else:
       continue

### FIXED CODE ###

a,b=map(int,input().split())
l=[]
e=b-a
k=0
for i in range(1000):
    k+=i
    l.append(k)

for j in range(999):
   o=l[j+1]-l[j]
   if(o==e):
       print(l[j]-a)
   else:
       continue
# -*- coding: utf-8 -*-
S=input()
if S[0]==S[1] and S[2]==S[3] and S[0]!=S[2] :
  print("Yes")
elif S[0]==S[2] and S[1]==S[4] and S[0]!=S[1] :
  print("Yes")
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1] :
  print("Yes")
else:
  print("No")

### FIXED CODE ###

# -*- coding: utf-8 -*-
S=input()
if S[0]==S[1] and S[2]==S[3] and S[0]!=S[2] :
  print("Yes")
elif S[0]==S[2] and S[1]==S[3] and S[0]!=S[1] :
  print("Yes")
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1] :
  print("Yes")
else:
  print("No")
#!/usr/bin/env python3

s = int(input())



if s <= 2:
    print(0)
else:
    a = [0] * (s + 1)
    a[0] = 1
    for i in range(3, s + 1):
        a[i] = int((a[i - 1] + a[i - 3]) % (1e9 + 7))

print(a[s])

### FIXED CODE ###

#!/usr/bin/env python3

s = int(input())



if s <= 2:
    print(0)
else:
    a = [0] * (s + 1)
    a[0] = 1
    for i in range(3, s + 1):
        a[i] = int((a[i - 1] + a[i - 3]) % (1e9 + 7))

    print(a[s])
n=int(input())
x=[0]*n
y=[0]*n

for i in range(n):
    x[i],y[i]=map(int,input().split())
dis=[]
for i in range(n-1):
    for j in range(i+1,n):
        dis.append((x[j]-x[i],y[j]-y[i]))
        
from collections import Counter
c=Counter(dis).most_common()[0]
print(n-c[1])


### FIXED CODE ###

n=int(input())
if n==1:
    print(1)
    exit()
    
x=[0]*n
y=[0]*n

for i in range(n):
    x[i],y[i]=map(int,input().split())
dis=[]
for i in range(n):
    for j in range(n):
        if i==j:
            continue
        dis.append((x[j]-x[i],y[j]-y[i]))
        
from collections import Counter
c=Counter(dis).most_common()[0]
print(n-c[1])
import sys
from functools import reduce,lru_cache
from operator import mul

def main():
  sys.setrecursionlimit(10 ** 5)
  N,M = map(int,input().split())
  
  @lru_cache(maxsize = None)
  def recur(n):
    if n == 0:
      return 1
    else:
      m = n * recur(n - 1)
      return m
      
  if N == M:
    L = [i for i in range(1,N + 1)]
    #ans = (reduce(mul,L) ** 2) * 2  % (10 ** 9 + 7)
    ans = (recur(N) % (10 ** 9 + 7))
    print(ans)
  elif abs(M - N) == 1: 
    ans = 1
    ans *= (recur(N) % (10 ** 9 + 7)) 
    ans *= (recur(M) % (10 ** 9 + 7))
    print(ans)
    
  else:
    print(0)
    
main()

### FIXED CODE ###

import sys
from functools import reduce,lru_cache
import math
from operator import mul

def main():
  #sys.setrecursionlimit(10 ** 5 + 1)
  N,M = map(int,input().split())
  
  @lru_cache(maxsize = None)
  def recur(n):
    if n == 0:
      return 1
    else:
      m = n * recur(n - 1)
      return m
      
  if N == M:
    L = [i for i in range(1,N + 1)]
    #ans = (reduce(mul,L) ** 2) * 2  % (10 ** 9 + 7)
    ans = (math.factorial(M) ** 2) * 2 % ((10 ** 9) + 7)
    print(ans)
  elif abs(M - N) == 1: 
    ans = math.factorial(N) * math.factorial(M) % ((10 ** 9) + 7)
    print(ans)
    
  else:
    print(0)
    
main()
n = int(input())
B = list(map(int, input().split()))

cnt = B[0] + B[-1]

for i in range(0, n-2)
    cnt += min(B[i], B[i+1])

print(cnt)


### FIXED CODE ###

n = int(input())
B = list(map(int, input().split()))

cnt = B[0] + B[-1]

for i in range(0, n-2):
    if B[i] > B[i+1]:
        cnt += B[i+1]
    else:
        cnt += B[i]

print(cnt)
#!/usr/bin/env python

def main():
    N, A, B = list(map(int, input().strip().split()))
    if N * A < B:
        return N * A
    else:
        return B

 print(main())

### FIXED CODE ###

#!/usr/bin/env python

A, B, C = list(map(int, input().split()))

if A * B < C:
    print(A * B)
else:
    print(C)
N = int(input())
d = list(map(int,input().split()))
d.sort()
#print(d)
c = [0] * N 
i = 0
tmp = d[0]
count = 1

for j in range(1,N):
    if tmp == d[j]:
        #print("yes",j)
        count += 1
    else:
        #print("no",j)
        tmp = d[j]   
        c[i] = count
        count = 1
        i += 1
#print(c)

hantei = 0
for j in range(N):
    hantei += c[j]
    if len(d) / 2 == hantei:
        hantei1 = 1
        break
    elif len(d) / 2 < hantei:
        hantei1 = 0
        break

if hantei1 == 1:
    print(d[len(d)//2] - d[len(d)//2-1])
else:
    print(0)

### FIXED CODE ###

N = int(input())
d = list(map(int,input().split()))
d.sort()
#print(d)
c = [0] * N 
i = 0
tmp = d[0]
count = 1
 
for j in range(1,N):
    if tmp == d[j]:
        #print("yes",j)
        count += 1
    else:
        #print("no",j)
        tmp = d[j]   
        c[i] = count
        count = 1
        i += 1
#print(c)
 
hantei = 0
hantei1 = 0

for j in range(N):
    hantei += c[j]
    if len(d) / 2 == hantei:
        hantei1 = 1
        break
    elif len(d) / 2 < hantei:
        #hantei1 = 0
        break
 
if hantei1 == 1:
    print(d[len(d)//2] - d[len(d)//2-1])
else:
    print(0)
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
k = 0
for i in range(M):
    if M-k>A[0][1]:
        sumcost += A[0][0]*A[0][1]
        k -= A[0][1]
        A.pop(0)
    else:
        sumcost += A[0][0]*(M-k)
        break

print(sumcost)

### FIXED CODE ###

N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
A.sort()
sumcost = 0
for i in range(M):
    sumcost += A[0][0]
    A[0][1] -= 1
    if A[0][1] < 1:
        A.pop(0)

print(sumcost)
# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    temp=v[now]
                    if (now == 3):
                        # print(v)
                        break
            if (now == 3):
                ans += 1

print(ans)

### FIXED CODE ###

# 入力
N = int(input())
A = [int(x) for x in list(input())]
ans = 0

AA = [x for x in range(10)]

for i in AA:
    for j in AA:
        for k in AA:
            v = [i, j, k]
            now=0
            temp=v[now]
            for l in A:
                if (l ==temp):
                    now += 1
                    if (now == 3):
                        # print(v)
                        break
                    temp = v[now]
            if (now == 3):
                ans += 1

print(ans)
H,W=map(int,input().split())
S=[input() for i in range(H)]
ans="Yes"
for i in range(W):
    for j in range(H):
        Tonari=[]
        if i>0:
            Tonari.append(S[i-1][j])
        if i<W-1:
            Tonari.append(S[i+1][j])
        if j>0:
            Tonari.append(S[i][j-1])
        if j<H-1:
            Tonari.append(S[i][j+1])
        if S[i][j]=='#' and all([t=='.' for t in Tonari]):
            ans="No"
print(ans)

### FIXED CODE ###

H,W=map(int,input().split())
S=[input() for i in range(H)]
ans="Yes"
for i in range(H):
    for j in range(W):
        Tonari=[]
        if i>0:
            Tonari.append(S[i-1][j])
        if i<H-1:
            Tonari.append(S[i+1][j])
        if j>0:
            Tonari.append(S[i][j-1])
        if j<W-1:
            Tonari.append(S[i][j+1])
        if S[i][j]=='#' and all([t=='.' for t in Tonari]):
            ans="No"
print(ans)
int(input())
print(N*(N-1)/2)

### FIXED CODE ###

N = int(input())
if N == 1:
    print(0)
elif N == 2:
    print(1)
else:
    print((N * (N-1)) // 2)
N = int(input())
if  N == 7　or N == 5 or N == 3:
  print('YES')
else:
  print('NO')


### FIXED CODE ###

N = int(input())
if  N == 7 or N == 5 or N == 3:
	print('YES')
else:
  	print('NO')
a,b=list(map(int,input().split()))
if a<=8 and b<=8:
  print('Yay!')
esle :
  print(':(')

### FIXED CODE ###

a,b=list(map(int,input().split()))
if a<=8 and b<=8:
  print('Yay!')
else :
  print(':(')
import numpy as np
import fractions
n,m = map(int, input().split())
a = list(map(int, input().split()))
lcm = 1
for i in range(0,n):
  lcm = lcm * a[i] // fractions.gcd(lcm,a[i])

ans = m // lcm
if (ans+0.5) * lcm <= m:
  ans += 1
sum = 0
for i in range(0,n):
  if (lcm // a[i]) % 2 == 1:
    sum += 1   
if sum != n:
  ans = 0
print(ans)

### FIXED CODE ###

from fractions import gcd
n,m = map(int, input().split())
a = list(map(int, input().split()))
b = []
lcm = 1
for i in a:
    b.append(i//2)
for i in b:
  lcm = lcm // gcd(lcm,i) * i
ans = m // lcm
sum = 0
for i in b:
  if (lcm // i) % 2 == 1:
    sum += 1
if sum != len(a):
  print(0)
elif ans%2 ==1:
    print((ans+1)//2)
else:
    print(ans//2)
def sanjou(x):
 reeturn x * x * x

### FIXED CODE ###

x = input()
print x * x * x
import numpy as np


def resolve():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))

    A = [[]] * N
    for i in range(M):
        pp, ss = map(int, input().split())
        ss -= 1
        pp -= 1
        A[pp] = A[pp] + [ss]
        A[ss] = A[ss] + [pp]

    ans = 0
    H = np.array(H)
    for j in range(N):
        now = H[j]
        if not A[j]:
            ans += 1
            continue

        if (now > np.max(H[A[j]])):
            ans += 1

    print(ans)


resolve()

### FIXED CODE ###

def resolve():
    n, m = map(int, input().split())
    hhh = list(map(int, input().split()))
    nice = [1] * n

    for _ in range(m):
        a, b = map(int, input().split())
        a -= 1
        b -= 1
        ha = hhh[a]
        hb = hhh[b]
        if ha <= hb:
            nice[a] = False
        if ha >= hb:
            nice[b] = False

    print(sum(nice))


resolve()
r = int(input)

return r^2

### FIXED CODE ###

r = int(input())

print(r**2)
n=int(input())
a=list(int(input()) for i in range(n))
b=a.remove(max(a))
c=max(b)
if a.count(max(a))==1:
  for y in range(n):
  	if a[y]==max(a):
  		
  		print(c)
  	else:
  		print(max(a))
else:
  for i in range(n):
    print(max(a))

### FIXED CODE ###

##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

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

N = c- a - b

if N > 0 4 * a * b < N ** 2:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a, b, c = map(int, input().split())
 
N = c- a - b
 
if N > 0 and (4 * a * b) < N ** 2:
  print("Yes")
else:
  print("No")
import math
S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
        else:
            temp*=2
            L.append(temp)
    else:
        temp = 0
print(int(math.log2(max(L))+1))

### FIXED CODE ###

S = input()
s = len(S)
L = []
temp = 0
for i in range(s):
    if S[i]=='A' or S[i]=='T' or S[i]=='G' or S[i]=='C':
        if temp ==0:
            temp=1
            L.append(temp)
        else:
            temp*=10
            L.append(temp)
    else:
        temp = 0
L.append(-1)        
if len(L)==2 and L[0]==0:
    P=0
elif len(L)==1:
    P=0
else:
    P = len(str(max(L)))
print(P)
import itertools
import collections

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

count = collections.defaultdict(int)
for i in itertools.combinations(x_y, 2):
    count[(i[0][0]-i[1][0], i[0][1]-i[1][1])] += 1
    count[(i[1][0]-i[0][0], i[1][1]-i[0][1])] += 1

print(N-max(count.values()))

### FIXED CODE ###

import itertools
import collections

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

count = collections.defaultdict(int)
for i in itertools.combinations(x_y, 2):
    count[(i[0][0]-i[1][0], i[0][1]-i[1][1])] += 1
    count[(i[1][0]-i[0][0], i[1][1]-i[0][1])] += 1
if not count:
    print(N)
else:
    print(N-max(count.values()))
N=int(input())
E=[[] for _ in range(N-1)]
for i in range(N-1):
  a,b = map(int, input().split())
  E[a-1].append((b-1,i))
ans=[[] for _ in range(N-1)]
def sub(p, n):
  m=1
  for a,b in E[p]:
    if m == n: m+=1
    ans[b]=m
    sub(a,m)
    m+=1
sub(0,0)
print(max(ans))
for a in ans:
  print(a)

### FIXED CODE ###

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

N=int(input())
E=[[] for _ in range(N)]
for i in range(N-1):
  a,b = map(int, input().split())
  E[a-1].append((b-1,i))
ans=[[] for _ in range(N-1)]
def sub(p, n):
  m=1
  for b,i in E[p]:
    if m == n: m+=1
    ans[i]=m
    sub(b,m)
    m+=1
sub(0,0)
print(max(ans))
for a in ans:
  print(a)
S = list(input())
res = []
count = 0
for i in S:
  if i in ['A', 'T', 'G', 'C']:
    count += 1
  else:
    res.append(count)
    count = 0
print(max(res))

### FIXED CODE ###

S = list(input())
S.append('')
res = []
count = 0
for i in S:
  if i in ['A', 'T', 'G', 'C']:
    count += 1
  else:
    res.append(count)
    count = 0
print(max(res))
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,k = iim()
ans = []
for i in range(min(a,b)):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[k-1])

### FIXED CODE ###

def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,k = iim()
ans = []
for i in range(1,min(a,b)+1):
    if a%i == 0 and b%i == 0:
        ans.append(i)

print(ans[-k])
a,b,t=map(int,input().split())
print(((2t+1)//(2*a))*b)


### FIXED CODE ###

a,b,t=map(int,input().split())
print(t//a*b)
n,m = input().split();
a = input().split();

a_sum = sum(a);

rest_day = int(n) - a_sum

if rest_day < 0:
    rest_day = -1

return rest_day
    

### FIXED CODE ###

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

a_sum = sum(a);

if n - a_sum < 0:
    print(-1)
else:
    print(n-a_sum)
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
v = t-a
for i in range(n):
    h[i] = abs(v-h[i])
print(h.index(min(h))+1)

### FIXED CODE ###

x, y = map(int, input().split())
print(int(x+y/2))
from itertools import product 
n = int(input())
XY = [[] for _ in range(n)]
for i in range(n):
    for j in range(int(input())):
        x, y = map(int, input().split())
        XY[i].append([x-1, y])
honest = 0
for bit in range(1<<n):
    flag = True 
    for i in range(n):
        if bit & (1<<i) :
            for a, b in XY[i]:
                if bit & (1<<a) != b:
                    flag = False 
                    break
    if flag:
        hoenst = max(honest, bin(i)[2:].count('1'))
        print(ans)
print(ans)

### FIXED CODE ###

n = int(input())
evidences = [[] for _ in range(n)]
for i in range(n):
    A = int(input())
    for _ in range(A):
        x, y = map(int, input().split())
        evidences[i].append((x-1, y))
result = 0
for i in range(1, 2**n):
    consistent = True 
    for j in range(n):
        if (i>>j) & 1 == 0:
            continue 
        for x, y in evidences[j]:
            if (i>>x)&1 != y:
                consistent = False 
                break
        if not consistent:
            break
    if consistent:
        result = max(result, bin(i)[2:].count('1'))
print(result)
N=int(input())
G=[[] for i in range(N)]
res=[0]*N
def dfs(v,p,c):
  res[v]=c
  for nv,w in G[v]:
    if nv==p:
      continue
    if (w & 1):
      dfs(nv,v,1-c)
    else:
      dfs(nv,v,c)

for i in range(N-1):
  u,v,w=map(int,input().split())
  u-=1
  v-=1
  G[u].append((v,w))
  G[v].append((u,w))
dfs(0,-1,0)
for i in range(N):
  print(res[i])

### FIXED CODE ###

N=int(input())
G=[[] for i in range(N)]
for i in range(N-1):
    u,v,w=map(int,input().split())
    u,v=u-1,v-1
    G[u].append((v,w))
    G[v].append((u,w))
reached=[0]*N
stack=[0]
reached[0]=[1]
res=[-1]*N
res[0]=0
while(stack):
    v=stack.pop()
    for nv,w in G[v]:
        if reached[nv]:
            continue
        if w & 1:
            res[nv]=1-res[v]
        else:
            res[nv]=res[v]
        stack.append(nv)
        reached[nv]=1
for i in res:
    print(i)
n = int(input())
hn = list(map(int, input().split()[:n]))

count = 0
prev = 0

for h in hn:
    count += max(0, h-prev)
    prev = h

print(count)


### FIXED CODE ###

ab, bc, ca = map(int, input().split())
print(int(bc*ab/2))
n=int(input())
s=input()
a = [str(c) for c in s]
ans=0
r=0
g=0
b=0
er=0
for i in range(n):
    if a[i]=='R':
        r+=1
        ans=ans+g*b
    elif a[i]=='G':
        g+=1
        ans=ans+r*b
    else:
        b+=1
        ans=ans+g*r
for i in range(1,n+1//3):
    for j in range(i,n):
        k=j+i
        l=k+i
        if l<n:
            if a[l]!=a[j] and a[j]!=a[k] and a[k]!=a[l]:
                er+=1
print(ans-er)

### FIXED CODE ###

s=(input())
a = [int(c) for c in s]
if a[0]==7 or a[1]==7 or a[2]==7:
    print('Yes')
else:
    print('No')
xs = sorted(map(int, raw_input().split()))

if xs[0] != xs[1]:
    print(xs[0])
if xs[1] != xs[2]:
    print(xs[2])





### FIXED CODE ###

print(48 - int(input()))
n = input(int())

if n<=999:
    print('ABC')
else:
    print('ABD')

### FIXED CODE ###

n = int(input())

if n<=999:
    print('ABC')
else:
    print('ABD')
number_int = input()
list_int = list(map(int,input().split()))

print(sum(list_int)-number_int)


### FIXED CODE ###

number_int = input()
list_int = list(map(int,input().split()))

print(str(sum(list_int) - int(number_int)))
n=int(input())
if n==1:print("Hello World")exit()
else:print(int(input())+int(input()))

### FIXED CODE ###

n=int(input())
if n==1:print("Hello World")
else:print(int(input())+int(input()))
S = input("")

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRY":
    cmd = 5
elif S == "SAT":
    cmd = 6

if cmd == 0:
    print(7)
else:
    print(cmd)

### FIXED CODE ###

S = str(input())

if S == "SUN":
    cmd = 0
elif S == "MON":
    cmd = 1
elif S == "TUE":
    cmd = 2
elif S == "WED":
    cmd = 3
elif S == "THU":
    cmd = 4
elif S == "FRI":
    cmd = 5
elif S == "SAT":
    cmd = 6

print(7-cmd)
D = int(input())

if D==23:
    print "Christmas Eve Eve"

if D==24:
    print "Christmas Eve"

if D==23:
    print "Christmas "


### FIXED CODE ###

D = int(input())

if D==22:
    print ("Christmas Eve Eve Eve")

if D==23:
    print ("Christmas Eve Eve")

if D==24:
    print ("Christmas Eve")

if D==25:
    print ("Christmas ")
N = int(input())
A = []
for x in range(N):
  s, p = input().split()
  A.sppend([s, -int(p), x+1])
  
A.sort()

for i in range(N):
  print(A[i][2])
  


### FIXED CODE ###

N = int(input())
A = []
for x in range(N):
  s, p = input().split()
  A.append([s, -int(p), x+1])
  
A.sort()

for i in range(N):
  print(A[i][2])
import sys
input = sys.stdin.readline

def main():
  s = input()
  n = len(s)
  mod = 10**9+7
  dp = [[0]*13 for _ in range(n+1)]
  dp[0][0] = 1
  d = {(j, k):(10*j+k)%13 for k in range(10) for j in range(13)}
  for i in range(n):
    if s[i] != "?":
      t = int(s[i])
      for j in range(13):
        dp[i+1][d[(j, t)]] += dp[i][j]
        dp[i+1][d[(j, t)]] %= mod
    else:
      for k in range(10):
        for j in range(13):
          dp[i+1][d[(j, k)]] += dp[i][j]
          dp[i+1][d[(j, k)]] %= mod
  print(dp[n][5]%mod)

if __name__ == '__main__':
    main()

### FIXED CODE ###

s = input()
n = len(s)
mod = 10**9+7
dp = [[0]*13 for _ in range(n+1)]
dp[0][0] = 1
d = {(j, k):(10*j+k)%13 for k in range(10) for j in range(13)}
for i in range(n):
  if s[i] != "?":
    t = int(s[i])
    for j in range(13):
      dp[i+1][d[(j, t)]] += dp[i][j]
      dp[i+1][d[(j, t)]] %= mod
  else:
    for k in range(10):
      for j in range(13):
        dp[i+1][d[(j, k)]] += dp[i][j]
        dp[i+1][d[(j, k)]] %= mod
print(dp[n][5]%mod)