Harryxun/stf_run huggingface dataset:
from sys import stdin

str = stdin.readline().rstrip()

if str.islower():
    print('a')
else:
    print('A'from sys import stdin

str = stdin.readline().rstrip()

if str.islower():
    print('a')
else:
    print('A'

### FIXED CODE ###

import sys
from sys import stdin

str = sys.stdin.readline()

if str.islower():
    print('a')
else:
    print('A')
n = int(input())
s = 0
x = len(n)
for i in range(x):
  a = n[-1 * i]
  s = s+ a
  
if n%a == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

n = int(input())
sum = 0
ans = n

while ans > 0:
  sum += ans % 10
  ans //= 10

if n%sum == 0:
  print('Yes')
else:
  print('No')
n=int(input())
m=int(input())
if n>1:
    c=int((n*(n-1))/2)
else:
    c=int(0)
if m>1:
    d=int((m*(m-1))/2)
else:
    d=int(0)
print(c+d)


### FIXED CODE ###

n,m=map(int,input().split())
print((n*(n-1)+m*(m-1))//2)
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
N = A[0]
K = A[1]
count = 0
 
list = []

for i in range(N):
  for j in range(i,N):
    if B[i] > B[j]:
      count+=1

count = count*K
  
count = count%(10**9 + 7)
print(count)

### FIXED CODE ###

A = list(map(int, input().split()))
 
M = A[0]
D = A[1]
count = 0
 
for i in range(4,M+1):
  for j in range(22,D+1):
    day = list(str(j))
    m10 = int(day[0])
    m1 = int(day[1])
    if m10 < 2:
      continue
    elif m1 < 2:
      continue
    
    if i == m10 * m1:
      count+=1
    
  
 
print(count)
bw = [0] * (n + 1)

n = int(input())
tmp = list(map(int, input().split()))
u = tmp[0]
v = tmp[1]
w = tmp[2]

bw[u] = -1
if w % 2 == 0:
  bw[v] = -1
else:
  bw[v] = 1

for i in range(1,n-1):
  tmp = list(map(int, input().split()))
  u = tmp[0]
  v = tmp[1]
  w = tmp[2]

  if w%2 == 0:
    jdg = 1
  else:
    jdg = -1

  if bw[u] != 0:
      bw[v] = bw[u] * jdg
  else:
      bw[u] = bw[v] * jdg

for i in range(1,n+1):
  if bw[i] == -1:
    print('0')
  else:
    print('1')

### FIXED CODE ###

n = int(input())
bw = [0] * (n + 1)
uvw = [[] for _ in range (n+1)]

for i in range(0,n-1):
  tmp = list(map(int, input().split()))
  uvw[tmp[0]].append((tmp[1], tmp[2]))
  uvw[tmp[1]].append((tmp[0], tmp[2]))

#print(uvw)

nxt = [1]
bw[1] = 1

while len(nxt) != 0:
  cur = nxt.pop()
  while len(uvw[cur]) > 0:
    tmp = uvw[cur].pop()
    if tmp[1] % 2 == 0:
      jdg = 1
    else:
      jdg = -1

    if bw[tmp[0]] == 0:
#      print ('ADD NXT=' + str(tmp[0]) + ' JUDGE=' + str(jdg))
      bw[tmp[0]] = bw[cur] * jdg
      nxt.append(tmp[0])

for i in range(1,n+1):
  if bw[i] == -1:
    print('0')
  else:
    print('1')
def checkCanHalf(ary):
  for item in ary:
    if(item % 2 != 0):
      return False
  return True

n = range(int(input()))
ary = map(int, input().split())
cnt = 0

while checkCanHalf(ary) == True:
  for i in range(len(ary)):
    ary[i] = ary[i]/2
  cnt += 1

print(cnt)

### FIXED CODE ###

def checkCanHalf(ary):
  for item in ary:
    if(item % 2 != 0):
      return False
  return True

n = range(int(input()))
ary = list(map(int, input().split()))
cnt = 0

while checkCanHalf(ary) == True:
  for i in range(len(ary)):
    ary[i] = ary[i]/2
  cnt += 1

print(cnt)
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])

ans = float("INF")
for i in range(N):
    for j in range(i+K-1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for k in range(len(Y)):
            for l in range(i+K-1, N):
                H = Y[l] - Y[k]
                ans = min(ans, W*H)

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]

XY.sort(key=lambda x: x[0])

ans = float("INF")
for i in range(N):
    for j in range(i+K-1, N):
        W = XY[j][0] - XY[i][0]
        Y = [XY[x][1] for x in range(i, j+1)]
        Y.sort()
        for l, k in zip(Y, Y[K-1:]):
                H = k - l
                ans = min(ans, W*H)

print(ans)
import itertools

int_x = int(input())
answer = int_x
for i in range(1, int_x):
    for v in itertools.combinations(range(1, int_x + 1), i):
        if sum(v) == int_x:
            answer = min(answer, max(v))
print(answer)






### FIXED CODE ###

x = int(input())

w = 0
for i in range(1, x + 1):
    w += i
    if w >= x:
        print(i)
        exit(0)
n = int(input())
d,x = map(int,input().split())
a = [n]
count = x
for i in range(n):
  a[i] = int(input())
  count += d//a[i] + 1
print(count)
  
  

### FIXED CODE ###

n = int(input())
d,x = map(int,input().split())
count = x
a = [int(input()) for i in range(n)]
for i in range(n):
  j = 0
  while j * a[i] + 1 <= d:
    count += 1
    j += 1
print(count)
n, m = map(int, input().split())
s = [0]*m
c = [0]*m
num = ['']*n
for i in range(m):
    s[i], c[i] = map(int, input().split())
    if s[i]==1 and c[i]==0:
        print(-1)
        exit()
    elif num[s[i]-1] == '':
        num[s[i]-1] = c[i]
    elif num[s[i]-1] != c[i]:
        print(-1)
        exit()
for i in range(m):
    if num[i]=='':
        num[i] = 1
print(''.join(map(str,num)))

### FIXED CODE ###

from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, m = MAP()
ans = [-1]*n

for i in range(m):
    s, c = MAP()
    s -= 1
    if ans[s] == -1 or ans[s] == c:
        ans[s] = c
    else:
        print(-1)
        exit()

if ans[0] == 0:
    if n == 1:
        print(0)
    else:
        print(-1)
    exit()
else:
    for i in range(n):
        if ans[i] == -1:
            if n != 1 and i == 0:
                ans[i] = 1
            else:
                ans[i] = 0
    print(*ans, sep='')
n = int(input())

for _ in range(n):
  m, f, r = map(int,input().split())
  s = m+f

if s >= 80:
    print("A")
elif s >= 65 and s < 80:
    print("B")
elif (s >= 50 and s < 65) or f >= 50:
    print("C")
elif s >= 30 and s < 50:
    print("D")
else:
    print("F")


if m == f == r== -1:
    print("F")



### FIXED CODE ###

while True:
    m, f, r = map(int, input().split())
    if m == f == r== -1:
        break
    s = m + f
    if m == -1 or f == -1:
        print("F")
    elif s >= 80:
        print("A")
    elif s >= 65:
        print("B")
    elif s >= 50:
        print("C")
    elif s >= 30:
        if r >= 50:
            print("C")
        else:
            print("D")
    else:
        print("F")
import sys
sys.setrecursionlimit(10**6)

n = int(input())
A = list(map(int, input().split()))
INF = 10**9

dp = [[0]*2 for _ in range(n+1)]　# dp[i][0]がiを選んで反転させない場合の最大値, dp[i][1]がiを選んで反転させた場合の最大値

dp[0][0] = 0 
dp[0][1] = -INF

for i in range(1,n+1):
    dp[i][0] = max(dp[i-1][0]+A[i-1], dp[i-1][1]-A[i-1]) # iを選んで反転させない時、 i-1を選んで反転させていなかったらiはそのままで、i-1を反転させていたらiは反転する
    dp[i][1] = max(dp[i-1][0]-A[i-1], dp[i-1][1]+A[i-1]) # iを選んで反転させる時、i-1を選んで反転させていなかったらiは反転していて、i-1を反転させていたらiはそのまま

print(dp[n][0]) # nを選ぶことはできない（n+1が存在しない）ため、答えはdp[n][0]

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)

