Harryxun/stf_run huggingface dataset:
import functools

import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def Yesif(cond):
    print('Yes' if cond else 'No')


def YESIF(cond):
    print('YES' if cond else 'NO')


def yesif(cond):
    print('yes' if cond else 'no')

a, b, c  =inpm()

print((a+b) /2* c)

### FIXED CODE ###

import functools

import os
import sys

sys.setrecursionlimit(10000)
INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def inpm(line):
    return [inp() for _ in range(line)]


def inpfm(line):
    return [inpf() for _ in range(line)]


def inpsm(line):
    return [inps() for _ in range(line)]


def inlm(line):
    return [inl() for _ in range(line)]


def inlfm(line):
    return [inlf() for _ in range(line)]


def inlsm(line):
    return [inls() for _ in range(line)]


def Yesif(cond):
    print('Yes' if cond else 'No')


def YESIF(cond):
    print('YES' if cond else 'NO')


def yesif(cond):
    print('yes' if cond else 'no')


a, b, c = inpm(3)

print(int((a + b) / 2 * c))
#! /usr/bin/python
# -*- coding: utf-8 -*-

MAX_Y = 8
MAX_X = 8

def main():
    # 入力
    N = int(raw_input())
    raw_input()

    for i , j in enumerate(range(N)):
        data = []
        for j in range(MAX_Y):
            input_list = map(int, raw_input())
            data.append(input_list)
        bomb_X = int(raw_input())
        bomb_Y = int(raw_input())
        raw_input()

        bomb_town = explosion(data, ((bomb_X-1, bomb_Y-1),))
        print("Data " + str(i+1) + ":")
        printBomb(bomb_town)

def printBomb(bomb):
    for x in bomb:
        print(reduce(lambda x, y: x+y, (map(str, x))))

# 盤面内か判定
def isIn(x, y):
    return 0<=x<MAX_X and 0<=y<MAX_Y

# 爆弾を爆破
def explosion(data, bomb):
    for b in bomb:
        if data[b[1]][b[0]] == 1:
            new_bomb = bom(data, b)
            burned_data = burned(data, b)
            data = explosion(burned_data, new_bomb)

    return data

# 燃やす
def burned(data, b):
    data[b[1]][b[0]] = 0
    return data

# 燃焼範囲をチェック
def bom(data, b):
    bom_area =  [(-3, 0), (-2, 0), (-1, 0), (1, 0), (2, 0), (3, 0),
                (0, -3), (0, -2), (0, -1), (0, 1), (0, 2), (0, 3)]
    new_bomb = []
    for x in bom_area:
        bomb = tuple([sum(x) for x in zip(x,b)])
        if isIn(*bomb):
            new_bomb.append(bomb)

    return new_bomb

if __name__=='__main__':
    main()

### FIXED CODE ###

#! /usr/bin/python
# -*- coding: utf-8 -*-

MAX_Y = 8
MAX_X = 8

def main():
    # 入力
    N = int(raw_input())

    for i , j in enumerate(range(N)):
        raw_input()

        data = []
        for j in range(MAX_Y):
            input_list = map(int, raw_input())
            data.append(input_list)
        bomb_X = int(raw_input())
        bomb_Y = int(raw_input())

        bomb_town = explosion(data, ((bomb_X-1, bomb_Y-1),))
        print("Data " + str(i+1) + ":")
        printBomb(bomb_town)

def printBomb(bomb):
    for x in bomb:
        print(reduce(lambda x, y: x+y, (map(str, x))))

# 盤面内か判定
def isIn(x, y):
    return 0<=x<MAX_X and 0<=y<MAX_Y

# 爆弾を爆破
def explosion(data, bomb):
    for b in bomb:
        if data[b[1]][b[0]] == 1:
            new_bomb = bom(data, b)
            burned_data = burned(data, b)
            data = explosion(burned_data, new_bomb)

    return data

# 燃やす
def burned(data, b):
    data[b[1]][b[0]] = 0
    return data

