Harryxun/stf_run huggingface dataset:
a,b,c,d=input()
count=0

if(a==b):
    count+=1
    if(c==d):
        count+=1
else if(a==c):
    count+=1
    if(b==d):
        count+=1
else if(a==d):
    count+=1
    if(b==c):
        count+=1

if(count==2):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a,b,c,d=input()
count=0

if(a==b):
    count+=1
    if(c==d and a!=c):
        count+=1
elif(a==c):
    count+=1
    if(b==d and a!=b):
        count+=1
elif(a==d):
    count+=1
    if(b==c and a!=b):
        count+=1

if(count==2):
    print("Yes")
else:
    print("No")
N,K = map(int,input().split())
a = list(map(int,input().split()))

d = 60
dp = [[-1]*N for _ in range(d+1)]
for i in range(n):
    dp[0][i] = a[i]-1

for i in range(d):
    for j in range(n):
        dp[i+1] = dp[i][dp[i][j]]

ans = 0

for i in range(d):
    if K & (1<<i):
        ans = dp[i][ans]

print(ans)




### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
visited=[]
o=(n+1)*[-1]
cycle,l=1,0
v=1
while o[v]==-1:
  o[v]=len(visited)
  visited.append(v)
  v=a[v-1]
cycle=len(visited)-o[v]
l=o[v]
if k<l:
  print(visited[k])
else:
  k-=l
  k%=cycle
  print(visited[l+k])
N=int(input())
permu = list(map(int,input().split()))
cnt=0
for index,num in enumerate(permu):
    if num <= min(permu[:index+1]):
        cnt+=1
    
    else:
        continue
print(cnt)        
    

### FIXED CODE ###

N,M =map(int,input().split())
if N > M:
    print("No")
else:
    print("Yes")
n,m = map(int, input().split())
sc= [map(int, input().split()) for _ in range(m)]
s, c = [list(i) for i in zip(*sc)]

ans = 10001


for l in range((10**(n-1)),10**n):
    ln = str(l)
    tmp = 0
    for j in range(m):
        if int(ln[int(s[j])-1]) == int(c[j]):
            tmp += 1
            # print(tmp)
            if tmp == m:
                ans = int(ln)

                break

        else:
            # print(tmp)
            break
    if ans != 10001:
        break
for i in range(m):
    tmp = 0
    if s[i] == 0:
        tmp += 1
        if tmp == m:
            ans = 0


if ans == 0:
    print(0)

elif ans == 10001:
    print(-1)
else:
    print(ans)


### FIXED CODE ###

# n,m = map(int, input().split())
# sc = [map(int, input().split()) for _ in range(m)]
# s, c = [list(i) for i in zip(*sc)]
#
#
#
# for i in range(10**n):
#     ans = str(i)
#     if len(i) == n and all([i[s[j]-1] == str(c[j]) for j in range(m)]):
#         print(ans)
#         exit()
#
#
# print(-1)

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

s, c = [], []
for _ in range(m):
    s_, c_ = map(int, input().split())
    s.append(s_)
    c.append(c_)

for i in range(10 ** n):
    ans = str(i)
    if len(ans) == n and all([ans[s[j] - 1] == str(c[j]) for j in range(m)]):
        print(ans)
        exit()

print(-1)
n = int(input())
s = input()
l = ['SS','WS','SW','WW']

for i in range(n):
  for j in range(len(l)):
    l[j] += 'SW'[::-1 if s[i]=='o' else 1][l[j][i]==l[j][i+1]]
for i in range(n):
  if l[i][1]==l[i][n+1] and l[i][0]==l[i][n]:
    print(l[i][1:n+1])
    exit()
print(-1)

### FIXED CODE ###

n = int(input())
s = input()
l = ['SS','WS','SW','WW']

for i in range(n):
  for j in range(len(l)):
    l[j] += 'SW'[::-1 if s[i]=='o' else 1][l[j][i]==l[j][i+1]]
for i in range(len(l)):
  if l[i][1]==l[i][n+1] and l[i][0]==l[i][n]:
    print(l[i][1:n+1])
    exit()
