peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import math
INF = 2_000_000_001
L, R = list(map(int, input().split()))
if math.ceil(L / 2019) <= R // 2019:
    print(0)
else:
    res = INF
    for i in range(L % 2019, R % 2019):
        for j in range(L % 2019 + 1, R % 2019 + 1):
            res = min(res, (i * j) % 2019)
    print(res)
# Judge status: Accepted
from heapq import heapify, heappop, heappush
from sys import stdin

N, M = map(int, input().split())
A = list(map(int, stdin.readline().split()))
heapify(A)
BC = [None] * M
for i in range(M):
    BC[i] = tuple(map(int, stdin.readline().split()))
BC = sorted(BC, key=lambda x: x[1], reverse=True)

enough = False
for bc in BC:
    if enough:
        break
    for i in range(bc[0]):
        if bc[1] <= A[0]:
            enough = True
            break
        heappop(A)
        heappush(A, bc[1])

print(sum(A))
# Judge status: Accepted
class Map(dict):
    def __missing__(self, key):
        default_value = 0
        self[key] = default_value
        return default_value


def main():
    int(input())

    d = Map()
    ans = 0
    for i, height in enumerate(input().split()):
        height = int(height)
        d[i + height] += 1
        ans += d[i - height]

    return ans


if __name__ == '__main__':
    print(main())
# Judge status: Wrong Answer
s = input()
n = len(s)
ans = 0
l = 0
ll = [0] * (n + 1)
r = 0
rl = [0] * (n + 1)
for i in range(n):
    if s[i] == '<':
        l += 1
        ll[i+1] = l
    else:
        l = 0
    if s[-i] == '>':
        r += 1
        rl[-i-1] = r
    else:
        r = 0
for i in range(n + 1):
    ans += max(rl[i], ll[i])
print(ans)
# Judge status: Accepted
s = input()

