Harryxun/stf_run huggingface dataset:
def mx(i):
    if i == 0: return 0
    else     : return (i+1)*i + mx(i-1)

def cns(ls,m,sm):
    global n, s
    count = 0
    if m == n:
        if sm == s: return 1
        else      : return 0
    elif s-mx(n-m) <= sm <= s:
        for i in range(9-m+1):
            rls = ls[:]
            k = rls.pop(i)
            count += cns(rls,m+1,sm+(m+1)*k)
        return count
    else: return 0

ls = [0,1,2,3,4,5,6,7,8,9]
while True:
    n, s = map(int, raw_input().split())
    if s > mx(n): print 0
    else        : print cns(ls,0,0)

### FIXED CODE ###

def mxmn(ls,m):
	global n
	s1,s2 = 0, 0
	for i in range(m):
		s1 += (n-i)*ls[-i-1]
		s2 += (n-i)*ls[i]
	return s1,s2

def f(ls,m,s):
	global n
	count = 0
	if m > 0:
		mx,mn = mxmn(ls,m)
		if mx < s or mn > s: return 0
		elif mx == s or mn == s: return 1
		for i in range(len(ls)):
			lls = ls[:]
			a = (n-m+1)*lls.pop(i)
			if s-a < 0:	break
			else: count += f(lls,m-1,s-a)
		return count
	else:
		return 1 if s == 0 else 0
			
ls = [i for i in range(10)]
while True:
	try:
		n,s = map(int, raw_input().split())
		print f(ls,n,s)
	except:
		break
def n_snuke(n):
    return n /sum(map(int,str(n)))


# (100o+10x+y)/(o+x+y) > (100o+99)/(o+9+9)
#  100o*18+(10x+y)(o+18) > 100o(x+y) +99(o+x+y)


#
#1 - 10 , 19,29,39,49,59,69,79,89,99

#for i in range(1,1115):
#    print(i,n_snuke(i))


K = int(input())
tmp =0

tmp_list = []
for i in range(K*3):
    tmp = tmp+ 10**(len(str(tmp+1))-1)
    tmp_list.append(tmp)
    #print(tmp,n_snuke(tmp))
r_list = [tmp_list[-1]]
for i in reversed(range(len(tmp_list)-1)):
    if n_snuke(r_list[-1]) >= n_snuke(tmp_list[i]):
        r_list.append(tmp_list[i])

for i in reversed(r_list[-K:]):
    print(i)


### FIXED CODE ###

import math
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))

assert isinstance(A,list)
a = A.index(1)

print(math.ceil((N-1)/(K-1)))
A, B, C, D = map(int, input().split())

import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
div_c = B // C
div_d = B // D
cd = lcm(C, D)
div_cd = B // cd
B_ = B - (div_c + div_d - div_cd)

div_c2 = A // C
div_d2 = A // D
div_cd2 = A // cd
A_ = A - (div_c2 + div_d2 - div_cd2)

print(B_ - A_)

### FIXED CODE ###

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

import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
div_c = B // C
div_d = B // D
cd = lcm(C, D)
div_cd = B // cd
B_ = B - (div_c + div_d - div_cd)

A -= 1
div_c2 = A // C
div_d2 = A // D
div_cd2 = A // cd
A_ = A - (div_c2 + div_d2 - div_cd2)

print(B_ - A_)
N = int(input())
A=[]
for i in range(N):
    A += [int(input())]

sort(A)
print(sum(A) - A[-1]/2)

### FIXED CODE ###

N = int(input())
A=[]
for i in range(N):
    A += [int(input())]