print(-1)
def main():
	n = int(input())
    data = list(map(int, input().split()))

    if n == 1:
        print(data[0])
    elif n == 2:
        print(data[1], data[0])
    else:
        firs_value = [data[0]]
        second_value = [data[1], data[0]]

        def get_value(index, data):
            if index == 0:
                return firs_value
            elif index == 1:
                return second_value
            else:
                lis = get_value(index - 2, data)
                lis.append(data[index - 1])
                lis.insert(0, data[index])
                return lis

        result = get_value(n - 1, data)
        print(" ".join(str(n) for n in result))
        
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    n = int(input())
    data = list(map(int, input().split()))

    if n == 1:
        print(data[0])
    else:
        result = [None] * n

        if n % 2 == 0:
            center = int(n / 2)
            for index, value in enumerate(data):
                if index % 2 == 0:
                    result[center + int(index / 2)] = value
                else:
                    result[center - int((index + 1) / 2)] = value
            print(" ".join(str(n) for n in result))
        else:
            center = int(n / 2)
            for index, value in enumerate(data):
                if index % 2 == 0:
                    result[center - int(index / 2)] = value
                else:
                    result[center + int((index + 1) / 2)] = value
            print(" ".join(str(n) for n in result))

if __name__ == '__main__':
    main()
import math
import sys

input = sys.stdin.readline


class AtCoder:
    def main(self):
        A, B = map(int, input().split())

        gcd = math.gcd(A, B)

        root_gcd = gcd ** 0.5
        p = 2
        prim_num = 1
        while p <= root_gcd or gcd > 1:
            tmp = gcd
            while True:
                if gcd % p == 0:
                    gcd /= p
                else:
                    break
            if tmp != gcd:
                prim_num += 1

            p += 1
        print(prim_num)


# Run main
if __name__ == '__main__':
    AtCoder().main()


### FIXED CODE ###

import sys

input = sys.stdin.readline


class AtCoder:

    def gcd(self, a, b):
        if b == 0:
            return a
        else:
            return self.gcd(b, a % b)

    def factorize(self, n):
        p = 2
        res = 1
        while p * p < n:
            if n % p == 0:
                res += 1
                while n % p == 0:
                    n /= p
            p += 1
        if n != 1:
            res += 1
        return res

    def main(self):
        A, B = map(int, input().split())

        _gcd = self.gcd(A, B)
        print(self.factorize(_gcd))


# Run main
if __name__ == '__main__':
    AtCoder().main()
import math

N = int(input())

rtn = int(math.sqrt(N))

used = [[0]*3]*N

count = [0] * N


if N <= 5:
    for x in range(N):
        print(count[x])
else:
    for n in range(6,N):
        #print(n)
        for x in range(1,rtn):
            #print(x)
            xx = x**2
            if xx <= n - 5:
                #print("xpath")
                for y in range(1,rtn):
                    #print(x,y)
                    xy = x*y
                    yy = y**2
                    ysum = xx+yy+xy
                    if ysum <= n-3:
                        #print("ypath")
                        for z in range(1,rtn):
                            #print(x,y,z)
                            zz = z**2
                            xz = x*z
                            yz = y*z
                            result = ysum+zz+xz+yz
                            if result > n:
                                break
                            if result == n:
                                count[n-1] += 1
                                #print("zpath")
                                used.append
    for x in range(N):
        print(count[x])


### FIXED CODE ###

L, R, d = [int(x) for x in input().split()]

count = 0

for x in range(L,R+1):
    if x % d == 0:
        count += 1

print(count)
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  g[a-1].append([b-1,i])
  g[b-1].append([a-1,i])
l=[0]*(n-1)
def dfs(v,p=-1,c=-1):
  k=1
  for u,e in g[v]:
    if u==p: continue
    if k==c: k+=1
    l[e]=k
    k+=1
    dfs(u,v,l[e])