print(s.replace('?','D'))
# Judge status: Wrong Answer
N = int(input())
c = list(input())
pre = c[0:(N+1)//2]
suf = c[(N+1)//2:N]
ans = 0

pre_cnt = pre.count('W')
suf_cnt = suf.count('R')

ans = min(pre_cnt,suf_cnt)

print(ans)
# Judge status: Accepted
X = int(input())

if X >= 30:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
# coding: utf-8
# Your code here!

S = input()
#N = int(input())
#A, B = map(int, input().split())
#List = list(map(int, input().split()))

if S=="RRR":
    print(3)
elif S=="SSS":
    print(3)
elif S=="RSS":
    print(2)
elif S=="RRS":
    print(2)
elif S=="SRR":
    print(2)
elif S=="SSR":
    print(2)
else:
    print(1)
# Judge status: Wrong Answer

N = int(input())

print(1/2 if (N%2)==0 else (N+1)/2*N)
# Judge status: Wrong Answer
a, b, x = map(int, input().split())

p = 0
y = int(b//x) + 1

i = 1
#for i in range(1,y):
while x*i <= b:
    if a <= x*i:
        p = x*i
        break
    i += 1

if p != 0:
    t = b-p
    s = t//x
    ans = s + 1
    if a == 0:
        ans += 1
    print(ans)
else:
    print(0)
# Judge status: Accepted
n,k=map(int,input().split())
while n>k:
  n=n%k
if n>k//2:
  n=abs(n-k)
print(n)
# Judge status: Accepted

ans = 0
s = input()
l = len(s)

N = [0 for i in range(l)]

for i in range(l):
    N[i] = int(s[-i-1])
N.append(0)

for i in range(l+1):
    if N[i]<5:
        ans += N[i]
    elif N[i]>5:
        ans += 10-N[i]
        N[i+1] += 1
    elif N[i+1]>4:
        ans += 10-N[i]
        N[i+1] += 1
    else:
        ans += N[i]

print(ans)
# Judge status: Accepted
n=int(input())
arr=list(map(int,input().split()))
s=sum(arr)
ans=0
m=10**9+7
c=0
for i in arr:
    c+=i
    ans+=i*(s-c)
    ans%=m
print(ans)
# Judge status: Accepted
from operator import itemgetter

n = int(input())
info = [list(map(int, input().split())) for i in range(n)]
a = [info[i][0] for i in range(n)]
b = [info[i][1] for i in range(n)]

a = sorted(a)
b = sorted(b)
if n % 2 == 1:
    l = a[n // 2]
    r = b[n // 2]
    print(r - l + 1)
else:
    l1, l2 = a[n // 2 - 1], a[n // 2]
    r1, r2 = b[n // 2 - 1], b[n // 2]
    print((r1 + r2) - (l1 + l2) + 1)
# Judge status: Wrong Answer
N, P = map(int, input().split())
A = list(map(int, input().split()))

OE = [0,0]

for i in range (0, N):
	if A[i]%2 == 0:
		OE[1]+=1
	else:
		OE[0]+=1

RemEven = 1

if OE[0]%2 - 1 !=0:
	RemEven = 0

import math

count = 0

for i in range (0, OE[0]+1):
	if i%2==0:
		count+=(2**OE[1])*math.factorial(OE[0])/(math.factorial(i)*math.factorial(OE[0]-i))

if RemEven == 1:
	print(int(count))
else:
	print(int(2**N-count))
# Judge status: Accepted
N = int(input())
A = list( map(int, input().split()))
minus = len([ 1 for i in A if i<0])
abs_A = list(map(abs, A))
if minus % 2 == 0:
  print(sum(abs_A))
else:
  print(sum(abs_A) - 2 * min( abs_A))
# Judge status: Accepted
N,K=map(int,input().split())
D=list(map(int,input().split()))

while True:
  S=str(N)
  flag=True
  for x in S:
    if int(x) in D:
      flag=False
  if flag==True:
    break;
  N+=1
print(N)
# Judge status: Accepted
N,K = map(int,input().split())
p = list(map(int,input().split()))
E = sum(p[0:K])
a = E
for i in range (0,N-K):
  E = E - p[i] + p[i+K]
  if E == max(a,E):
    a = E
    
print((a+K)/2)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

for i in range(k, n):
    print("Yes") if a[i] > a[i-k] else print("No")
# Judge status: Accepted
n,m = map(int,input().split())
li = [list(map(int,input().split())) for _ in range(m)]

if n==1 and all([i[1]==0 for i in li]):
    print(0)
    exit()
for i in range(10**(n-1),10**n):
    p = list(map(int,list(str(i))))
    for s,c in li:
        if p[s-1] != c:break
    else:
        print(i)
        exit()
print(-1)
# Judge status: Accepted
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, L = LI()
    S = [SS() for _ in range(N)]

    S.sort()
    print(''.join(S))

if __name__ == '__main__':
    resolve()
# Judge status: Accepted
N,C,K = map(int,input().split())
T = []
for i in range(N):
    T.append(int(input()))

T.sort()

ans = 0
p = C
d_time = 0

for i in range(N):
    if T[i] - d_time > K or p == C:
        ans += 1
        d_time = T[i]
        p = 1
    else:
        p += 1

print(ans)
# Judge status: Accepted
s1, s2 = map(str, input().split())
a, b = map(int, input().split())
s3 = input()

if(s1==s3):print(a-1, b)
else:print(a, b-1)
# Judge status: Wrong Answer
s = input()
n = len(s)
if n == 1:
	print(n)
elif n == 2:
	print(9)
elif n == 3:
	print(9+(int(s)-99))
elif n == 4:
	print(9+900)
elif n == 5:
	print(9+899+(int(s)-9999))
else:
	print(90909)
# Judge status: Accepted
a=input()

i = 0
j = 0

while a != a[::-1]:
	if(a[i]!=a[len(a) - i - 1]):
		sList = list(a)
		sList[i] = sList[len(a) - i - 1]
		a = "".join(sList)
		j += 1
	i += 1

print(j)
# Judge status: Accepted
x, n = map(int, input().split())
p = list(map(int, input().split()))
if n == 0:
    print(x)
    exit()
for i in range(100):
    if x - i not in p:
        print(x-i)
        exit()
    if x + i not in p:
        print(x+i)
        exit()
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
now=1
break_num=0
for i in range(n):
    if a[i]!=now:
        break_num+=1
    else:
        now+=1
if break_num==n: print(-1)
else: print(break_num)
# Judge status: Wrong Answer
q, h, s, d = map(int, input().split())
n = int(input())
cheep_1 = min(q * 4, 2 * h, s)
if 2 * cheep_1 <= d:
    print(cheep_1 * n)
else:
    n1 = n % 2
    print(n // 2 + n1 * cheep_1)
# Judge status: Wrong Answer
a = list(map(int, input().split()))

print(a[0]*a[1]/2)
# Judge status: Accepted
import sys
import math
from collections import defaultdict, deque
def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

n=r()
a=rl()
all=a[0]^a[1]
for i in range(2,n):
    all^=a[i]
b=[]
for j in range(n):
    b.append(all^a[j])
print(*b)
# Judge status: Wrong Answer
N=int(input())
d=list(map(int, input().split()))

d=sorted(d)
ans=0

if N%2==0:
    for i in range(10**5):
        if d[int(N/2-1)] < i and i <= d[int(N/2)]:
            ans +=1
else:
    for i in range(10**5):
        if d[int(N//2+1)] == i:
            ans +=1
print(ans)
# Judge status: Accepted
n = int(input())
loss = []

for _ in range(n-1):
    c,s,f = map(int,input().split())
    loss.append((c,s,f))

for i in range(n-1):
    time = 0
    for j in range(i,n-1):
        if time < loss[j][1]:
            time = loss[j][1]
        if (time-loss[j][1])%loss[j][2] != 0:
            time += loss[j][2]-(time-loss[j][1])%loss[j][2]
        time += loss[j][0]
    print(time)
print(0)
# Judge status: Accepted
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


def main():
    N,K = map(int,input().split())

    mod = 10 ** 9 + 7

    res = 0

    for i in range(K,N+2):
        r = (2 * N - i + 1) * i // 2
        l = (i - 1) * i // 2
        res += r - l + 1
        res %= mod

    print(res)



main()
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())
if A + B >= C * 2:
    price = min(X, Y) * C * 2
    tmp = min(X,Y)
    X = X - tmp
    Y = Y - tmp
    if A * X < C * X * 2:
        price += A * X
        X -= X
    if B * Y < C * Y * 2:
        price += B * Y
        Y -= Y
    price += C * 2 * max(X, Y)
    print(price)

else:
    print(A * X + B * Y)
# Judge status: Accepted
n , k = map(int,input().split())
ans = [0] * n
for i in range(k):
  d = int(input())
  for j in list(map(int,input().split())):
    ans[j-1] = 1
print(ans.count(0))
# Judge status: Accepted
n = int(input())
X = list(map(int, input().split()))

import copy
Y = copy.copy(X)

L = []
U = []
X.sort()
for i in range(n):
    if i < n//2:
        L.append(X[i])
    else:
        U.append(X[i])
#print(L)
#print(U)

L_ = set(L)
U_ = set(U)

ans = [0]*n
for i, y in enumerate(Y):
    if y in L_:
        ans[i] = U[0]
    else:
        ans[i] = L[-1]
print(*ans, sep='\n')
# Judge status: Accepted
n = int(input())
result = ""
if n != 0:
    while n != 0:
        if n%2==0:
            result = "0"+result
        else:
            result = "1"+result
        n = (n-n%2)//(-2)
else:
    result = "0"
print(result)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))

cnt=0
ans=0

lis=[(l[i+1]-l[i]) for i in range(n-1)]

for i in lis:
  if i<=0:
    cnt+=1
  else:
    ans=max(cnt, ans)
    cnt=0
    
ans=max(cnt, ans)
    
print(ans)
# Judge status: Accepted
s=int(input())
n=0
while(s>0):
  n=n+s
  s=s-1
print(n)
# Judge status: Accepted
n = int(input())

ans = 0

for a in range(1,n):
    ans += (n-1)//a

print(ans)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
if a+b>c:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = int(input())
s = input()
b_total = 0
w_total = 0
ans = 0
for i in range(n):
  if s[i] == '#':
    b_total += 1
  if s[i] == '.':
    w_total += 1
if b_total == n:
  print(0)
else:
  b_cnt = 0
  w_cnt = 0
  ans = b_cnt + (w_total - w_cnt)
  for i in range(n):
    if s[i] == '#':
      b_cnt += 1
    if s[i] == '.':
      w_cnt += 1
    cnt = b_cnt + (w_total - w_cnt)
    ans = min(ans, cnt)
  print(ans)
# Judge status: Accepted
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
A, B = map(int , input().split())
print(lcm(A, B))
# Judge status: Accepted
N=int(input())
A=sorted(a-i-1 for i,a in enumerate(map(int,input().split())))
#A-iを取り出して昇順に並べる
print(sum(abs(a-A[N//2]) for a in A))
# Judge status: Accepted
S = list(input())
S.sort()

if S == ['a', 'b', 'c']:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import math
A, B, H, M = map(int, input().split())

rad_h = (H / 12  + M / 12 / 60 ) * 2 * math.pi
rad_m = M / 60 * 2 * math.pi

res = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(abs(rad_h - rad_m)))
print(res)
# Judge status: Wrong Answer
w, h, n = map(int, input().split())
x1 = [0]
x2 = [w]
y1 = [0]
y2 = [h]

for i in range(n):
  x, y, a = map(int, input().split())
  if a == 1:
    x1.append(x)
  elif a == 2:
    x2.append(x)
  elif a == 3:
    y1.append(y)
  elif a == 4:
    y2.append(y)

left = max(x1)
right = min(x2)
bottom = max(y1)
top = min(y2)

ans = (top - bottom) * (right - left)
print(ans if ans > 0 else 0)
# Judge status: Accepted
a = int(input())
b = int(input())
print(a^b)
# Judge status: Accepted
n,k=map(int,input().split())
t=[int(i) for i in input().split()]
t.sort()
print(sum(t[:k]))
# Judge status: Accepted
import string

S = list(input())

low_list = list(string.ascii_lowercase)
for i in range(len(S)):
    try:
        low_list.remove(S[i])
    except ValueError:
        pass

if len(low_list) == 0:
    print('None')
else:
    print(low_list[0])
# Judge status: Wrong Answer
n, a, b = map(int, input().split(' '))
MOD = 10**9 + 7

ans = -1

def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n = n>>1
    return res

ans += modpow(2, n, MOD)


def COM(n, k):
    res = 1
    for i in range(1, k+1):
        res = res * (n-i+1) / i % MOD
    return res %MOD


ans -= COM(n, a)
ans -= COM(n, b)

print(int(ans))
# Judge status: Wrong Answer
s = input()

cnt = sum([int(c) for c in s])
# Judge status: Wrong Answer
import sys
import random

def main():
    S = input()
    l = len(S)
    n = [0, 1, l-1]
    out = S[n[0]] + S[n[1]] + S[n[2]]
    
    print(out)
main()
# Judge status: Accepted
def main():
    n, m = [int(s) for s in input().strip().split()]
    S, C = [], []
    for _ in range(m):
        s, c = [int(s) for s in input().strip().split()]
        S.append(s)
        C.append(str(c))
    
    for x in range(1000):
        x = str(x)
        if len(x) == n and all(x[s - 1] == c for s, c in zip(S, C)):
            print(x)
            return
    print(-1)


main()
# Judge status: Accepted
n = int(input())
s = str(input())
ans = s.count('.')
L = [[0, s.count('.')]]
for i in range(n):
    if s[i] == '#':
        L.append([L[i][0]+1, L[i][1]])
    else:
        L.append([L[i][0], L[i][1]-1])
    ans = min(ans, L[-1][0] + L[-1][1])
print(ans)
# Judge status: Accepted
lis = []
rank1 = []
for i in range(5):
  lis.append(input())
  rank1.append( 10 if lis[-1][-1] == "0" else int(lis[-1][-1]))

min_index = rank1.index(min(rank1))
  
ans = 0
for i in range(5):
  if i == min_index:
    continue
  ans = (ans + int(lis[i]) + 9)//10*10
ans += int(lis[min_index])

print(ans)
# Judge status: Accepted
ls = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
print(7 - ls.index(str(input())))
# Judge status: Accepted
h,n=map(int,input().split())
ab=[list(map(int,input().split())) for _ in range(n)]

dp=[0]*h
for i in range(h):
    _min = 10**10
    for g in range(n):
        if i>=ab[g][0]:
            _min = min(ab[g][1]+dp[i-ab[g][0]], _min)
        else:
            _min = min(ab[g][1], _min)
    dp[i]=_min
print(dp[-1])
# Judge status: Accepted
mod=10**9+7
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
l=list(mi())
dp=[0]*a
dp[0]=0
for i in range(1,a):
    dp[i]=min(abs(l[i]-l[i-j-1])+dp[i-j-1] for j in range(min(i,b)))
print(dp[-1])
# Judge status: Accepted
N = int(input())
if N % 2 == 0:
  print(int(N / 2))
else:
  print(int(N / 2) + 1)
# Judge status: Wrong Answer
import sys

def eat(i,candies,counter):
    s=candies[i]+candies[i-1]
    nc=max(0,s-x)
    counter+=nc
    candies[i]-=nc
    return counter

def main(n,x,candies):
    counter=0
    if candies[0]>x:
        candies[0]=x
        counter=x-candies[0]
    for i in range(1,n):
        counter=eat(i,candies,counter)
    return counter

n,x=map(int,sys.stdin.readline().strip().split())
candies=list(map(int,sys.stdin.readline().strip().split()))
print(main(n,x,candies))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))


y = 1000000


for i in range(-100, 100):
    x = 0
    for m in a:
        x += (i-m)**2
    if y > x:
        y = x

print(y)
# Judge status: Accepted
n, k = map(int, input().split(' '))
list_a = list(map(int, input().split(' ')))

for i in range(k, n):
  if list_a[i] > list_a[i-k]:
    print('Yes')
  else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
A = []
B = []

for i in range(N):
  hoge = input().split()
  A.append(int(hoge[0]))
  B.append(int(hoge[1]))

sorted_A = sorted(A)
sorted_B = sorted(B)

if N % 2 != 0:
  center_A = sorted_A[N//2]
  center_B = sorted_B[N//2]
  print(abs(center_B - center_A) + 1)
else:
  center_A = (sorted_A[N//2-1] + sorted_A[N//2]) //2
  center_B = (sorted_B[N//2-1] + sorted_B[N//2]) //2
  print(abs(center_B - center_A)*2 + 1)
# Judge status: Accepted
N = int(input())
a_list = list(map(int, input().split()))

count = 1
up_flag = None
prev_a = a_list[0]
for a in a_list[1:]:
  if up_flag is None:
    if prev_a == a:
      continue
    up_flag = a > prev_a
  if up_flag and a >= prev_a:
    prev_a = a
    continue
  elif not up_flag and a <= prev_a:
    prev_a = a
    continue
  else:
    up_flag = None
    count += 1
    prev_a = a

print(count)
# Judge status: Accepted
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

a,b,c = mint()
judge(c%gcd(a,b)==0,['YES','NO'])
# Judge status: Accepted
S=[i for i in list(input())];N=len(S);k=['k','e','y','e','n','c','e']
for d in range(N-6):
    for i in range(N-d+1):
        s=S[:i]+S[i+d:]
        if s==k:
            print('YES');quit()
print('NO')
# Judge status: Accepted
a = list(map(int,input().split()))
print(a[0] * a[1])
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
m=1000
s=0
for i in range(N-1):
    if A[i] < A[i+1]:
        s+=m//A[i]
        m=m%A[i]
    if A[i] > A[i+1]:
        m += A[i]*s
        s=0

print(m+A[N-1]*s)
# Judge status: Accepted
# coding: utf-8
# Your code here!
a,b,x = map(int,input().split())

if 0<= x-a <= b:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import sys
a,b,c=map(int,input().split())
for i in range(b):
  if i*a%b==c:
    print("YES")
    sys.exit()
print("NO")
# Judge status: Wrong Answer
li = list(input())
li.sort

if li[0] == 'a' and li[1] == 'b' and li[2] == 'c':
    print('Yes')
else:
    print('Yes')
# Judge status: Accepted
n,a,b = map(int, input().split())
rs = (b-a)//2

if (b-a) % 2 == 0:
    print(rs)
else:
    if a==1 and b==n:
        print(n//2)
    elif (a-1) > (n-b):
        print(rs+(n-b+1))
    else:
        print(rs+a)
# Judge status: Accepted
import sys
def input():
    return sys.stdin.readline()[:-1]
N,H=map(int,input().split())
m=0
l=[None]*N
for i in range(N):
    a,b=map(int,input().split())
    if a>m:
        m=a
    l[i]=b
l.sort(reverse=1)
a=0
for i in l:
    if i<=m:
        a+=-(-H//m)
        break
    H-=i
    a+=1
    if H<=0:
        break
else:
    a+=-(-H//m)
print(a)
# Judge status: Accepted
s = str(input())

s_tuple = s[0:1],s[1:2],s[2:3]

i = 0

for sb in s_tuple:
  if sb == '1':
    i = i + 1

print(i)
# Judge status: Accepted
dic = ["A","T","G","C"]
S = list(input())

ans = 0
count = 0
for i in range(0,len(S),1):
    if S[i] in dic:
        count += 1
        ans = max(ans,count)
    else:
        count=0
print(ans)
# Judge status: Accepted
s=input()
print('No' if len(set(s)) == 1 else 'Yes')
# Judge status: Accepted
N = int(input())
ans = 0
A0 = []
A1 = []
for _ in range(N):
    s = int(input())
    if s % 10 == 0:
        A0.append(s)
    else:
        A1.append(s)
A1.sort()
if len(A1) != 0:
    if sum(A1) % 10 != 0:
        print(sum(A0) + sum(A1))
    else:
        print(sum(A0) + sum(A1[1:]))
else:
    print(0)
# Judge status: Accepted
S = input()
T = input()

found = []
for i in range(len(S) - len(T) + 1):
  for cs, ct in zip(S[i:], T):
    if cs != '?' and cs != ct:
      break
  else:
    found.append(i)

if not found:
  print("UNRESTORABLE")
  exit()

ans = 'z'  * 51

for i in found:
  tmp = S[:i] + T + S[i+len(T):]
  ans = min(ans, tmp.replace("?", "a"))
print(ans)
# Judge status: Accepted
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
a = readInts()
s = 0
for i in a:
	s = s^i

for i in a:
	print(s^i, end=" ")
# Judge status: Wrong Answer
A, B, C = map(int, input().split())
if A - B >= C:
    print(C)
else:
    print(A - B)
# Judge status: Accepted
n = int(input())
lucas = [2, 1]
for i in range(2, 100):
    lucas.append(lucas[i - 1] + lucas[i - 2])
print(lucas[n])
# Judge status: Wrong Answer
X,A,B = (int(T) for T in input().split())
['delicious','safe','dangerous'][(B-A>0)*(1+((X-(B-A))<0))]
# Judge status: Accepted
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
G = a[0]
for i in range(1,n):
    G = gcd(G,a[i])
print(G)
# Judge status: Wrong Answer
import sys
N = int(input())
for i in range(0,112):
  n = list(str(N+i))
  print(n)
  if n[0] == n[1] == n[2]:
    print(N+i)
    sys.exit()
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
c2=c4=0

for i in range(N):
  if a[i]%4==0:
    c4+=1
  if a[i]%2==0:
    c2+=1

nodd=N-c2
c2=c2-c4
if c2>0:
  nodd+=1
if c4>=nodd-1:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
cap = input()
cap_2 = cap.lower()
if cap == cap_2:
    print('a')
else:
    print('A')
# Judge status: Accepted
import sys
n,k = map(int,input().split())
d = list(map(int,input().split()))
 
for i in range(100000):
    s = str(i)
    n2 = len(s)
    fl = 0
    for j in range(len(s)):
        for k in d:
            if s[j] == str(k):
                fl = 1
                
    if fl == 0:
        if i >= n:
            print(i)
            break
# Judge status: Accepted
N=int(input())
print("Yes" if N>=30 else "No")
# Judge status: Accepted
import math
abcde = [input() for i in range(5)]

flg = -1
for i in range(1,10):
    if flg != -1:
        break
    for j in range(5):
        if abcde[j][-1]==str(i):
            flg = j
            break
total = 0
for i in range(5):
    if flg==i:
        total += int(abcde[i])
    else:
        total += math.ceil(int(abcde[i])/10)*10
print(total)
# Judge status: Wrong Answer
n = int(input())

if n % 2 == 1:
  print(0)
else:
  n = n//10
  res = n
  while n > 5:
    n = n//5
    res += n
  print(res)
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))

dic = {}

for i in range(N):
    if A[i] in dic:
        dic[A[i]] += 1
    else:
        dic[A[i]] = 1

ks = list(dic.keys())
vs = list(dic.values())

vs.sort()

B = (len(ks))
cnt = 0

for i in range(len(vs)):
    if B > K:
        B -= 1
        cnt += vs[i]
    else:
        break

print(cnt)
# Judge status: Wrong Answer
a, b = input().split(" ")

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

c = a*b

if c%2 ==0:
    print("even")
    
else:
    print("odd")
# Judge status: Accepted
H= int(input())
W= int(input())
N= int(input())

import math

u = N/max(H,W)

print(math.ceil(u))
# Judge status: Accepted
S = str(input())
N = len(S) + 1
A = [0] * N
for i in range(N-1):
    if S[i] == "<":
        A[i+1] = max(A[i]+1, A[i+1])

for i in range(N-2, -1, -1):
    if S[i] == ">":
        A[i] = max(A[i], A[i+1]+1)

print(sum(A))
# Judge status: Accepted
s = input()
print("yes") if len(set(s)) == len(s) else print("no")
# Judge status: Wrong Answer
S = input()

ans = "No"

for i in range(len(S) - 1):
  if S[i] == "h" and S[i + 1] == "i":
    if i == len(S) - 2:
      ans = "Yes"
      break
    else:
      if S[i + 2] != "i":
        ans = "Yes"
        break

print(ans)