n = int(input())
a = list(map(int, input().split()))

flip_a = [0]*n
cnt_minus = 0

for i in range(n):
	if a[i] < 0:
		cnt_minus += 1
		flip_a[i] = -a[i]
	else:
		flip_a[i] = a[i]

flip_a.sort()

if cnt_minus%2 == 1:
	flip_a[0] = -flip_a[0]

print(sum(flip_a))
n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

for x in range(101):
    for y in range(101):
        h = [0,10**10]
        h_memo = 0
        for i in range(n):
            if xy[i][2] == 0:
                h[1] = min(h[1],abs(xy[0]-x) + abs(xy[1]-y))
            else:
                h_memo = xy[i][2] + abs(xy[i][0]-x) + abs(xy[i][1]-y)
            #print(x,y,h[1],h_memo)
            if h[0]!=0:
                if h_memo == h[0]:
                    continue
                elif h_memo != h[0]:
                    break
                elif h[1] < h[0]:
                    break
            elif h[0]==0 and h_memo!=0:
                h[0] = h_memo
            elif h==0 and h_memo==0:
                if h[1] < (abs(xy[0]-x) + abs(xy[1]-y)):
                    break
        else:               
            #print(x+1,y+1,h[0])
            if h[0]==0:
                continue
            else:
                print(x,y,h[0])