A.sort()
print(sum(A) - A[N-1]//2)
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
setA = set(A)

#pairwiseかどうかを調べる
memo = [1]*(10**6+1)
memo[0] = 0
memo[1] = 0
for i in range(2,10**6+1):
    if memo[i] == 1:
        flag = False
        if i in setA:
            flag = True
        for j in range(i*2,10**6+1,i):
            if j in setA:
                if flag:
                    break
                else:
                    flag = True
            memo[j] = 0
        else:
            continue
        break
elif len(setA) == len(A):
    print("pairwise coprime")
    exit()



#setwise coprimeを判断
def gcd(a,b):
    return a if b==0 else gcd(b,a%b)

g = A[0]
for i in range(1,N):
    g = gcd(g,A[i])
if g == 1:
    print("setwise coprime")
else:
    print("not coprime")


### FIXED CODE ###

from collections import Counter
N = int(input())
A = list(map(int,input().split()))
countA = Counter(A)

#pairwiseかどうかを調べる
memo = [1]*(10**6+1)
memo[0] = 0
memo[1] = 0
for i in range(2,10**6+1):
    if memo[i] == 1:
        flag = False
        if i in countA:
            if countA[i] >= 2:
                break
            flag = True
        for j in range(i*2,10**6+1,i):
            if j in countA:
                if countA[j] >= 2:
                    break
                if flag:
                    break
                else:
                    flag = True
            memo[j] = 0
        else:
            continue
        break
else:
    print("pairwise coprime")
    exit()



#setwise coprimeを判断
def gcd(a,b):
    return a if b==0 else gcd(b,a%b)

g = A[0]
for i in range(1,N):
    g = gcd(g,A[i])
if g == 1:
    print("setwise coprime")
else:
    print("not coprime")
from math import gcd
n = int(input())
l = list(map(int,input().split()))
lcm = 1
for i in range(n):
    lcm = lcm*l[i]//gcd(l[i],lcm)
x = lcm-1
print(sum([x%i for i in l]))

### FIXED CODE ###

from fractions import gcd
n = int(input())
l = list(map(int,input().split()))
lcm = 1
for i in range(n):
    lcm = lcm*l[i]//gcd(l[i],lcm)
x = lcm-1
print(sum([x%i for i in l]))
start_A, end_B = map(long, raw_input().split())
  
xor_result = start_A
if start_A == end_B:
  xor_result = 0
else:
  for i in range(start_A + 1, end_B + 1):
    xor_result = xor_result ^ i
print(xor_result)

### FIXED CODE ###

start_A, end_B = map(long, raw_input().split())

result = 0
if start_A == end_B:
  result = start_A
else:
  num_count = end_B - start_A + 1
  if start_A % 2 == 0:
    num_pair = num_count // 2
    if num_count % 2 == 0:
      result = num_pair % 2
    else:
      result = (num_pair % 2) ^ end_B
  else:
    num_pair = (num_count - 1) // 2
    if (num_count - 1) % 2 == 0:
      result = start_A ^ (num_pair % 2)       
    else:
      result = start_A ^ (num_pair % 2) ^ end_B

print result
a,b,c,d,e,f=map(int,input().split())
ans=[]
for i in range(f//100//a +1):
  for j in range(f//100//b +1):
    if i*a*100+j*b*100<=f:
      for p in range(f//c +1):
        for q in range(f//d +1):
          if p*c+q*d<=(i*a+j*b)*e and (p*c+q*d+i*a*100+j*b*100<=f):
            ans.append([p*c+q*d+i*a*100+j*b*100,p*c+q*d])
stack=0
index=0
for i in ans:
  if stack<i[0]/i[1]:
    stack=i[0]/i[1]
    index=i
if index==0:
  print(0,0)
else:
  print(ans[index])

### FIXED CODE ###

a,b,c,d,e,f=map(int,input().split())
dp=[-1]*(f+1)
dp[0]=0
flag=True
for i in range(1,f+1):
  for j in [a*100,b*100]:
    if i-j>=0 and dp[i-j]!=-1:
      dp[i]=max(0,dp[i])
  for j in [c,d]:
    if i-j>=0 and dp[i-j]!=-1:
      if 100*(dp[i-j]+j)<=e*(i-(dp[i-j]+j)):
        dp[i]=max(dp[i],dp[i-j]+j)
      else:
        for k in [a*100,b*100]:
          if i-k-j>=0 and dp[i-k-j]!=-1:
            if 100*(dp[i-k-j]+j)<=e*(i-(dp[i-k-j]+j)):
              dp[i]=max(dp[i],dp[i-k-j]+j)
stack=0
index=min(a*100,b*100)
for i in range(index+1,f+1):
  if dp[i]>0:
    if stack<(dp[i]*100)/i:
      stack=(dp[i]*100)/i
      index=i
print(index,dp[index])
a,b = map(int, raw_input().split())
print x[0]*x[1],(x[0]+x[1])*2


### FIXED CODE ###

a,b = map(int, input().split())
print(str(a*b)+" "+str(2*(a+b)))
n=input (int()) 
x=0
if n%2==0:
    x=(n/2)**2
else:
    x=((n//2)+1)*(n//2)
print(x)

### FIXED CODE ###

k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)
import math
def solve(N, X, cities):
    dists = [city - X for city in cities]
    gcd = dists[0]
    for d in dists[1:]:
        gcd = math.gcd(gcd, d)
    return gcd

if __name__ == "__main__":
    l = input()
    N, X = int(l.split()[0]),int(l.split()[1])
    cities = [int(c) for c in input().split()]
    print(solve(N, X, cities))


### FIXED CODE ###


def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def solve(N, X, cities):
    dists = [abs(city - X) for city in cities]
    ans = min(dists)
    for d in dists:
        if d % ans == 0:
            continue
        else:
            ans = gcd(ans, d % ans)
    return ans

if __name__ == "__main__":
    l = input()
    N, X = int(l.split()[0]),int(l.split()[1])
    cities = [int(c) for c in input().split()]
    print(solve(N, X, cities))
A, op, B = str(input()).split
A = int(A)
B = int(B)
op = str("+", "-")
if op =="+":
    print(A+B)
elif op == "-":
    print(A-B)


### FIXED CODE ###

A, op, B = input().split()

if op =="+":
    print(int(A) + int(B))
elif op == "-":
    print(int(A) - int(B))
import sys
from collections import deque
input = sys.stdin.readline

N=int(input())
S=input().strip()+"E"

mod=998244353


S2=deque()
NOW=1
C=S[0]
for i in range(1,3*N+1):
    if S[i]==C:
        NOW+=1
    else:
        S2.append([C,NOW])
        NOW=1
        C=S[i]

LEN=len(S2)

ANS=1
for i in range(1,N+1):
    ANS=ANS*i%mod

NOW=[]
for i in range(3):
    x,y=S2.popleft()
    NOW.append([x,y])

#print(NOW)
while S2 or NOW:
    if len(S2)>0 and len(NOW)>0 and NOW[-1][0]==S2[0][0]:
        x,y=S2.popleft()
        NOW[-1][1]+=y

    while len(NOW)<=2:
        x,y=S2.popleft()
        NOW.append([x,y])

    ANS=ANS*NOW[0][1]*min(NOW[1][1],NOW[0][1])%mod
    NOW[0][1]-=1
    NOW[1][1]-=1
    NOW[2][1]-=1

    while len(NOW)>=3 and NOW[2][1]==0:
        NOW.pop(2)

    while len(NOW)>=2 and NOW[1][1]==0:
        NOW.pop(1)

    while len(NOW)>=1 and NOW[0][1]==0:
        NOW.pop(0)

    #print(NOW)
        
print(ANS)
    


### FIXED CODE ###

import sys
input = sys.stdin.readline

N=int(input())
S=input().strip()

mod=998244353

NOW=dict()
NOW["R"]=0
NOW["G"]=0
NOW["B"]=0

ANS=1
for i in range(1,N+1):
    ANS=ANS*i%mod

for s in S:
    k,l,m=sorted((NOW["R"],NOW["G"],NOW["B"]))
    
    if NOW[s]==m:
        NOW[s]+=1

    elif NOW[s]==l:
        NOW[s]+=1
        ANS=ANS*(m-l)%mod

    else:
        NOW[s]+=1
        ANS=ANS*l%mod
    
    if NOW["R"]>=1 and NOW["G"]>=1 and NOW["B"]>=1:
        NOW["R"]-=1
        NOW["G"]-=1
        NOW["B"]-=1

print(ANS)
s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and u.size()==2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s=input()
u = set()
for let in s:
  u.add(let)
count=0
for let in s:
  if s[0] == let:
    count += 1
if count ==2 and len(u)==2:
  print("Yes")
else:
  print("No")
r = input()
ans = rˆ2
print(ans)

### FIXED CODE ###

r = int(input())
ans = r ** 2
print(ans)
#coding: utf-8

N = input()
N_list = list(N)

if N_list[0] == N_list[1] == N_list[2]:
	print("Yes")
elif N_list[1] == N_list[2] == N_list[3]:
	print("Yes")
elif N_list[2] == N_list[3] == N_list[4]:
	print("Yes")
else:
	print("No")

### FIXED CODE ###

#coding: utf-8

N_list = list(input())

if N_list[0] == N_list[1] == N_list[2]:
	print("Yes")
elif N_list[1] == N_list[2] == N_list[3]:
	print("Yes")
else:
	print("No")
n = int(input())
s = [input() for i in range(n)]
m = int(input())
t = [input() for i in range(m)]

k = set(s)
tot = 0
for i in k:
  tot = max(s.count(i) - t.count(i),tot)
  
print(tot)


### FIXED CODE ###

A,B,C = list(map(int,input().split()))
if (A+B)>=C:
    print('Yes')
else:
    print('No')
n=int(input())
li=[]
for i in range(0,n):
    flag=True
    x,l=map(int, input().split())
    mi=x-l
    ma=x+l
    for j in li:
	if j[0] < mi < ma < j[1]:
            flag=False
            break
    if flag:
	li.append([mi,ma])
print(len(li))

### FIXED CODE ###

n=int(input())
li=[None]*n
for i in range(0,n):
    flag=True
    x,l=map(int, input().split())
    li[i]=(x+l, x-l)
li=sorted(li)
count=1
x,y=li[0]
for i in range(1,n):
    x2,y2=li[i]
    if y2 < x:
        continue
    count=count+1
    x=x2
print(count)
# ABC057 D - Maximum Average Sets
from collections import defaultdict
from math import factorial
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
def perm(n,r):
    return factorial(n)//factorial(n-r)

def comb(n,r):
    return perm(n,r)//factorial(r)

n,a,b=nm()
V=nl()

d=defaultdict(int)
for vv in V:
    d[vv]+=1

value=0
cnt=0
ans=0
one_flg=False

V=list(set(V))
if len(V)==1:
    print(V[0])
    print(2**(b-a+1)-1)
    exit()

for k,v in sorted(d.items(),key=lambda x:x[0],reverse=True):
    if a>=v:
        value+=k*v
        cnt+=v
        a-=v
        b-=v
    elif a<v:
        if a==0 and v==1:
            one_flg=True
        elif b==v and b!=0:
            print(k)
            print(2**b-1)
            exit()
        else:
            for i in range(a,b+1):
                value+=k*i
                cnt+=i
                nn=v
                kk=i
                ans+=comb(nn, kk)
            break

if one_flg:
    ans=1
print(value/cnt)
print(ans)

### FIXED CODE ###

# ABC057 D - Maximum Average Sets
from collections import defaultdict
from math import factorial
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
def perm(n,r):
    return factorial(n)//factorial(n-r)
 
def comb(n,r):
    return perm(n,r)//factorial(r)

n,a,b=nm()
v=sorted(nl(), reverse=True)

if v[0]==v[a-1]:
    n = 0
    for vv in v:
        if vv!=v[0]: break
        n += 1

    ans = 0
    for k in range(a, min(b,n)+1):
        ans += comb(n, k)

else:
    n = k = 0
    for i,vv in enumerate(v):
        if vv==v[a-1]:
            if i<a: k += 1
            n += 1
    ans = comb(n,k)

print(sum(v[:a])/a)
print(ans)
import sys
import queue
input = sys.stdin.readline

N, Q = map(int, input().split())
tree = [[] for _ in range(N+1)]
value = [0] * (N+1)
visit = [False] * (N+1)

# make_tree
for _ in range(N-1):
    a, b = map(int, input().split())
    tree[a].append(b)
    tree[b].append(a)

# make_value
for _ in range(Q):
    p, x = map(int, input().split())
    value[p] += x

# all_value_sum
q = queue.Queue()
q.put(1)
visit[1] = True
while not q.empty():
    now = q.get()
    for next in tree[now]:
        if not visit[next]:
            value[next] += value[now]
            q.put(next)
            visit[next] = True

# output_value
s = " ".join(map(str, value[1:]))
print(s)

### FIXED CODE ###

a = int(input())
s = input()
print(s) if a >= 3200 else print("red")
a = map(int, input().split())
a.sort
print(a[0]+a[1])

### FIXED CODE ###

a = list(map(int, input().split()))
a.sort()
print(a[0]+a[1])
N, K = map(int, input().split())

S = str(input())

L = [0]
if len(S) != 1:
    for i in range(len(S)-1):
    #     print(S[i],S[i+1])
        if S[i] != S[i+1]:
            L.append(i+1)
    L.append(len(S))
# print(L)

ans = 1
for i in range(len(L)-K*2-1):
#     print(i, i+K*3-1)
#     print(L[i+K*3-1]-L[i])
    ans = max(ans, L[i+K*3-1]-L[i])
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
S = list(str(input()))

count = 1
L = []
L.append(0)
for i in range(N):
    if i < N-1:
        if S[i] == S[i+1]:
            count += 1
        else:
            L.append(count)
            count = 1
    else:
        L.append(count)
        count = 1
L.append(0)

if S[0] == '1':
    ans = 0
    tmp = 0
    dist = 2 * (K + 1)
    for i in range(len(L)):
        tmp += L[i]
        if i % 2 == 1:
            if i - dist >= 0:
                tmp -= L[i-dist]
                tmp -= L[i-dist+1]
            ans = max(ans, tmp)
        else:
            if i == N - 1:
                ans = max(ans, tmp)
    print(ans)

if S[0] == '0':
    ans = 0
    tmp = 0
    dist = 2 * (K + 1)
    for i in range(len(L)):
        tmp += L[i]
        if i % 2 == 0:
            if i - dist + 1 >= 0:
                tmp -= L[i-dist+1]
            if i - dist >= 0:
                tmp -= L[i-dist]
            ans = max(ans, tmp)
        else:
            if i == N - 1:
                ans = max(ans, tmp)
    print(ans)
list = []
while True:
  line = raw_input().split(" ")
  if line[0] == 0 and line[1] == 0:
    break
  line = map(int, line)
  #print line
  if line[0] > line[1]:
    temp = line[0]
    line[0] = line[1]
    line[1] = temp
  print " ".join(map(str, line))

### FIXED CODE ###

list = []
while True:
  line = raw_input().split(" ")
  if line[0] == "0" and line[1] == "0":
    break
  line = map(int, line)
  #print line
  if line[0] > line[1]:
    temp = line[0]
    line[0] = line[1]
    line[1] = temp
  print " ".join(map(str, line))
n=int(input())
if n%2:
    print(0)
else:
    l=0
    n=n//2
    while n>0:
        l+=n//5
        n=n//5
print(l)

### FIXED CODE ###

n = int(input())
if n%2:
  print(0)
else:
  p=n//2
  l=0
  while p>0:
    l+=p//5
    p//=5
  print(l)
N = input()
Q = 0
for i in range(int(N)):
  P = []
  for j in range(len(str(i))):
    k= str(j)
    P.append(int(k[j]))
  if(sum(P)%3 == 0 and P[-1] == 0 or P[-1] == 5):
    Q += 0
  elif(sum(P)%3 == 0):
    Q += 0
  elif(P[-1] == 0 or L[-1] == 5):
    Q += 0
  else:
    Q += i
print(Q)

### FIXED CODE ###

N = int(input())
Q = 0
for i in range(1,N+1):
  if(i%3 != 0 and i%5 != 0):
      Q += i
print(Q)
N = int(input())
A = list(map(int, input().split()))

import collections
dic=dict(collections.Counter(A))
li=list(dic.values())

ans='No'

if len(li)==3:
    se=li[5]
    if N%3 == 0:
        if li[0]== N/3 and li[1]==N/3:
            ans='Yes'           
elif len(li)==2:
    if N%3 == 0:
        if li[0]== 2*N/3 or li[1]==2*N/3:
            ans='Yes'
elif len(li)==1:
        if list(dic.keys())[0]==0:
            ans='Yes'

print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
import sys
from collections import Counter

def main():
    N = int(input())
    a = list(map(int, input().split()))
    l = Counter(a)
    if len(l)==1 and 0 in l:
        print('Yes')
        exit()
    if N%3==0 and len(l)==2 and 0 in l and l[0] == N//3:
        print('Yes')
        exit()
    if N%3==0 and len(l)==3:
        x,y,z = l.keys()
        if l[x] == l[y] == N//3 and x^y^z == 0:
            print('Yes')
            exit()
    print('No')

    

if __name__ == '__main__':
    main()
k = int(input())

a = [[str(i) for i in range(1,10)]]
c = 9

for i in range(10) :
    b = []
    for s in a[i] :
        if s[-1] == '0' :
            b.append(s+'0')
            b.append(s+'1')
        elif s[-1] == '9' :
            b.append(s+'8')
            b.append(s+'9')
        else :
            b.append(s+str(int(s[-1])-1))
            b.append(s+str(int(s[-1])))
            b.append(s+str(int(s[-1])+1))

        if c + len(b) > k :
            print(b[k-c-len(b)-1])
            break
    
    if c + len(b) > k :
        break
    
    a.append(b)
    c += len(b)


### FIXED CODE ###

k = int(input())

a = [[str(i) for i in range(1,10)]]
c = 9

if k <= 12 :
    print(k)
else :
    for i in range(10) :
        b = []
        for s in a[i] :
            if s[-1] == '0' :
                b.append(s+'0')
                b.append(s+'1')
            elif s[-1] == '9' :
                b.append(s+'8')
                b.append(s+'9')
            else :
                b.append(s+str(int(s[-1])-1))
                b.append(s+str(int(s[-1])))
                b.append(s+str(int(s[-1])+1))

            if c + len(b) > k :
                print(b[k-c-len(b)-1])
                break
    
        if c + len(b) > k :
            break
    
        a.append(b)
        c += len(b)
n, m = [int(x) for x in input().split(' ')]

edges = set([tuple(input().split(' ')) for _ in range(n)])
edges.update([(x[1], x[0]) for x in list(edges)])


def dfs(node, history):
    ans = 0
    if len(history) == n - 1:
        print(history)
        return 1

    nextnodes = [
        x[1] for x in edges if x[1] not in history and x[0] == node and x[1] != node
    ]
    history.add(node)
    for next in nextnodes:
        ans += dfs(next, history)
    history.remove(node)
    return ans


print(dfs('1', set()))


### FIXED CODE ###

n, m = [int(x) for x in input().split(' ')]
 
edges = set([tuple(input().split(' ')) for _ in range(m)])
edges.update([(x[1], x[0]) for x in list(edges)])
 
 
def dfs(node, history):
    ans = 0
    if len(history) == n - 1:
        return 1
 
    nextnodes = [
        x[1] for x in edges if x[1] not in history and x[0] == node and x[1] != node
    ]
    history.add(node)
    for next in nextnodes:
        ans += dfs(next, history)
    history.remove(node)
    return ans
 
 
print(dfs('1', set()))
n,k=map(int, input().split())
p = list(map(int, input().split()))
a = [0 for i in range(n-k+1)]
for i in range(n-k+1):
    a[i](sum(p[i:i+k]))
print((max(a)+k)/2)


### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
r=[0]
for i in range(n):
    r.append(r[i]+p[i])
p=0
for i in range(k,n+1):
    p=max(p,r[i]-r[i-k])
print('{:.10f}'.format((p+k)/2))
A=int(input())
B=int(input())
C=int(input())
j=0
for i in range(C):
  j=j+1

### FIXED CODE ###

A,B,C = map(int,input().split())
if A+B >= C:
    print(B+C)
else:
    print(A+2*B+1)
fAIR, LATER, OCCASIONALLY CLOUDY.

### FIXED CODE ###

print(input().swapcase())
# C - Remainder Minimization 2019
import numpy as np

l, r = map(int, input().split())

a = np.arange(l, r+1)
a = a%2019
a = np.sort(a)

print((a[0]*a[1])%2019)

### FIXED CODE ###

# C - Remainder Minimization 2019
import numpy as np

l, r = map(int, input().split())

ans = 2019
for i in range(l,r):
    for j in range(i+1, r+1):
        ans = min(ans, (i*j)%2019)
        if ans==0:
            break
    else:
        continue
    break

print(ans)
dish = [int(input()) for i in range(5)]
a = [i%10 for i in dish]
x=10
for i in a:
  if i>0:
    x=min(x,i)
y = a.index(x)
l = dish.pop(y)

time = [(i//10+1)*10  if i%10 != 0 else i for i in dish ]

ans = sum(time) + l
print(ans)

### FIXED CODE ###

dish = [int(input()) for i in range(5)]
a = [i%10 for i in dish]

x=10
for i in a:
  if i>0:
    x=min(x,i)
if x ==10:
  x = 0
y = a.index(x)
l = dish.pop(y)

time = [(i//10+1)*10  if i%10 != 0 else i for i in dish]

ans = sum(time) + l
print(ans)
def get_answer(ki):
    n = int(ki[0].split(" ")[0])
    q = int(ki[0].split(" ")[1])
    n_data = [[int(k[0]), int(k[1])] for k in [k.split(" ") for k in ki[1:-q]]]
    q_data = [[int(k[0]), int(k[1])] for k in [k.split(" ") for k in ki[-q:]]]

    score = [0] * n

    for qq in q_data:
        index = qq[0]
        score[index - 1] += qq[1]
        add_score(score, qq, n_data, index)

    score = [str(s) for s in score]
    s = " ".join(score)

    return s


def add_score(score, qq, n_data, index):
    for nn in n_data:
        if nn[0] == index:
            score[nn[1] - 1] += qq[1]
            add_score(score, qq, n_data, nn[1])


if __name__ == "__main__":
    input_ki = []
    while True:
        input1 = input()
        if not input1:
            break;
        input_ki.append(input1)
    print(get_answer(input_ki))


### FIXED CODE ###

import collections

n,q=map(int,input().split())
cnt=[0]*(n+1)
g=[[] for _ in range(n+1)]
for _ in range(n-1): #木グラフの隣接リストを作成
 a,b=map(int,input().split())
 g[a].append(b)
 g[b].append(a)
for _ in range(q): #各頂点についてcount[v]を計算
 v,val=map(int,input().split())
 cnt[v]+=val
q=collections.deque()
q.append(1) #DFSのスタックによる実装、まずスタックに始点1を積む
checked=[0]*(n+1) #各頂点を見たかどうかのフラグを持っておく
while q:
 v=q.pop()
 checked[v]=1 #頂点を見たかどうかのフラグを更新する
 for u in g[v]:
   if checked[u]==1: #vの子ノードuについて、まだ見ていない頂点であればcount[u]をcount[u]+=count[v]として更新する
     continue
   cnt[u]+=cnt[v]
   q.append(u) #スタックに子ノードuを積む
print(*cnt[1:]) #各頂点のcountが答えとなる
a, b, c = input().split(" ")

print("YES" if b - a == c -b else "NO")


### FIXED CODE ###

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

print("YES" if b - a == c - b else "NO")
import math

n = int(raw_input())

print '{:d}'.format(math.factorial(n) % (math.pow(10,9) + 7))

### FIXED CODE ###

import math
 
n = int(raw_input())
mod = pow(10,9) + 7
ans = 1
for i in xrange(1,n+1):
  ans = (ans*i)%mod
 
print ans