# 燃焼範囲をチェック
def bom(data, b):
    bomb_area =  [(-3, 0), (-2, 0), (-1, 0), (1, 0), (2, 0), (3, 0),
                (0, -3), (0, -2), (0, -1), (0, 1), (0, 2), (0, 3)]
    new_bomb = []
    for x in bomb_area:
        buf = tuple([sum(x) for x in zip(x,b)])
        if isIn(*buf):
            new_bomb.append(buf)

    return new_bomb

if __name__=='__main__':
    main()
# -*- coding:utf-8 -*-
import itertools

def main():
    """RE"""
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    low = 0
    high = 10**9+1
    for x in xs:
        if x < X:
            low = max(x, low)
            continue
        if x > X:
            high = min(x, high)
            continue

    Ds = []
    if low != 0: Ds.append(X - low)
    if high != 10**9+1: Ds.append(high - X)
    for d in Ds:
        failed = False
        for x in xs:
            if abs(X-x)%d == 0:
                continue
            else:
                failed = True
                break
        if failed:
            continue
        else:
            print(d)
            exit()
    print(1)


def main2():
    """RE"""
    def gcd(*numbers):
        return reduce(math.gcd, numbers)

    import math
    from functools import reduce
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    diffs = []
    for x in xs:
        diffs.append(abs(x-X))
    print(gcd(*diffs))

def main3():
    """RE"""
    def gcd(*numbers):
        return reduce(math.gcd, numbers)

    import math
    from functools import reduce
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    if len(xs) == 1:
        print(abs(xs[0] - X))
        exit()

    xs.append(X)
    xs.sort()
    diffs = []
    for i in range(len(xs)-1):
        diffs.append(xs[i+1] - xs[i])
    print(gcd(*diffs))

def main4():
    import math
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    diffs = []
    for x in xs:
        diffs.append(abs(X-x))

    if len(diffs) == 1:
        print(diffs[0])
        exit()

    ans = 10**9+1
    for i in range(len(diffs)-1):
        ans = min(math.gcd(diffs[i], diffs[i+1]), ans)
    print(ans)

if __name__ == "__main__":
    main4()


### FIXED CODE ###

def main4():
    import fractions
    N, X = list(map(int, input().split()))
    xs = list(map(int, input().split()))

    diffs = []
    for x in xs:
        diffs.append(abs(X-x))

    if len(diffs) == 1:
        print(diffs[0])
        exit()

    ans = 10**9+1
    for i in range(len(diffs)-1):
        ans = min(fractions.gcd(diffs[i], diffs[i+1]), ans)
    print(ans)

if __name__ == "__main__":
    main4()
# -*- coding: utf-8 -*-
n = int(input())
vv = list(map(int, input().split()))
d1 = {}
d2 = {}

for i in range(n):
    v = vv[i]
    if i%2==0:
        if v not in d2:
            d2[v] = 0
        d2[v] += 1
    else:
        if v not in d1:
            d1[v] = 0
        d1[v] += 1

dl1 = sorted(list(d1.keys()), reverse=True, key=lambda k:d1[k])
dl2 = sorted(list(d2.keys()), reverse=True, key=lambda k:d2[k])
i1 = 0
i2 = 0