### FIXED CODE ###

n = int(input())
xy = [list(map(int,input().split())) for _ in range(n)]

for x in range(101):
    for y in range(101):
        h_memo = 0
        for i in range(n):
            if xy[i][2] != 0:
                h_memo = xy[i][2] + abs(xy[i][0]-x) + abs(xy[i][1]-y)
                break
        for i in range(n):
            if xy[i][2] != max(0,h_memo-abs(xy[i][0]-x)-abs(xy[i][1]-y)):
                break

        else:               
            #print(x+1,y+1,h[0])

            print(x,y,h_memo)
            break
#include <iostream>
#include <string>
using namespace std;
 
int main() {
  string s;
  getline(cin, s);
  for (int i=0;i<s.size();i++) {
    if (s[i] >= 'a' && s[i] <= 'z')
      s[i] += 'A' - 'a';
    else if (s[i] >= 'A' && s[i] <= 'Z')
      s[i] -= 'A' - 'a';
  }
  cout << s << endl;
}


### FIXED CODE ###

print(input().swapcase())
orz

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

money = 1000
for x, y in zip(a[:-1], a[1:]):
    if x < y:
        stocks = money // x
    else:
        stocks = 0
    money += (y - x) * stocks

print(money)
while 1:
    a = raw_input()
    if a == '':
        break
    if a == 'a' or a=='i' or a=='u' or a=='e' or a=='o':
        print 'vowel'
    else:
        print 'consonant'


### FIXED CODE ###

a = raw_input()
if a == 'a' or a=='i' or a=='u' or a=='e' or a=='o':
    print 'vowel'
else:
    print 'consonant'
N, Y = map(int, input().aplit())
boolean = False
for i in range(N+1):
    for j in range(N+1-i):
        if (Y - 10000 * i + 5000 * j) // 1000 == (N - i - j):
            boolean = True

if boolean:
    print(i, j, N - i - j)
else:
    print(-1, -1, -1)

### FIXED CODE ###

N, Y = map(int, input().split())
boolean = False
for i in range(N+1):
    if boolean:
        break
    for j in range(N+1-i):
        if (Y - 10000 * i - 5000 * j) / 1000 == (N - i - j):
            boolean = True
            print(i, j, N - i - j)
            break

if not boolean:
    print(-1, -1, -1)
n = int(input())
a = [input() for i in range(n)] 
ans =1
s = [a[0]]
 
for i in a[1:]:
    if not i in s:
        ans += 1
        s.append(i)
print(ans)

### FIXED CODE ###

import collections
N=int(input())
S=[]
for i in range(N):
    S.append(input())
s=collections.Counter(S)
s_key=s.keys()
print(len(s_key))
n = []
j = True

N, M = list(map(int, input().split()))
for i in range(N):
    n.append('W')

for i in range(M):
    s, c = list(map(int, input().split()))
    if n[s-1] == "W":
        n[s-1] = c
    elif n[s-1] >= c:
        n[s-1] = c
    elif  n[s-1] <= c:
        pass
    else:
        print(-1)
        j = False
        
if j == True:
    for i in range(3):
        if n[i] =="W":
            n[i] = 0
    if n[0] == 0:
        print(-1)
    else:
        print(''.join(map(str,n)))

### FIXED CODE ###

n = []

N, M = list(map(int, input().split()))
for i in range(N):
    n.append('W')

for i in range(M):
    s, c = list(map(int, input().split()))
    s -= 1
    if n[s] == "W":
        n[s] = c
    elif n[s] == c:
        pass
    else:
        print(-1)
        exit()
        