dfs(0)
print(max(len(v) for v in g))
print('\n'.join(map(str,l)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
n=int(input())
g=[[] for _ in range(n)]
for i in range(n-1):
  a,b=map(int,sys.stdin.readline().split())
  g[a-1].append([b-1,i])
  g[b-1].append([a-1,i])
print(max(len(v) for v in g))
l=[0]*(n-1)
def dfs(v,p=-1,c=-1):
  k=1
  for u,e in g[v]:
    if u==p: continue
    if k==c: k+=1
    l[e]=k
    dfs(u,v,k)
    k+=1
dfs(0)
for c in l: print(c)
def getter(starts, ends):
    while starts:
        if starts[-1][0] < ends[-1][1]:
            yield (starts.pop(), True)
        else:
            yield (ends.pop(), False)


def foo(targets):
    starts = sorted(targets, key=lambda x:x[0], reverse=True)
    ends = sorted(targets, key=lambda x: x[1], reverse=True)

    result = 0
    active = set()
    for x, p in getter(starts, ends):
        if p:
            active.add(x[2])
        else:
            active.remove(x[2])
        result = max(result, len(active))
    return result


if __name__ == "__main__":
    n,c  = map(int, input().split())

    targets = []
    for i in range(n):
        s, t, c = list(map(int, input().split()))
        targets.append((s-1, t, c))
    print(foo(targets))



### FIXED CODE ###

def getter(starts, ends):
    while starts:
        if starts[-1][0] < ends[-1][1]:
            yield (starts.pop(), True)
        else:
            yield (ends.pop(), False)


def foo(C, targets):
    starts = sorted(targets, key=lambda x:x[0], reverse=True)
    ends = sorted(targets, key=lambda x: x[1], reverse=True)

    result = 0
    active = [0]*(C+1)
    for x, p in getter(starts, ends):
        if p:
            active[x[2]] += 1
        else:
            active[x[2]] -= 1
        result = max(result, sum(map(lambda x: 1 if x > 0 else 0 ,active)))
    return result


if __name__ == "__main__":
    n, C  = map(int, input().split())

    targets = []
    for i in range(n):
        s, t, c = list(map(int, input().split()))
        targets.append((s-1, t, c))
    print(foo(C, targets))
cnt = 0
for i in range(n):
    x, u = input().split()
    cnt += float(x) * (1 if u == 'JPY' else 380000)
print(cnt)

### FIXED CODE ###

n = int(input())
cnt = 0
for i in range(n):
    x, u = input().split()
    cnt += float(x) * (1 if u == 'JPY' else 380000)
print(cnt)
from math import log2
N, M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
B = max(max(Ai) for Ai in A)
if M == 1:
    if all(A[i][0] <= A[i+1][0] for i in range(N-1)):
        print("0")
    else:
        print("-1")
    exit(0)
logB = log2(B)
logBi = int(logB)
INF = 10**18
def gen(P, t):
    if t <= B:
        for k in range(t):
            for i in range(M-1):
                P[i+1] += P[i]
    else:
        for k in range(t):
            for i in range(logBi+1):
                P[i+1] += P[i]
        for i in range(logBi+1, M):
            P[i] = INF
T = [0]*N
ans = 0
P = [0]*M
for i in range(N-1):
    a0, a1 = A[i][:2]
    b0, b1 = A[i+1][:2]
    if a0 < b0:
        continue
    if a0 > b0:
        ans = -1
        break
    t0 = T[i]
    v = t0*a0 + a1 - b1
    if v % b0 > 0:
        T[i+1] = t1 = (v + b0-1) // b0
        ans += t1
        continue

    t1 = v // b0
    if t0 < t1:
        P[:] = A[i+1]
        gen(P, t1-t0)
        if P < A[i]:
            t1 += 1
    else:
        P[:] = A[i]
        gen(P, t0 - t1)
        if A[i+1] < P:
            t1 += 1
    T[i+1] = t1
    ans += t1
print(ans)

### FIXED CODE ###

import sys
readline = sys.stdin.readline
from math import log2
from itertools import accumulate
N, M = map(int, readline().split())
A = [list(map(int, readline().split())) for i in range(N)]
B = max(max(Ai) for Ai in A)
if M == 1:
    if N == 1 or all(A[i][0] < A[i+1][0] for i in range(N-1)):
        print("0")
    else:
        print("-1")
    exit(0)
logB = log2(B)
logBi = int(logB)
INF = 10**18
INFL = [INF]*(M - logBi-2)
def gen(P, t, L = min(logBi+2, M)):
    if t <= logB:
        for k in range(t):
            P[:] = accumulate(P)
    else:
        V = [1]*L
        for k in range(1, L):
            V[k] = V[k-1] * (t + k - 1)//k

        for i in range(L-1, 0, -1):
            P[i] += sum(P[j] * V[i-j] for j in range(i))
        if logBi+2 < M:
            P[logBi+2:] = INFL
T = [0]*N
ans = 0
P = [0]*M
for i in range(N-1):
    a0, a1 = A[i][:2]
    b0, b1 = A[i+1][:2]
    if a0 < b0:
        continue
    if a0 > b0:
        ans = -1
        break
    t0 = T[i]
    v = max(t0*a0 + a1 - b1, 0)
    if v % b0 > 0:
        T[i+1] = t1 = (v + b0-1) // b0
        ans += t1
        continue

    t1 = v // b0
    if t0 <= t1:
        P[:] = A[i+1]
        gen(P, t1 - t0)
        if P <= A[i]:
            t1 += 1
    else:
        P[:] = A[i]
        gen(P, t0 - t1)
        if A[i+1] <= P:
            t1 += 1
    T[i+1] = t1
    ans += t1
print(ans)
from sys import stdin

n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]

m = 0
count = 0
for i in range(n):
    if (i == n - 1) and (m < count):
        m = count
    else:
        if h[i] >= h[i + 1]:
            count += 1
        else:
            if m < count:
                m = count
            count = 0

print(m)


### FIXED CODE ###

from sys import stdin

n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]