if len(dl1)==1 and len(dl2)==1:
    if dl1[0]==dl2[0]:
        print(n//2)
    else:
        print(0)
    exit()
elif len(dl1)==1:
    print(sum(sorted(d2.values(), reverse=True)[1:]))
    exit()
elif len(dl2)==1:
    print(sum(sorted(d1.values(), reverse=True)[1:]))
    exit()


if dl1[0]!=dl2[0]:
    res = 0
    res += sum(sorted(d1.values(), reverse=True)[1:])
    res += sum(sorted(d2.values(), reverse=True)[1:])
    print(res)
else:
    if d1[dl1[0]]<d2[dl2[0]]:
        res = 0
        l = sorted(d1.values(), reverse=True)
        res += sum(l[0]+l[2:])
        res += sum(sorted(d2.values(), reverse=True)[1:])
        print(res)
    else:
        res = 0
        l = sorted(d2.values(), reverse=True)
        res += sum(l[0]+l[2:])
        res += sum(sorted(d1.values(), reverse=True)[1:])
        print(res)


### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
vv = list(map(int, input().split()))
d1 = {}
d2 = {}

for i in range(n):
    v = vv[i]
    if i%2==0:
        if v not in d2:
            d2[v] = 0
        d2[v] += 1
    else:
        if v not in d1:
            d1[v] = 0
        d1[v] += 1

dl1 = sorted(list(d1.keys()), reverse=True, key=lambda k:d1[k])
dl2 = sorted(list(d2.keys()), reverse=True, key=lambda k:d2[k])
i1 = 0
i2 = 0

if len(dl1)==1 and len(dl2)==1:
    if dl1[0]==dl2[0]:
        print(n//2)
    else:
        print(0)
    exit()
elif len(dl1)==1:
    print(sum(sorted(d2.values(), reverse=True)[1:]))
    exit()
elif len(dl2)==1:
    print(sum(sorted(d1.values(), reverse=True)[1:]))
    exit()


if dl1[0]!=dl2[0]:
    res = 0
    res += sum(sorted(d1.values(), reverse=True)[1:])
    res += sum(sorted(d2.values(), reverse=True)[1:])
    print(res)
else:
    res1 = 0
    l = sorted(d1.values(), reverse=True)
    res1 += l[0]
    if len(l)>2:
        res1 += sum(l[2:])
    res1 += sum(sorted(d2.values(), reverse=True)[1:])

    res2 = 0
    l = sorted(d2.values(), reverse=True)
    res2 += l[0]
    if len(l)>2:
        res2 += sum(l[2:])
    res2 += sum(sorted(d1.values(), reverse=True)[1:])
    print(min(res1,res2))
n=int(input())
print(int(360/math.gcd(n,360)))

### FIXED CODE ###

import math
n=int(input())
print(int(360/math.gcd(n,360)))
l = raw_input().split(' ')
string = l[0]
print(string)

### FIXED CODE ###

l = input().split()
if int(l[0])+int(l[1])==15:
    print('+')
elif int(l[0])*int(l[1]) ==15:
    print('*')
else:
    print('x')
N=int(input())
A = sorted([int(x) for x in input().split()])
B = sorted([int(x) for x in input().split()])
C = sorted([int(x) for x in input().split()])

happy=0
for i in range(0,N-1):
  happy+=B[A[i]]
  if A[i+1] == A[i] + 1:
    happy+=C[A[i]]
happy+=B[A[N-1]]
print(happy)

### FIXED CODE ###

N=int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
happy=0
for i in range(0,N-1):
  happy+=B[A[i]-1]
  if A[i+1] == A[i] + 1:
    happy+=C[A[i]-1]
happy+=B[A[N-1]-1]
print(happy)
import collections
n=int(input())
list=list(map(int,input().split()))
#print(list)
list_1=list[::2]
list_2=list[1::2]
#print(list_1)
#print(list_2)
a=collections.Counter(list_1)
b=collections.Counter(list_2)
#print(a.most_common()[0]==b.most_common()[0])
#print(len(list_1),a.most_common()[0][1])
if ((a.most_common()[0]==b.most_common()[0]) & a.most_common()[0][1]==len(list_1)):#２つの数列の各要素が一致する場合どちらかの数字を変更
  #print('test1')
  print(n//2)
elif(a.most_common()[0]==b.most_common()[0]):#2つの数列の最大をとる数が等しい場合どちらかは最大個数の数に、もう１つはその次に多い数に置き換える。
  #print('test2')
  print(n-a.most_common()[0][1]-b.most_common()[1][1])
  
else:
  #print(a)
  #print(b)
  #print(a.most_common())
  #print(b.most_common())
  #print(a.most_common()[0][1])
  #print(b.most_common()[0][1])

  print(n-a.most_common()[0][1]-b.most_common()[0][1])

### FIXED CODE ###

import collections
n=int(input())
list=list(map(int,input().split()))
#print(list)
list_1=list[::2]
list_2=list[1::2]
#print(list_1)
#print(list_2)
a=collections.Counter(list_1)
b=collections.Counter(list_2)
#print(a.most_common()[0]==b.most_common()[0])
#print(len(list_1),a.most_common()[0][1])
if((a.most_common()[0]==b.most_common()[0]) & (a.most_common()[0][1]!=len(list_1))):#2つの数列の最大をとる数が等しい場合どちらかは最大個数の数に、もう１つはその次に多い数に置き換える。
  #print('test2')
  if(n-a.most_common()[0][1]-b.most_common()[1][1]>n-a.most_common()[1][1]-b.most_common()[0][1]):
  	print(n-a.most_common()[1][1]-b.most_common()[0][1])
  else:
    print(n-a.most_common()[0][1]-b.most_common()[1][1])
elif ((a.most_common()==b.most_common()) & (a.most_common()[0][1]==len(list_1))):#２つの数列の全要素が一致する場合どちらかの数字を変更
  #print('test1')
  print(n//2)
else:
  #print(a)
  #print(b)
  #print(a.most_common())
  #print(b.most_common())
  #print(a.most_common()[0][1])
  #print(b.most_common()[0][1])

  print(n-a.most_common()[0][1]-b.most_common()[0][1])
n,c=map(int,input().split())
stc=[[int(i) for i in input().split()] for _ in range(n)]
dp=[0]*(2*10**5+2)
for s,t,c in stc:
  dp[2*s-1]+=1
  dp[2*t]-=1
for i in range(2*10**5):
  dp[i+1]+=dp[i]
print(max(dp))


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, a, b = LI()
    print(min(n*a,b))
    return

#B
def B():
    a = S()
    print(a.count("1"))
    return

#C
def C():
    n = II()
    a = list(str(n))
    if not n % sum(a):
        print("Yes")
    else:
        print("No")
    return

#D
def D():
    n = II()
    a = LI()
    ans = 0
    for a_ in a:
        while not a_ % 2:
            ans += 1
            a_ /= 2
    print(ans)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    A()
n =int(input())
a_n = set(map(int, inpt.split()))

if n==len(a_n):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

n =int(input())
a_n = set(map(int, input().split()))

if n==len(a_n):
    print("YES")
else:
    print("NO")
N = int(input())
P = list(map(int, input().split()))

L[N//2]-L[N//2-1]

### FIXED CODE ###

N = int(input())
P = sorted(list(map(int, input().split())))

print(P[N//2]-P[N//2-1])
r1, c1, r2, c2 = list(map(int, input().split()))

mod = 1_000_000_007

# return an integer k s.t. (a * k) % p = 1 and 0 <= k < p.
def inversion(a, p):
    b = p
    u, v = 1, 0
    while b >= 1:
        t = a // b
        a -= t * b
        a, b = b, a
        u -= t * v
        u, v = v, u
    u %= p
    if u < 0:
        u += p
    return u

# return nCr % p.
def combination(n, r, p):
    if n < r:
        return 0
    r = min(n - r, r)
    nCr = 1
    for d in range(1, r + 1):
        nCr *= n
        nCr %= p
        n -= 1
        nCr *= inversion(d, p)
        nCr %= p
    return nCr

answer = 0
answer += combination(r2 + c2 + 2, r2 + 1, mod)
answer -= combination(r2 + c1 + 1, r2 + 1, mod)
answer -= combination(r1 + c2 + 1, c2 + 1, mod)
answer += combination(r1 + c1    , c1    , mod)

answer %= mod

if answer < 0:
    answer += mod

print(answer)






### FIXED CODE ###

r1, c1, r2, c2 = list(map(int, input().split()))

mod = 1000000007

# return an integer k s.t. (a * k) % p = 1 and 0 <= k < p.
def inversion(a):
    b = mod
    u, v = 1, 0
    while b >= 1:
        t = a // b
        a -= t * b
        a, b = b, a
        u -= t * v
        u, v = v, u
    u %= mod
    if u < 0:
        u += mod
    return u

fact = [0 for i in range(2000003)]
for i in range(2000003):
    if i <= 1:
        fact[i] = 1
    else:
        fact[i] = (fact[i-1] * i) % mod

# return nCr % p.
def combination(n, r):
    return (((fact[n] * inversion(fact[r])) % mod) * inversion(fact[n-r])) % mod

answer = (
combination(r2 + c2 + 2, r2 + 1) -
combination(r2 + c1 + 1, r2 + 1) -
combination(r1 + c2 + 1, c2 + 1) +
combination(r1 + c1    , c1    ) )

answer %= mod

if answer < 0:
    answer += mod

print(answer)
import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N, K = MAP()
S = input()

def searchRL(S):
    ans = []
    for i in range(N-1):
        if S[i] == "R" and S[i+1] == "L":
            ans.append(i)
    return ans

def searchLR(S):
    ans = []
    for i in range(N-2,-1,-1):
        if S[i] == "L" and S[i+1] == "R":
            ans.append(i)
    return ans

def reverse(S):
    S = list(S)
    for i in range(len(S)):
        if S[i] == 'L':
            S[i] = 'R'
        if S[i] == 'R':
            S[i] = 'L'
    return ''.join(S)


def solve(S):
    RL = searchRL(S)
    LR = searchLR(S)
    if len(RL) == 0 and len(LR) == 0:
        return S, 0
    if len(RL) == 0:
        S = reverse(S[LR[0]::-1]) + S[LR[0]+1:]
        return S, 1
    if len(LR) == 0:
        S = reverse(S[RL[0]::-1]) + S[RL[0]+1:]
        return S, 1
    fir = min(LR[0], RL[0])
    sec = max(LR[0], RL[0])
    S = S[:fir+1] + reverse(S[sec:fir:-1]) + S[sec+1:]
    return S, 2

def cal(S):
    ans = 0
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            ans +=1
    return ans


ans = cal(S)
for i in range(K):
    S, res = solve(S)
    ans += res
    print(S)
print(ans)


### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N, K = MAP()
S = input()

def searchRL(S):
    ans = []
    for i in range(N-1):
        if S[i] == "R" and S[i+1] == "L":
            ans.append(i)
    return ans

def searchLR(S):
    ans = []
    for i in range(N-1):
        if S[i] == "L" and S[i+1] == "R":
            ans.append(i)
    return ans

def reverse(S):
    S = list(S)
    for i in range(len(S)):
        if S[i] == 'L':
            S[i] = 'R'
        if S[i] == 'R':
            S[i] = 'L'
    return ''.join(S)


def solve(S):
    if len(RL) == 0 and len(LR) == 0:
        return S, 0
    if len(RL) == 0:
        S = reverse(S[LR[0]::-1]) + S[LR[0]+1:]
        LR.pop(0)
        return S, 1
    if len(LR) == 0:
        S = reverse(S[RL[0]::-1]) + S[RL[0]+1:]
        RL.pop(0)
        return S, 1
    fir = min(LR[0], RL[0])
    sec = max(LR[0], RL[0])
    S = S[:fir+1] + reverse(S[sec:fir:-1]) + S[sec+1:]
    LR.pop(0)
    RL.pop(0)
    return S, 2

def cal(S):
    ans = 0
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            ans +=1
    return ans

RL = searchRL(S)
LR = searchLR(S)
ans = cal(S)
for i in range(K):
    S, res = solve(S)
    ans += res
print(ans)
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import deque
from collections import Counter
import bisect
def main():
    N = I()
    A = LI()
    B = LI()
    A_cnt = Counter(A)
    B_cnt = Counter(B)
    for key in B_cnt.keys():
        x = A_cnt[key]
        if B_cnt[key] > N - x:
            print('No')
            exit()
    print('Yes')
    A_m = A_cnt.most_common()
    A_ = []
    for a_m in A_m:
        A_ += [a_m[0]] * a_m[1]
    B_m = deque(B_cnt.most_common())
    ANS = []
    for i in range(N):
        x = B_m[0][0]
        if A_[i] != x:
            ANS.append((A_[i], x))
            B_cnt[x] -= 1
            if B_cnt[x] == 0:
                B_m.popleft()
        elif A_[i] == x:
            y = B_m[1][0]
            ANS.append((x, y))
            B_cnt[y] -= 1
            if B_cnt[y] == 0:
                B_m.popleft()
                B_m.popleft()
                B_m.appendleft((x, B_cnt[x]))
    ANS.sort(key=lambda tup: tup[0])
    ANS_ = []
    for ans in ANS:
        ANS_.append(ans[1])
    print(' '.join(map(str, ANS_)))

if __name__ == "__main__":
    main()


### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

from collections import deque
from collections import Counter
import bisect
def main():
    N = I()
    A = LI()
    B = LI()
    A_cnt = Counter(A)
    B_cnt = Counter(B)
    for key in B_cnt.keys():
        x = A_cnt[key]
        if B_cnt[key] > N - x:
            print('No')
            exit()
    print('Yes')
    A_m = A_cnt.most_common()
    A_ = []
    for a_m in A_m:
        A_ += [a_m[0]] * a_m[1]
    B_m = deque(B_cnt.most_common())
    ANS = []
    for i in range(N):
        x = B_m[0][0]
        if A_[i] != x:
            ANS.append([A_[i], x])
            B_cnt[x] -= 1
            if B_cnt[x] == 0:
                B_m.popleft()
        elif A_[i] == x:
            if len(B_m) != 1:
                B_m.popleft()
                B_m.append((x, B_cnt[x]))
                y = B_m[0][0]
                ANS.append([x, y])
                B_cnt[y] -= 1
                if B_cnt[y] == 0:
                    B_m.popleft()
            else:
                for ans in ANS:
                    if ans[0] != x and ans[1] != x:
                        ANS.append([x, ans[1]])
                        ans[1] = x
                        break

    ANS.sort(key=lambda tup: tup[0])
    ANS_ = []
    for ans in ANS:
        ANS_.append(ans[1])
    print(' '.join(map(str, ANS_)))

if __name__ == "__main__":
    main()
card = []
suit = ["S","H","C","D"]
for s in suit:
    for i in range(1,14):
        card.append(s + " " + str(i))

n = int(input())
for i in range(n)
    card.remove(input())

for c in card:
	print(c)

### FIXED CODE ###

card = []
suit = ["S","H","C","D"]
for s in suit:
    for i in range(1,14):
        card.append(s + " " + str(i))

n = int(input())
for i in range(n):
    card.remove(input())

for c in card:
	print(c)
from __future__ import division, print_function
from sys import stdin

i = 1
for line in stdin:
    x = int(line)
    if not x:
       break
    print "Case {}: {}".format(i, x)
    i += 1

### FIXED CODE ###

from __future__ import division, print_function
from sys import stdin

i = 1
for line in stdin:
    x = int(line)
    if x == 0:
       break
    print ("Case %d: %d" % (i, x))
    i += 1
print("Christmas"+[" Eve"for i in-int(input())%5])

### FIXED CODE ###

print("Christmas"+" Eve"*(25-int(input())))
N,K=map(int,input().split())
def f(n,k):
  if k<1: return 1
  if n<10:
    if k<2: return n
    return 0
  d,m=n//10,n%10
  return f(d,k-1)*m+f(d-1,k-1)*(9-m)+f(d,k)
print(f(N,K))

### FIXED CODE ###

N,K=int(input()),int(input())
def f(n,k):
  if k<1: return 1
  if n<10:
    if k<2: return n
    return 0
  d,m=n//10,n%10
  return f(d,k-1)*m+f(d-1,k-1)*(9-m)+f(d,k)
print(f(N,K))