if N != 1:
    if n[0] == 0:
        print(-1)
        exit()
    
    if n[0] == "W":
        n[0] = 1
        
    for i in range(N):
        if n[i] =="W":
            n[i] = 0

else:
    if n[0] == "W":
        n[0] = 0
        
print(''.join(map(str,n)))
import sys

x, n = map(int, input().split())
p = set(map(int, input().split()))

if n == 0:
    print(x)
    sys.exit()

i = 1
while i < 103:
    left = x - i
    right = x + i
    if left not in p:
        print(left)
        sys.exit()
    elif right not in p:
        print(right)
        sys.exit()
    i += 1


### FIXED CODE ###

i = input().split()
print(i.index("0") + 1)
s = input()
n = len(s)

ans = [1]*n
for i,a in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = a[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)

### FIXED CODE ###

s = input()
n = len(s)

ans = [1]*n
for i,a in enumerate(s):
    if a =="R":
        a2 = s[i+1]
        if a2 =="R":
            ans[i+2] += ans[i]
            ans[i] = 0

for i in range(n-1,-1,-1):
    a = s[i]
    if a =="L":
        a2 = s[i-1]
        if a2 =="L":
            ans[i-2] += ans[i]
            ans[i] = 0
print(*ans)
n = int(input())
list = []
for i in range(n):
    a = str(input())
    if a in list:
        list.remove(a)
    else:
        list.append(a)
print(len(list))

### FIXED CODE ###

num = int(input())
if num % 10 == 9 or num // 10 == 9:
    print("Yes")
else:
    print("No")
s=input()
print(s[0]+str((len(s)-2)+s[-1])
               

### FIXED CODE ###

S = input()
T = len(S)-2
print(S[0]+ str(T) + S[-1])
import sys
input = sys.stdin.readline
n,q = map(int,input().split())
s = input().rstrip()
td = [list(input().rstrip().split()) for i in range(q)]
def judge(x,direction):
  if direction == "L":
    if x == n:
      return True
    if x == -1:
      return False
    jedge = lambda w: True if w>=0 else False
  else:
    if x == -1:
      return True
    if x == n:
      return False
    jedge = lambda w: True if w<n else False
  for i in range(q):
    if td[i][0] == s[x]:
      if td[i][1] == "R":
        x += 1
      else:
        x -= 1
    if jedge(x) == False:
      return False
  return True
l = -1
r = n
while l+1<r:
  m = (l+r)//2
  if judge(m,"L"):
    r = m
  else:
    l = m
ansl = r
l = -1
r = n
while l+1<r:
  m = (l+r)//2
  if judge(m,"R"):
    l = m
  else:
    r = m
ansr = l
print(max(0,ansr-ansl+1))


### FIXED CODE ###

import sys
input = sys.stdin.readline
n,q = map(int,input().split())
s = input().rstrip()
td = [list(input().rstrip().split()) for i in range(q)]
def judge(x,direction):
  if direction == "L":
    if x == n:
      return True
    if x == -1:
      return False
    jpos = lambda w: True if w>=0 else False
  else:
    if x == -1:
      return True
    if x == n:
      return False
    jpos = lambda w: True if w<n else False
  for i in range(q):
    if td[i][0] == s[x]:
      if td[i][1] == "R":
        x += 1
      else:
        x -= 1
    if jpos(x) == False:
      return False
    if not 0<=x<n:
      return True
  return True
l = -1
r = n
while l+1<r:
  m = (l+r)//2
  if judge(m,"L"):
    r = m
  else:
    l = m
ansl = r
l = -1
r = n
while l+1<r:
  m = (l+r)//2
  if judge(m,"R"):
    l = m
  else:
    r = m
ansr = l
print(max(0,ansr-ansl+1))
if N = 1:
  print("Hello Wowld")
elif N = 2:
  print A + B
else:
  exit if


### FIXED CODE ###

N = int(input())
if N == 1:
    print("Hello World")
elif N == 2:
    A = int(input())
    B = int(input())
    print(A + B)
a, b = map(int, input().split())
print("Even" if a*b % 2 == else "Odd")

### FIXED CODE ###

a, b = map(int, input().split())
print("Even" if a*b % 2 == 0 else "Odd")
d = {}

for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

for i in range(q):
    b,c = map(int, input().split())
    if b in d:
        sums += d[b]*(c-b)
        if c in d:
          d[c] += d[b]
        else:
          d[c] = d[b]
  
    print(sums)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
sums = sum(a)
d = {}

for i in a:
  if i in d:
    d[i] += 1
  else:
    d[i] = 1

for i in range(q):
    b,c = map(int, input().split())
    if b in d:
        sums += d[b]*(c-b)
        if c in d:
          d[c] += d[b]
        else:
          d[c] = d[b]
        d[b] = 0
    print(sums)
# coding=utf-8
# a,b = map(int, raw_input().split())

# x,a,b = map(int, input().split())
# if abs(x-a) < abs(x-b):
#     print('A')
# else :
#     print('B')


hoge = [0] * 26
a = ord('a')
string = input()
for i in range(len(string)):
    hoge[ord(string[i])-a] = 1

for i in range(26):
    if hoge[i] == 0:
        print(chr(i+a))
        break
    if i == 25:
        print('None')

### FIXED CODE ###

hoge = [0] * 26
a = ord('a')
string = input()
for i in range(len(string)):
    hoge[ord(string[i])-a] = 1

for i in range(26):
    if hoge[i] == 0:
        print(chr(i+a))
        break
    if i == 25:
        print('None')
input()
A=list(map(int,input().split()))
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)