m = 0
count = 0
for i in range(n):
    if i == n - 1:
        if m < count:
            m = count
    else:
        if h[i] >= h[i + 1]:
            count += 1
        else:
            if m < count:
                m = count
            count = 0

print(m)
a,b=map(int,input().split())
d=a//b
r=int(a%b)
f=a/b
print(d,r,f,sep(" "))

### FIXED CODE ###

a,b=map(int,input().split())
d=a//b
r=a%b
f=a/b
print("{0} {1} {2:.5f}".format(d,r,f))
a = list(map(int,input()))
b = a.count('5')
c = a.count('7')
if b == 2 and c ==1:
            print('YES')
else:
            print('NO')

### FIXED CODE ###

a = list(map(int,input().split()))
b = a.count(5)
c = a.count(7)
if b == 2 and c ==1:
            print('YES')
else:
            print('NO')
return "Yes"


### FIXED CODE ###

letters = list(input())
x = 1
for letter in letters:
        if letters.count(letter) == 2:
            x *= 1
        else:
            x *= 0
print(["No","Yes"][x])
import sys

def main():
  H,W,K = map(int,input().split())
  a = []
  for i in range(H):
    a.append(sys.stdin.read())
    
  ans = 0
  for i in range(2**H):
    for j in range(2**W):
      cnt = 0
      for s in range(H):
        for t in range(W):
          if(i >> s) & 1 and (j >> t) & 1 and a[s][t] == "#":
            cnt += 1
      if cnt == K :
        ans += 1
  print(ans)
  
if __name__ == "__main__":
  main()

### FIXED CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


H,W,K = map(int,readline().split())
C = [readline().strip() for _ in range(H)]

ans = 0
for i in range(2**H):
    for j in range(2**W):
        cnt = 0
        for s in range(H):
            for t in range(W):
                if (i >> s) & 1 and (j >> t) & 1 and C[s][t] == "#":
                    cnt += 1
        if cnt == K:
            ans += 1
print(ans)
A, B, M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
minimum = a[0]+b[0]

for k in range(M):
    x,y,c = map(int,input().split())
    tmp = a[x-1]+a[y-1]-c
    if minimum > tmp:
        minimum = tmp

a.sort()
b.sort()

for i in a:
    if i + b[0] > minimum:
        break
    for j in b:
        tmp = i + j
        if minimum > tmp:
            minimum = tmp
        else:
            break

print(minimum)

### FIXED CODE ###

A, B, M = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
minimum = a[0]+b[0]

for k in range(M):
    x,y,c = map(int,input().split())
    tmp = a[x-1]+b[y-1]-c
    if minimum > tmp:
        minimum = tmp

a.sort()
b.sort()

for i in a:
    if i + b[0] > minimum:
        break
    for j in b:
        tmp = i + j
        if minimum > tmp:
            minimum = tmp
        else:
            break

