Harryxun/stf_run huggingface dataset:
import bisect
import sys

def input():
  return sys.stdin.readline()

weather = {0:"Sunny", 1:"Cloudy", 2:"Rainy"}
n = input()
           
for k, v in weather.items():
  if v == n:
    nk = k
    break

nk = (nk+1) % 3

print(weather[nk])

### FIXED CODE ###

n = input()
weather = {0:"Sunny", 1:"Cloudy", 2:"Rainy"}

           
for k, v in weather.items():
  if v == n:
    nk = k
    break

nk = (nk+1) % 3

print(weather[nk])
n=int(input())
a_list=[str(i)*3 for i in range(1,10)]
flag=False

for i in range(1,10):
  if int(a_list[i])==n:
    print(a_list[i])
    flag=True
    break
if flag==False:
  for i in range(1,9):
    if int(a_list[i])< n < int(a_list[i+1]):
      print(a_list[i+1])
      break

### FIXED CODE ###

n=int(input())
a_list=[str(i)*3 for i in range(1,10)]
flag=False

for i in range(0,9):
  if int(a_list[i])==n:
    print(a_list[i])
    flag=True
    break
  elif n < 111:
    print("111")
    break
if flag==False:
  for i in range(0,8):
    if int(a_list[i])< n < int(a_list[i+1]):
      print(a_list[i+1])
      break
S=str(input())
T=str(input())
ls=len(S)
lt=len(T)

ans=''
for i in range(ls-lt,-1,-1):
  flag=0
  for j in range(lt):
    if not (S[i+j] == T[j] or S[i+j] == '?'):
      flag=1
      break
  if flag==0:
    loc=i
    break

if flag==1:
  print('UNRESTORABLE')
else:
  i=0
  while i<ls:
    if i==loc:
      ans+=T
      i+=lt
    elif S[i]=='?':
      ans+='a'
      i+=1
    else:
      ans+=S[i]
      i+=1
  print(ans)


### FIXED CODE ###

S=str(input())
T=str(input())
ls=len(S)
lt=len(T)

ans=''
loc=None
for i in range(ls-lt,-1,-1):
  flag=0
  for j in range(lt):
    if not (S[i+j] == T[j] or S[i+j] == '?'):
      flag=1
      break
  if flag==0:
    loc=i
    break

if loc == None:
  print('UNRESTORABLE')
else:
  i=0
  while i<ls:
    if i==loc:
      ans += T
      i += lt
    elif S[i] == '?':
      ans += 'a'
      i += 1
    else:
      ans += S[i]
      i += 1
  print(ans)