### FIXED CODE ###

input()
A=list(map(int,input().split()))
ans=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    ans+=1
print(ans)
import math
a,b,h,m = map(int, input().split())
ans = math.sqrt(float(a)**2+float(b)**2-2*a*b*math.cos((h/12 + m/720 - m/60)*math.pi*2))
print(ans)

### FIXED CODE ###

def resolve():
    n = list(input())
    target = int(n[-1])
    if target in [2,4,5,7,9]:
        print('hon')
    elif target in [0,1,6,8]:
        print('pon')
    else:
        print('bon')
resolve()
n = input()
s1 = map(int,input().split())
print(type(sl))

### FIXED CODE ###

import math

n = int(input())
p = list(map(int, input().split()))

q = list(map(int, input().split()))

ord1 = 0
flag = [0] * (n+1)
for i in range(n-1):
	ln = 0
#	print(type(p[i]), p[i])
	for c in range(1,p[i]):
		if flag[c] == 0:
			ln = ln + 1 
	flag[p[i]] = 1
	ord1 = ord1 + ln * math.factorial(n-1-i)
#	print(ln,  math.factorial(ln))
ord1 = ord1+1 
#print(ord1)
  
ord2 = 0
flag = [0] * (n+1)
for i in range(n-1):
	ln = 0
#	print(type(q[i]), q[i])
	for c in range(1,q[i]):
		if flag[c] == 0:
			ln = ln + 1 
	flag[q[i]] = 1
	ord2 = ord2 + ln * math.factorial(n-1-i)
#	print(ln,  math.factorial(ln))
ord2 = ord2+1 
#print(ord2)

print(abs(ord2 - ord1))
n=int(input())
p=list(map(int,input().split()))
cnt=0
for i in range(n):
    if p[i]==i+1:
        cnt+=1
        x=1
        while True:
            if p[i+x]!=i+1:
                temp_v=p[i+x]
                p[i+x]=p[i]
                p[i]=temp_v
                break
            else:
                x+=1
print(cnt)

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
cnt=0
for i in range(n):
    if p[i]==i+1:
        cnt+=1
        x=1
        if i==n-1:
            break
        while True:
            if p[i+x]!=i+1:
                temp_v=p[i+x]
                p[i+x]=p[i]
                p[i]=temp_v
                break
            else:
                x+=1
print(cnt)
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    w = input()
    print("#"+w+"#")
print("#"*(w+2))
    

### FIXED CODE ###

h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    t = input()
    print("#"+t+"#")
print("#"*(w+2))
n = int(input())
x = 800*n
b = n%15
if b == 0:
  y = 200*b
print(x-y)

### FIXED CODE ###

n = int(input())
x = 800*n
y = 200*(int(n/15))
print(x-y)
A, B, C = map(int, input().split())
K = int(input())

for i in range(K):
    if A > B:
        B = B * 2
    else:
        Ak = i
        break

for j in range(K - Ak):
    if B > C:
        C = C * 2

if A < B and B < C:
    print("Yes")
else:
    print("No")



### FIXED CODE ###

A, B, C = map(int, input().split())
K = int(input())
Ak = 0