print(minimum)
x = int(input())
A = [i**5 for _ in range(1500)]
for i in range(1500):
  for j in range(1500):
    if A[i]  == x + A[j]:
      print(A[i],A[j])
      break


### FIXED CODE ###

X = int(input())

AA = 0
BB = 0

for A in range(-121,121):
    for B in range(-121,121):
        if X == (A ** 5) - (B ** 5):
            AA = A
            BB = B

print(AA,BB)
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    a,b = map(str,input().split())

    if a*b%2 == 0:
        print('Even')
    else:
        print('Odd')


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

def main():
    a,b = map(int,input().split())

    if a*b%2 == 0:
        print('Even')
    else:
        print('Odd')


if __name__ == '__main__':
    main()
def calc_range_num(h,height,max_height,ans):#各階層にいくつ区間があるか
    for i in range(len(h)):
        if h[i]>height:
            if i+1<len(h) and h[i]>h[i+1] and h[i+1] <=height:
            #基本的には、高さが下がったところでインクリメント
                #print(i,h[i],ans+1,height)
                ans+=1
            elif i==len(h)-1 and h[i]>height:
                #print(i,h[i],ans+1,height)
                ans+=1
    height+=1
    if height==max_height:
        return ans
    else:
        ans = calc_range_num(h,height,max_height,ans)
    return ans
N = int(input())
h = list(map(int, input().split()))
max_height=max(h)
ans=0
print(calc_range_num(h,0,max_height,ans))

### FIXED CODE ###

def calc_range_num(h,height,max_height,ans):#各階層にいくつ区間があるか
    for i in range(len(h)):
        if h[i]>height:
            if i+1<len(h) and h[i]>h[i+1] and h[i+1] <=height:
            #基本的には、高さが下がったところでインクリメント
                #print(i,h[i],ans+1,height)
                ans+=1
            elif i==len(h)-1:
                #print(i,h[i],ans+1,height)
                ans+=1
    height+=1
    if height>=max_height:
        return ans
    else:
        ans = calc_range_num(h,height,max_height,ans)
    return ans
N = int(input())
h = list(map(int, input().split()))
max_height=max(h)
ans=0
print(calc_range_num(h,0,max_height,ans))
N=int(input())
X=input()

def popcnt(x):
    n=x
    res=0
    while n>0:
        res+=n%2
        n//=2
    return res

table=[0,1]+[-1 for i in range(219998)]
for i in range(2,220000):
    table[i]=table[i%popcnt(i)]+1

moto=0
for i in range(N):
    if X[i]=='1':
        moto+=1

plus=0  #もとの数字に1のときのmodをしたやつ
minus=0

for i in range(N):
    plus+=int(X[i])*pow(2,N-1-i,moto-1)
    minus+=int(X[i])*pow(2,N-1-i,moto+1)
    plus%=(moto-1)
    minus%=(moto+1)

for i in range(N):
    ans=0
    if X[i]=='1':
        ans=plus
        ans-=pow(2,N-1-i,moto-1)
        ans%=(moto-1)
    else:
        ans=minus
        ans+=pow(2,N-1-i,moto+1)
        ans%=(moto+1)
    print(table[ans]+1)

### FIXED CODE ###

N=int(input())
X=input()

def popcnt(x):
    n=x
    res=0
    while n>0:
        res+=n%2
        n//=2
    return res

table=[0,1]+[-1 for i in range(219998)]
for i in range(2,220000):
    table[i]=table[i%popcnt(i)]+1

moto=0
for i in range(N):
    if X[i]=='1':
        moto+=1

plus=0  #もとの数字に1のときのmodをしたやつ
minus=0

for i in range(N):
    plus+=int(X[i])*pow(2,N-1-i,max(1,moto-1))
    minus+=int(X[i])*pow(2,N-1-i,moto+1)
    plus%=(max(1,moto-1))
    minus%=(moto+1)

for i in range(N):
    ans=0
    if X[i]=='1':
        ans=plus
        ans-=pow(2,N-1-i,max(1,moto-1))
        ans%=(max(1,moto-1))
        if moto==1:
            ans=-1
    else:
        ans=minus
        ans+=pow(2,N-1-i,moto+1)
        ans%=(moto+1)
    if ans==-1:
        print(0)
    else:
        print(table[ans]+1)