N=int(input())
a=1
count=0
while a<N:
  b=1
  #print(a,b)
  for i in range(N//a+1):
    c=N-a*b
    if c>0:
      count+=1
      #print(a,b,c)
    b+=1
  a+=1
print(count)

### FIXED CODE ###

moji=input()
c=len(moji)
if moji[c-1]=="s":
  print(moji+"es")
else:
  print(moji+"s")
unko

### FIXED CODE ###

a = int(input())
print(a+a*a+a*a*a)
N=int(input())
H=list(map(int,input().split()))
if N==1:
    print('Yes')
else:
    for i in range(N-1,0,-1):
        if H[i-1]-H[i]==1:
        H[i-1]=H[i-1]-1
    elif H[i-1]-H[i]>=2:
        print('No')
        break
    elif i==1 and H[1]-H[0]>=0:
        print('Yes')

### FIXED CODE ###

N=int(input())
H=list(map(int,input().split()))
if N==1:
    print('Yes')
else:
    for i in range(N-1,0,-1):
        if H[i-1]-H[i]==1:
            H[i-1]=H[i-1]-1
        elif H[i-1]-H[i]>=2:
            print('No')
            break
        elif i==1 and H[1]-H[0]>=0:
            print('Yes')
x=int(input())
y=((2*x)**0.5)//1
y-=1
for i in range(y,y+x):
    if (i+1)*1//2>=x:
        print(i)
        exit()

### FIXED CODE ###

x=int(input())
y=int((x**0.5)//1)
for i in range(y,y+x):
    if (i+1)*i//2>=x:
        print(i)
        exit()
n = int(input())

def D(now,pre,SUM):
    dist[now] = SUM
    for BC in G[now]:
        if BC[0] == pre:
            continue
        D(BC[0],now,SUM+BC[1])



G = [[] for _ in range(n)]
for i in range(n-1):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append([b,c])
    G[b].append([a,c])
q,k = map(int,input().split())
# xから頂点kまでの最短経路を求めておいて、kからyまでの最短経路を求めておく
k -= 1
# ここで作っとく?
dist = [0] * n
D(k,-1,0)
for i in range(q):
    x,y = map(lambda x:int(x)-1, input().split())
    print(dist[x] + dist[y])


### FIXED CODE ###

n = int(input())
import sys
sys.setrecursionlimit(10**8)
def D(now,pre,SUM):
    dist[now] = SUM
    for BC in G[now]:
        if BC[0] == pre:
            continue
        D(BC[0],now,SUM+BC[1])



G = [[] for _ in range(n)]
for i in range(n-1):
    a,b,c = map(int,input().split())
    a -= 1
    b -= 1
    G[a].append((b,c))
    G[b].append((a,c))
q,k = map(int,input().split())
# xから頂点kまでの最短経路を求めておいて、kからyまでの最短経路を求めておく
k -= 1
# ここで作っとく?
dist = [0] * n
D(k,-1,0)
for i in range(q):
    x,y = map(lambda m:int(m)-1, input().split())
    print(dist[x] + dist[y])
def e_bullet(MOD=10**9 + 7):
    from math import gcd
    from collections import defaultdict
    N = int(input())

    zero_all = 0
    pair = defaultdict(int)
    for _ in range(N):
        a, b = [int(i) for i in input().split()]
        if a == 0 and b == 0:
            zero_all += 1
            continue

        # 既約分数にしておきたい
        if a != 0 and b != 0:
            g = gcd(a, b) * a // abs(a)
        elif a != 0:
            g = b
        else:
            g = a
        pair[(a // g, b // g)] += 1  # 既約分数 a/b とみなす

    done = set()
    total = 1
    for (a, b), v in list(pair.items()):
        if (b, -a) in done or (-b, a) in done:
            continue  # a/b に対応するものがあるかはすでに調べた
        done.add((a, b))

        # a/b に対応する b/(-a) か (-b)/a に注目する
        w = pair[(b, -a)] + pair[(-b, a)]
        # それらを選ぶと仲が悪いので、a/b となるものだけ選ぶか b/(-a) か (-b)/a
        # となるものだけ選ぶか、どちらか一方だけ選択したときに仲が悪くならない
        # これまでの選び方に対して仲が悪くならない選び方を決めるので、total は積を取る
        # ただし、両方とも 1 つも選ばないということはできないため、-1 する
        total *= pow(2, v, MOD) + pow(2, w, MOD) - 1
        total %= MOD

    ans = (total + zero_all - 1) % MOD
    return ans

print(e_bullet())

### FIXED CODE ###

def e_bullet(MOD=10**9 + 7):
    from math import gcd
    from collections import defaultdict
    N = int(input())

    zero_all = 0
    pair = defaultdict(int)
    for _ in range(N):
        a, b = [int(i) for i in input().split()]
        if a == 0 and b == 0:
            zero_all += 1
            continue

        # 既約分数にしておきたい
        if a != 0 and b != 0:
            g = gcd(a, b) * a // abs(a)
        elif a != 0:
            g = a
        else:
            g = b
        pair[(a // g, b // g)] += 1  # 既約分数 a/b とみなす

    done = set()
    total = 1
    for (a, b), v in list(pair.items()):
        if (b, -a) in done or (-b, a) in done:
            continue  # a/b に対応するものがあるかはすでに調べた
        done.add((a, b))

        # a/b に対応する b/(-a) か (-b)/a に注目する
        w = pair[(b, -a)] + pair[(-b, a)]
        # それらを選ぶと仲が悪いので、a/b となるものだけ選ぶか b/(-a) か (-b)/a
        # となるものだけ選ぶか、どちらか一方だけ選択したときに仲が悪くならない
        # これまでの選び方に対して仲が悪くならない選び方を決めるので、total は積を取る
        # ただし、両方とも 1 つも選ばないということはできないため、-1 する
        total *= pow(2, v, MOD) + pow(2, w, MOD) - 1
        total %= MOD

    ans = (total + zero_all - 1) % MOD
    return ans

print(e_bullet())
import sys
from collections import deque

s = sys.stdin.readline().strip()

# (元の文字列のindex, 文字）の配列
no_x = []
for i in range(len(s)):
    if s[i] == "x":
        continue
    no_x.append((i, s[i]))

len_no_x = len(no_x)
half = len_no_x // 2
for i in range(half):
    # x以外の文字が回文になっていないので不可能
    if no_x[i][1] != no_x[len_no_x - 1 - i][1]:
        print(-1)
        sys.exit()

# initから0まで走査し、元の文字列に左右対象になっていないxがある場合はxの挿入が必要
init = no_x[half][0]
# print("init", init)

ans = 0
l = 0
r = 0
# 元の文字列が偶数の場合、比較位置がずれる
if len_no_x % 2 == 0:
    l += 1

while init - l >= 0 or init + r < len(s):
    # print("left", init - l, "right", init + r)
    if init - l >= 0 and init + r < len(s):
        if s[init-l] == "x" and s[init+r] != "x":
            l += 1
            ans += 1
        elif s[init-l] != "x" and s[init+r] == "x":
            r += 1
            ans += 1
    elif init - l >= 0 and s[init-l] == "x":
        ans += 1
    elif init + r < len(s) and s[init+r] == "x":
        ans += 1
    l += 1
    r += 1

print(ans)

### FIXED CODE ###

import sys

s = sys.stdin.readline().strip()

ans = 0
l = 0
r = len(s) - 1

while l < r:
    # print("left", l, "right", r)
    if s[l] == "x" and s[r] == "x":
        l += 1
        r -= 1
    # rにxを足したとみなし、lを進める
    elif s[l] == "x":
        l += 1
        ans += 1
    # lにxを足したとみなし、rを進める
    elif s[r] == "x":
        r -= 1
        ans += 1
    elif s[l] != s[r]:
        print(-1)
        sys.exit()
    else:
        l += 1
        r -= 1

print(ans)
import  math
tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
    rep1,rep2=input().split()
    rep1=int(rep1)-1
    rep2=int(rep2)-1
    arr[rep1],arr[rep2] = arr[rep2],arr[rep1]

for k in range(tate):
    print(arr[k])


### FIXED CODE ###

tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
    rep1,rep2=input().split(",")
    rep1=int(rep1)-1
    rep2=int(rep2)-1
    arr[rep1],arr[rep2] = arr[rep2],arr[rep1]

for k in range(tate):
    print(arr[k])
a, b, c, d = int(input()).split()
 
if b > 0 && d > 0:
  print(b * d)
elif b < 0 && d > 0:
  print(b * c)
elif b > 0 && d < 0:
  print(a * d)
elif b <= 0 && d <= 0:
  print(a * c)
else:
  print(0)

### FIXED CODE ###

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

print(max(a*c,a*d,b*c,b*d))
import sys
input = sys.stdin.readline
from scipy.misc import comb



N,K = map(int, input().split())
lst_A = list(map(int, input().split()))
lst_A.sort()

fmax = 0
fmin = 0
for i in range(N):
	if(K-1<=N-1-i):
		fmin += lst_A[i] * comb(N-i-1, K-1)
	if(i>=K-1):
		fmax += lst_A[i] * comb(i,K-1)

print((fmax-fmin)% 1000000007)


### FIXED CODE ###

import sys
input = sys.stdin.readline

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

N,K = map(int, input().split())
lst_A = list(map(int, input().split()))
lst_A.sort()

p = 10 ** 9 + 7
fact = [1, 1]
factinv = [1, 1]
inv = [0, 1]
 
for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)


fmax = 0
fmin = 0
for i in range(N):
	if(K-1<=N-1-i):
		fmin += lst_A[i] * cmb(N-i-1, K-1,p)
	if(i>=K-1):
		fmax += lst_A[i] * cmb(i,K-1,p)

print((fmax-fmin)% p)
H, W = [int(s) for s in input().rstrip().split()]
sqare = [list('.' * (W+2)) for _ in range(H+2)]
for i in range(1, H+1):
    S = list(input().rstrip())
    sqare[i][1:H+1] = S

bomb = [[0 for _ in range(W+2)] for _ in range(H+2)]

for i in range(1, H+1):
    for j in range(1, W+1):
        if sqare[i][j] != '#':
            sqare[i][j] = 0
            for x in range(i-1, i+2):
                for y in range(j-1, j+2):                
                    if not(x == i and y == j) and sqare[x][y] == '#':
                        sqare[i][j] += 1

for i in range(1, H+1):
    for j in range(1, W+1):
        print(sqare[i][j], end='')
    print('')

### FIXED CODE ###

H, W = [int(s) for s in input().rstrip().split()]
S = [list(input().rstrip()) for _ in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        bomb = 0
        for x in range(i-1, i+2):
            for y in range(j-1, j+2):
                if 0 <= x < H and 0 <= y < W and S[x][y] == '#':
                    bomb += 1
        S[i][j] = str(bomb)

for s in S:
    print(''.join(s))
i = list(map(int, input().split()))
HH = i[0]
WW = i[1]
atai = HH*WW
#ans = int(atai/2) + (atai % 2)
amari=divmod(atai,2)
ans = int(atai/2) + amari[1]
print (ans)

### FIXED CODE ###

array=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = input()
ki=int(k)-1
print(array[ki])
# -*- coding: utf-8 -*-

import sys

def parse_input(lines_as_string = None):


    lines = []
    if lines_as_string is None:
        lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    tokens = lines[0].split(" ")
    s = tokens[0]

    return (s,)


def solve(s):
    
    acgt = set(["A", "C", "G", "T"])

    count = 0
    count_set = set()
    for i, c in enumerate(s):
        if c in acgt:
            count = count + 1
        else:
            count_set.add(count)
            count = 0

    return max(count_set)

def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()


### FIXED CODE ###

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

import sys

def parse_input(lines_as_string = None):


    lines = []
    if lines_as_string is None:
        lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]
 
    tokens = lines[0].split(" ")
    b = tokens[0]

    return (b,)


def solve(b):
    
    m = {
        "A": "T",
        "C": "G",
        "G": "C",
        "T": "A",
    }

    return m[b]

def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()
o=list(inpput())
e=list(input())+""
for x, y in zip(o,e):
  print(x+y, end="")

### FIXED CODE ###

x=list(input())
y=list(input())+['']
for a, b in zip(x, y):
  print(a+b, end='')
def root(x,d):
    if d[x]!=x:
        d[x]=root(x,d)
    return d[x]
def unite(x,y,h):
    x=root(x,h)
    y=root(y,h)
    if x!=y:
        h[x]=min(x,y)
        h[y]=h[x]
from collections import defaultdict
n,k,l=map(int,input().split())
a=[i for i in range(n+1)]
b=[i for i in range(n+1)]
for i in range(k):
    s,t=map(int,input().split())
    unite(s,t,a)
for i in range(l):
    s,t=map(int,input().split())
    unite(s,t,b)
d=defaultdict(int)
l=""
for i in range(1,n+1):
    d[(root(a[i],a),root(b[i],b))]+=1
for i in range(1,n+1):
    l+=str(d[(root(a[i],a),root(b[i],b))])+" "
print(l[:-1])

### FIXED CODE ###

def root(x,d):
    if d[x]!=x:
        d[x]=root(d[x],d)
    return d[x]
def unite(x,y,h):
    x=root(x,h)
    y=root(y,h)
    if x!=y:
        h[x]=min(x,y)
        h[y]=h[x]
from collections import defaultdict
n,k,l=map(int,input().split())
a=[i for i in range(n+1)]
b=[i for i in range(n+1)]
for i in range(k):
    s,t=map(int,input().split())
    unite(s,t,a)
for i in range(l):
    s,t=map(int,input().split())
    unite(s,t,b)
d=defaultdict(int)
l=""
for i in range(1,n+1):
    d[(root(a[i],a),root(b[i],b))]+=1
for i in range(1,n+1):
    l+=str(d[(root(a[i],a),root(b[i],b))])+" "
print(l[:-1])
from itertools import groupby
n=int(input())
h = list(map(int,input().split()))
p=[]
ans=[]
for i in range(n-1):
  if h[i] >= h[i+1]:
    p.append(1)
  else:
    p.append(0)
for key, value in groupby(p):
  ans.append(sum(value))
print(max(ans))

### FIXED CODE ###

from itertools import groupby
n=int(input())
h = list(map(int,input().split()))
p=[]
ans=[0]
for i in range(n-1):
  if h[i] >= h[i+1]:
    p.append(1)
  else:
    p.append(0)
for key, value in groupby(p):
  ans.append(sum(value))
print(max(ans))
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
visited = [[False]*w for _ in range(h)]
for y in range(h):
    for x in range(w):
        if s[y][x]=="#" and not visited[y][x]:
            visited[y][x]= True
            flag =False
            for dy,dx in ((1,0),(-1,0),(0,1),(0,-1)):
                ny,nx = y+dy,x+dx
                if 0<=ny<h and 0<=nx<w and s[ny][nx]=='#':
                    visited[ny][nx] = True
                    flag = True
                    
            if flag ==False:
                print('No')
                break
    if not flag:
        break
    

if flag:
    print('Yes')

### FIXED CODE ###

h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
visited = [[False]*w for _ in range(h)]
flag = True
for y in range(h):
    for x in range(w):
        if s[y][x]=='#':
            flag = False
            for dy,dx in ((1,0),(0,1),(-1,0),(0,-1)):
                ny,nx = y+dy,x+dx
                if 0<=ny<h and 0<=nx<w and s[ny][nx]=='#':
                    flag = True
                    break
        
        if not flag:
            break
    if not flag:
        break


if flag:
    print('Yes')
else:
    print('No')
i=0
while True:
    x=int(input())
    if x==0:
    break                                                                
    f"Case {i}:{x}"
    i=i+1



### FIXED CODE ###

i=0
while True:
    x=int(input()) 
    if(x==0):
        break 
    i=i+1
    print(f"Case {i}: {x}")
n=int(input())
m=list(map(int,input().split()))
k=10**6
p=[0]*k
m.sort()
for i in range(1,n):
    if m[i]==m[i-1]:
        p[m[i]]=1
res=0
for i in range(n):
    if p[m[i]]==0:
        res+=1
    
    for j in range(m[i]*2,k,m[i]):
        p[j]=1
print(res)
        
    
     
    

### FIXED CODE ###


n=int(input())
m=list(map(int,input().split()))
k=10**6+1
p=[0]*k
m.sort()
for i in range(1,n):
    if m[i]==m[i-1]:
        p[m[i]]=1
res=0
for i in range(n):
    if p[m[i]]==0:
        res+=1
    
    if i!=n-1 and m[i]!=m[i+1]:
        for j in range(m[i]*2,k,m[i]):
            p[j]=1
print(res)
print('Odd')if int(input())*int(input())%2==1else print('Even')

### FIXED CODE ###

a,b=map(int,input().split())
print('Odd')if a*b%2==1else print('Even')
import numpy as np

k, q = map(int, input().split())
d = np.array(input().split(), dtype=np.int)
for _ in range(q):
  n, x, m = map(int, input().split())
  quot = (n-1) // k
  rest = (n-1) % k
  dmod = d % m
  same = (k - dmod.count_nonzero()) * quot + rest - dmod[:rest].count_nonzero()
  a_last = x % m + dmod.sum() * quot + dmod[:rest].sum()
  beyond = a_last // m
  print(n - 1 - same - beyond)

### FIXED CODE ###

import numpy as np

k, q = map(int, input().split())
d = np.array(input().split(), dtype=np.int)
for _ in range(q):
  n, x, m = map(int, input().split())
  quot = (n-1) // k
  rest = (n-1) % k
  dmod = d % m
  same = (k - np.count_nonzero(dmod)) * quot + rest - np.count_nonzero(dmod[:rest])
  a_last = x % m + dmod.sum() * quot + dmod[:rest].sum()
  beyond = a_last // m
  print(n - 1 - same - beyond)
n=int(intput())
di={}
count=0
for i in range():
  s=str(sorted(input()))
  if s in di:
    di[s]+=1
    count+=di[s]
  else:
    di[s]=0
print(count)




### FIXED CODE ###

N=int(input())
dictionary={}
count=0
for i in range(N):
    s=tuple(sorted(input()))
    if s in dictionary:
        dictionary[s]+=1
        count+=dictionary[s]
    else:
        dictionary[s]=0
print(count)
k=int(input())
a, b=map(int, input().split())
for i in range(a, b+i):
  if i % k == 0:
    print("OK")
    break
else:
  print("NG")

### FIXED CODE ###

k = int(input())
a, b = map(int, input().split())
for i in range(a, b+1):
  if i % k == 0:
    print("OK")
    break
else:
  print("NG")
NK = input()
NK = N.split(" ")
N = int(NK[0])
K = int(NK[1])

h = []
for i in range(N):
  h.append(int(input()))
    
h.sort()
ans = h[-1] - h[0]

for i in range(N-K+1):
  ans = min(ans, h[i-K+1] - h[i])
print(ans)

### FIXED CODE ###

NK = input()
NK = NK.split(" ")
N = int(NK[0])
K = int(NK[1])


h = []
for i in range(N):
  h.append(int(input()))
  
  
h.sort()
ans = h[-1] - h[0]

for i in range(N-K+1):
  ans = min(ans, h[i+K-1] - h[i])
print(ans)
n=int(input())
l=[list(input())]
b=True
for i in range(n-1):
  w=list(input())
  if l[-1][-1]==w[0]:
    l.append(w)
  else:
    b=False
    break
if len(set(l))=n and b==True:
  print("Yes")
else:
  print("No")
  

  

### FIXED CODE ###

n=int(input())
b=True
l=[]
w=input()
l.append(w)
for i in range(n-1):
  w=input()
  if w in l or w[0]!=l[-1][-1]:
    b=False
    break
  else:
    l.append(w)
if b:
  print("Yes")
else:
  print("No")
S_cards=[]
H_cards=[]
C_cards=[]
D_cards=[]

for i in range(1,14):
    S_cards.append(i)
    H_cards.append(i)
    C_cards.append(i)
    D_cards.append(i)

now_cards=int(input())
for i in range(0,now_cards):
    kind_num=[]
    kind_num=input().split()
    if kind_num[0]=='S':
        S_cards.remove(int(kind_num[1])
    elif kind_num[0]=='H':
        H_cards.remove(int(kind_num[1])
    elif kind_num[0]=='C':
        C_cards.remove(int(kind_num[1])
    elif kind_num[0]=='D':
        D_cards.remove(int(kind_num[1])
for i in range(0,len(S_cards)):
    print('S',S_cards[i])
for i in range(0,len(H_cards)):
    print('H',H_cards[i])
for i in range(0,len(C_cards)):
    print('C',C_cards[i])
for i in range(0,len(D_cards)):
    print('D',D_cards[i])

### FIXED CODE ###

S=[i for i in range(1,14)]
H=[i for i in range(1,14)]
C=[i for i in range(1,14)]
D=[i for i in range(1,14)]
cards=int(input())
for i in range(0,cards):
    mark,rank=input().split()
    rank=int(rank)
    if mark=="S":
        S.remove(rank)
    elif mark=="H":
        H.remove(rank)
    elif mark=="C":
        C.remove(rank)
    elif mark=="D":
        D.remove(rank)
for i in S:
    print("S",i)
for i in H:
    print("H",i)
for i in C:
    print("C",i)
for i in D:
    print("D",i)
a = int(input())
b = int(input())
c = int(input())
x = int(input())

print(x)

roop1 = x // a
count = 0

for i in roop1:
    roop2 = (x - 500*i) // b
    for j in roop2:
        roop3 = (x - 500*i - 100*j) // c
        count = count + 1

print(count)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
x = int(input())

count = 0

for i in range(min(a,x//500)+1): #iは0,1,2...,x//500
    remains = x - 500 * i
    for j in range(min(b,remains//100)+1):
        Remains = remains - 100 * j
        for k in range(min(c,Remains//50)+1):
            fifty = Remains - 50 * k
            if fifty == 0:
                count = count + 1
            else: continue

print(count)
# スペース区切りの整数の入力
x, y= map(int, input().split())

lst = []

num = x

while num <= y:
    lst.append(num)
    num = 2*num

print(len(lst))

### FIXED CODE ###

# スペース区切りの整数の入力
a, b, c, d= map(int, input().split())

left = a + b
right = c + d

if left == right:
    print("Balanced")
elif left > right:
    print("Left")
else:
    print("Right")
a,b=map(int,input().spllit())
print("#"*(b+2))
for i in range(a):
  print("#"+input()+"#")
print("#"*(b+2))

### FIXED CODE ###

a,b=map(int,input().split())
print("#"*(b+2))
for i in range(a):
  print("#"+input()+"#")
print("#"*(b+2))
N, MOD = int(input()), 10 ** 9 + 7
memo = [{} for x in range(N + 1)]
def ok(sec4):
  for i in range(4):
    tem = sec4
    if i >= 1:
      tem[i - 1], tem[i] = tem[i], tem[i - 1]  
    if tem[:3] == "AGC" or tem[1:] == "AGC":
      return False
  return True
def dfs(cur, last3):
  if last3 in memo[cur]:
    return memo[cur][last3]
  if cur == N:
    return 1
  ret = 0
  for s in "AGCT":
    if ok(last3 + s):
      ret = ret + dfs(cur + 1, last3[1:] + s)
  memo[cur][last3] = ret
  return ret
print(dfs(0, "TTT") % MOD)

### FIXED CODE ###

N, MOD = int(input()), 10**9 + 7
memo = [{} for x in range(N + 1)]
def ok(last4):
  for i in range(4):
    t = list(last4)
    if i >= 1:
      t[i-1], t[i] = t[i], t[i-1]
    if ''.join(t).count('AGC') >= 1:
      return False
  return True

def dfs(cur, last3):
  if last3 in memo[cur]:
    return memo[cur][last3]
  if cur == N:
    return 1
  ret = 0
  for c in 'ACGT':
    if ok(last3 + c):
      ret = (ret + dfs(cur + 1, last3[1:] + c)) % MOD
  memo[cur][last3] = ret
  return ret

print(dfs(0, 'TTT'))
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
s = []

for i in h:
    s.append(abs(753-t+a*0.006))

print(s.index(min(s))+1)

### FIXED CODE ###

X,Y = map(int,input().split())
print(X+Y//2)
N,A,B=map(int,input().split())
ball=('b'*A+'a'*B)*N
print(ball[0:N].count('b'))

### FIXED CODE ###

N,A,B=map(int,input().split())
if N == (N//(A+B))*(A+B):
    print(N-(N//(A+B))*(B))
elif (N//(A+B))*(A+B)<N <= (N//(A+B))*(A+B)+A:
    print(N-(N//(A+B))*(B))
else:
    print((N//(A+B)+1)*(A))
n, m = map(int, input().split())

forbidden = []
for i in range(m):
  forbidden.append(int(input()))

ans = [1, 1]
if 1 in forbidden:
  ans[-1] = 0
for i in range(2,n+1):
  if i in forbbidden:
    ans.append(0)
  else:
    ans.append(ans[-1]+[ans[-2]])
  if ans[-1] == 0 and ans[-2] == 0:
    print(0)
  if i == n:
    print(ans[-1])

### FIXED CODE ###

n, m = map(int, input().split())
 
forbidden = []
for i in range(m):
  forbidden.append(int(input()))
forbidden = set(forbidden) 
ans = [0]*(n+1)
ans[0] = 1
if 1 not in forbidden:
  ans[1] = 1
for i in range(2,n+1):
  if i not in forbidden:
    ans[i] += ans[i - 1] + ans[i - 2]
    ans[i] %= 1000000007
print(ans[-1])
import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0
 
for i in range(100):
  elif CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)

### FIXED CODE ###

import collections
x, n= map(int, input().split())
P = list(map(int, input().split()))
 
PX = list(map(lambda p: p-x,P))
CPX = collections.Counter(PX)
ans = 0

for i in range(100):
  if CPX[-i] == 0:
    ans = x -i
    break
  elif CPX[i] == 0:
    ans = x +i
    break

print(ans)