for i in range(K):
    if A >= B:
        B = B * 2
        Ak = i + 1
    else:
        break

if K - Ak > 0:
    for j in range(K - Ak):
        if B >= C:
            C = C * 2
else:
    print("No")
    exit()

if A < B and B < C:
    print("Yes")
else:
    print("No")
from collections import deque

H,W=map(int,input().split())
count=0
S=[['#']*(W+1) for _ in range(H+1)]
for i in range(1,H+1):
    S_comp=list(str(input()))
    for j in range(1,W+1):
        if S_comp[j-1]=='.':
            count+=1
        S[i][j]=S_comp[j-1]


def sur(v):  #v is tuple
    vx=v[0]
    vy=v[1]
    preE=[(vx-1,vy),(vx+1,vy),(vx,vy-1),(vx,vy+1)]
    E=[]
    for nv in preE:
        if 1<=nv[0]<=H and 1<=nv[1]<=W:
            if S[nv[0]][nv[1]]=='.':
                E.append(nv)
    return E

q=deque()
s=(1,1)
g=(H,W)
q.append(s)
dist=[[-1]*(W+1) for k in range(H+1)]
dist[s[0]][s[1]]=0

while q:
    now=q.popleft()
    for next in sur(now):
        if dist[next[0]][next[1]]!=-1:
            continue
        q.append(next)
        dist[next[0]][next[1]]=dist[now[0]][now[1]]+1
        if next==g:
            ans=dist[g[0]][g[1]]
            break
    else:
        continue
    break

print(count-1-ans)






### FIXED CODE ###

from collections import deque

H,W=map(int,input().split())
count=0
S=[['#']*(W+1) for _ in range(H+1)]
for i in range(1,H+1):
    S_comp=list(str(input()))
    for j in range(1,W+1):
        if S_comp[j-1]=='.':
            count+=1
        S[i][j]=S_comp[j-1]


def sur(v):  #v is tuple
    vx=v[0]
    vy=v[1]
    preE=[(vx-1,vy),(vx+1,vy),(vx,vy-1),(vx,vy+1)]
    E=[]
    for nv in preE:
        if 1<=nv[0]<=H and 1<=nv[1]<=W:
            if S[nv[0]][nv[1]]=='.':
                E.append(nv)
    return E

q=deque()
s=(1,1)
g=(H,W)
q.append(s)
dist=[[-1]*(W+1) for k in range(H+1)]
dist[s[0]][s[1]]=0

while q:
    now=q.popleft()
    for next in sur(now):
        if dist[next[0]][next[1]]!=-1:
            continue
        q.append(next)
        dist[next[0]][next[1]]=dist[now[0]][now[1]]+1
        if next==g:
            ans=dist[g[0]][g[1]]
            print(count-1-ans)
            break
    else:
        continue
    break
else:
    print(-1)
N=int(input())
S=str(N)
s = ""
for i in range(3):
    s = S[len(S)-1-i] + s

n = int(s)
ans = 1000 - n
if ans == 1000:
    ans = 0

print(ans)

### FIXED CODE ###

N=int(input())
S=str(N)
s = ""
if N <1000:
    ans = 1000 - N
    print(ans)
    exit()
for i in range(3):
    s = S[len(S)-1-i] + s

n = int(s)
ans = 1000 - n
if ans == 1000:
    ans = 0

print(ans)
!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, K: int):
    ans=0
    sub=K
    if A>K:
        ans+=1*K
        sub-=K
    else:
        ans+=1*A
        sub-=A
    if sub!=0:
        if B>sub:
            sub=0
        else:
            sub-=B
    if sub!=0:
        ans-=sub
    print(ans)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, C, K)

if __name__ == '__main__':
    main()

### FIXED CODE ###

A,B,C,K=map(int,input().split())
ans=0
sub=K
if A>K:
    ans+=1*K
    sub-=K
else:
    ans+=1*A
    sub-=A
if sub!=0:
    if B>sub:
        sub=0
    else:
        sub-=B
if sub!=0:
    ans-=sub
print(ans)
import math
print(math.factorial(N)%(10**9+7))

### FIXED CODE ###

import math
print(math.factorial(int(input()))%(10**9+7))
n = int(input())
s = list(map(int,input().split()))
S = s.sort(reverse=True)
A = S[0:n+1:2]
B = S[1:n+1:2]
sum_A = sum(A)
sum_B = sum(B)
print(sum_A - sum_B)




### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)