N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    for i in range(len(time)-1):
        if time[i] == time[i+1]:
            remove_list.append(time[2*i+1])
    time = list(set(time)-set(remove_list))
    time.sort()
    # print(time)
    # print(time)
    # print(f)
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1

ans = -1
for i in range(1,max_end+1):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

# print(f)
print(ans)


### FIXED CODE ###

N,C = map(int,input().split())
tv_times = [[int(j) for j in input().split()] for i in range(N)]

channells = {}
for i in range(C+1):
    channells[i] = []
max_end = -1

for i in range(N):
    s,g,c = tv_times[i]
    max_end = max(max_end,g)
    channells[c] += [s,g]

tv_times = []
f = [0 for i in range(max_end+1)]
for cha in channells.keys():
    remove_list = []
    time = channells[cha]
    time.sort()
    for i in range(1,len(time)-1):
        if time[i] == time[i+1]:
            remove_list.append(time[i])
    time = list(set(time)-set(remove_list))
    time.sort()
    for i in range(len(time)//2):
        f[max(time[2*i]-1,0)] += 1
        f[time[2*i+1]] -= 1
ans = -1
for i in range(1,max_end+1):
    f[i] += f[i-1]
    if ans < f[i]:
        ans = f[i]

print(ans)
h,w,m=map(int,input().split())
h=[]
w=[]
for i in range(m):
    h1,w1=map(int,input().split())
    h.append(h1)
    w.append(w1)
h_counter=Counter(h)
w_counter=Counter(w)
for i in range(m):
    if h[i]==h_counter.most_common()[0][0] and w[i]==w_counter.most_common()[0][0]:
        print(h_counter.most_common()[0][1]+w_counter.most_common()[0][1]-1)
        exit()
else:
    print(h_counter.most_common()[0][1]+w_counter.most_common()[0][1])

### FIXED CODE ###

h,w,m=map(int,input().split())
bomb=[]
x=[0]*(h+1)
y=[0]*(w+1)
for i in range(m):
    h1,w1=map(int,input().split())
    x[h1]+=1
    y[w1]+=1
    bomb.append((h1,w1))
maxx=max(x)
maxy=max(y)
r=[]
c=[]
bomb=set(bomb)
for i in range(1,h+1):
    if x[i]==maxx:
        r.append(i)
for j in range(1,w+1):
    if y[j]==maxy:
        c.append(j)
for j in r:
    for k in c:
        if (j,k) not in bomb:
            print(maxx+maxy)
            exit()
print(maxx+maxy-1)
import sys
N = int(input())

A = []
for i in range(N):
  tmp = int(input())
  A.append(tmp)

A_set = set(A)
if len(A_set)==1:
  val = max(A_set)
  for i in range(N):
    print(val)
  sys.exit()

second_max = sorted(A_set)[-2]
#print(A_set)
#print(second_max)
#print('--')

tmp_max = max(set(A))
tmp_max_list = [i for i, x in enumerate(A) if x == tmp_max]
#print(tmp_max_list)
if tmp_max_list > 1:
  for i in range(N):
    print(tmp_max)
  sys.exit()

tmp_list = [tmp_max] * N
tmp_list[A.index(tmp_max)]=tmp_max
#[式 for 任意の変数名 in イテラブルオブジェクト if 条件式]
#l_odd = [i for i in l if not i % 2 == 0]
for i in range(N):
  print(tmp_list[i])


### FIXED CODE ###

n=int(input())
l=[int(input()) for i in range(n)]
a=sorted(l)
b=a[-1]
c=a[-2]
for i in l:
  if i!=b:
    print(b)
  else:
    print(c)
import sys

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


list = []

count = 0
lMin, rMax = -1, -1

for i in range(0,m) :
    l, r = input().split()

    list.append((int(l),int(r)))

    if lMin == -1 and rMax == -1:
        lMin, rMax = list[i]
    else:
        if lMin < list[i][0] :
            lMin = list[i][0]
            
        if rMax > list[i][1] :
            rMax = list[i][1]

print(rMax - lMin +1)

### FIXED CODE ###

import sys

old, yen = input().split()

if int(old) >= 13 :
    print(yen)
elif int(old) >= 6 :
    print(int(int(yen)/2))
else :
    print(0)