Harryxun/stf_run huggingface dataset:
a = list(input())
s  = set(a)
if len(s) == 2 and a.count(s[0]) == a.count(s[1]):
  print('Yes')
else:
  print('No')

### FIXED CODE ###


a = input()
dic = {}
if len(set(a)) == 2:
    for i in range(len(a)):
        if a[i] not in dic:
            dic.setdefault(a[i], 1)
        else:
            dic[a[i]] += 1
            if dic[a[i]] > 2:
                print('No')
                break
    print('Yes')

else:
    print('No')
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(A, B))



### FIXED CODE ###

import math

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

def computeGCD(x, y): 
    if x > y: 
        small = y 
    else: 
        small = x 
    for i in range(1, small+1): 
        if((x % i == 0) and (y % i == 0)): 
            gcd = i 
              
    return gcd

def lcm(x, y):
    return (x * y) // computeGCD(x, y)

print(lcm(A, B))
from math import factorial as f
print(max(0,2-abs(n-m))*f(n)*f(m) % (10**9+7))

### FIXED CODE ###

import math

n, m = map(int, input().split())
if abs(n-m) == 0:
    print(2*math.factorial(n)*math.factorial(m) % 1000000007)
elif abs(n-m) == 1:
    print(math.factorial(n)*math.factorial(m) % 1000000007)
else:
    print(0)
import sys
input = sys.stdin.readline
n=int(input())
count = 0

L=list(range(400,2000,200))
val=len(L)
count=0
for i in range(val-1):
    if L[i]<=n<L[i+1]:
        ans=8-count
        break
    else:
        count+=1
print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
n=int(input())
count = 0

L=list(range(400,2001,200))
val=len(L)
ans = 0
for i in range(val-1):
    if L[i]<=n<L[i+1]:
        ans=8-count
        break
    else:
        count+=1
print(ans)
import sys
    sys.setrecursionlimit(10**8)
     
    def treetrace(i):
      score = [-1] * (n + 1)
      if src[i] == 0:
        return point[i]
      elif score[i] != -1:
        return score[i]
      else:
        score[i] = point[i] + treetrace(src[i])
        return score[i]
      
    tmp = list(map(int, (input().split())))
    n = tmp[0]
    q = tmp[1]
     
    src = [0] * (n + 1)
    for i in range(1, n):
      tmp = list(map(int, (input().split())))
      src[tmp[1]] = tmp[0]
     
    point = [0] * (n + 1)
    for i in range(1, q+1):
      tmp = list(map(int, (input().split())))
      point[tmp[0]] += tmp[1]
      
    for i in range(1, n + 1):
      print(treetrace(i), end=" ")

### FIXED CODE ###

tmp = list(map(int, (input().split())))
n = tmp[0]
q = tmp[1]

#edge = defaultdict(list)
edge = [[] for i in range(n+1)]
fixed = [False] * (n + 1)
fixed[1] = True
point = [0] * (n + 1)

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

for i in range(1, q+1):
  tmp = list(map(int, (input().split())))
  point[tmp[0]] += tmp[1]

que = []
que += edge[1]
frm = 1

while len(que) != 0:
  cur = que.pop()
  for i in edge[cur]:
    if fixed[i]:
      point[cur] += point[i]
    else:
      que.append(i)
  fixed[cur] = True

for i in range(1, n+1):
  print (point[i], end=" ")
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

def lcm(a, b):
  return a*b/gcd(a, b)

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


lcm_num = lcm(a[0], a[1])

for i in range(2, n):
    lcm_num = lcm(lcm_num, a[i])

ans = 0
for i in range(n):
    ans += (lcm_num-1) % a[i]

print(int(ans))
  


### FIXED CODE ###

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

# lcm_num = lcm(a[0], a[1])
# 
# for i in range(2, n):
#     lcm_num = lcm(lcm_num, a[i])

ans = 0
for i in range(n):
    ans += a[i] - 1

print(int(ans))
# Runtime Error
n=int(input())
a=[int(input())for _ in[0]*n]
s=[797161,265720,88573,29524,9841,3280,1093,364,121,40,13,4,1]
s=[v for v in s if v <= n]
c=0
for g in s:
 for i in range(n):
  v=a[i]
  j=i-g
  while j>=0 and a[j]>v:a[j+g]=a[j];j-=g;c+=1
  a[j+g]=v
print(len(s))
print(*s)
print(c)
print(*a,sep='\n')


### FIXED CODE ###

import sys
def insertionSort(A, n, g):
    global cnt
    for i in range(g, n):
        v = A[i]
        j = i - g
        while j >= 0 and A[j] > v:
            A[j + g] = A[j]
            j = j - g
            cnt += 1
        A[j + g] = v
def solve():
    n = int(input())
    A = list(map(int, sys.stdin))
    G = [int((2.25**i - 1) / 1.25)for i in range(17, 0, -1)]
    G = [v for v in G if v <= n]
    for g in G:
        insertionSort(A, n, g)
    print(len(G))
    print(*G)
    print(cnt)
    print('\n'.join(map(str, A)))
if __name__ == '__main__':
    cnt = 0
    solve()
print (int(input()) + int(input())//2)

### FIXED CODE ###

x, y = map(int, input().split())
print (x + y // 2)
a=int(input())
b=int(input())

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


### FIXED CODE ###

a,b = input().split()

if (int(a)*int(b))%2==0:
    print("Even")
else:
    print("Odd")
# D
N = 10**5
primes = set([])
is_prime = [True]*(N+1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, N+1):
    if is_prime[i]:
        primes.add(i)
        for j in range(2, N//i+1):
            is_prime[j*i] = False
    
# like-2017
cnt = [0]*(N+2)
for i in range(1, N+2):
    cnt[i] += cnt[i-1]
    if is_prime[i] and is_prime[(i+1)//2]:
        cnt[i] += 1
#print(cnt[:100])
    
Q = int(input())
for _ in range(Q):
    l,r = map(int, input().split())
    print(cnt[r]-cnt[l-1])

### FIXED CODE ###

# D
N = 10**5
primes = set([])
is_prime = [True]*(N+1)
is_prime[0] = False
is_prime[1] = False
for i in range(2, N+1):
    if is_prime[i]:
        primes.add(i)
        for j in range(2, N//i+1):
            is_prime[j*i] = False
    
# like-2017
cnt = [0]*(int(1e5)+2)
for p in primes:
    if (p+1)//2 in primes:
        cnt[p] = 1
for i in range(1, int(1e5)+2):
    cnt[i] += cnt[i-1]
#print(cnt[:100])
    
Q = int(input())
for _ in range(Q):
    l,r = map(int, input().split())
    print(cnt[r]-cnt[l-1])
n,a,b =map(int,input().split())
c = a+b

ans = n//c
l = n%c
if a>l:
  ans += l
else:
  ans += a
  
print(ans)

### FIXED CODE ###

a,b,c=input()
if a==b and b==c:
  print("No")
else:
  print("Yes")
if int("".join(list(map(int, input().split())))) % 4 == 0:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

if int("".join(list(map(str, input().split())))) % 4 == 0:
  print('YES')
else:
  print('NO')
N = int(input())
A = list(map(int, input().split()))

def dfs(A, k, cnt=0):
  s1, s2 = 0, 0
  for i in range(len(A)):
    if i <= N / 2:
      if A[k] > 1:
        A[k] -= 1
        cnt += 1
      s1 += A[i]
    else:
      if A[k] > 1:
        A[k] -= 1 
      s2 += A[i]
  if s1 == s2:
    return cnt
  if A[k] > 1:
    return dfs(A, k, cnt)
  else:
    return dfs(A, k + 1, cnt)

s = 0
for i in range(len(A)):
  s += A[i]
if s / 2 == 0:
  print(0)
  exit(0)
else:
  ans = dfs(A, 0)
  print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
total = sum(A)
mid = total // 2
sum_left, sum_left2 = 0, 0
seperation_i = 0
for i, l in enumerate(A[:-1]):
  sum_left += l
  if sum_left >= mid:
      seperation_i = i
      sum_left2 = sum_left - l
      break
sum_right, sum_right2 = sum(A[seperation_i + 1:]), sum(A[seperation_i:])
print(min(abs(sum_right - sum_left), abs(sum_right2 - sum_left2)))
# input
N, M = map(int, input().split())

# check
AC_questions = {}
for i in range(M):
    P, S = map(str, input().split())

    if P not in AC_questions:
        AC_questions[P] = {
            "wa_cnt": 0,
            "ac": False
        }

    if AC_questions[P]["wa_cnt"] is True:
        continue
    elif S == "AC":
        AC_questions[P]["ac"] = True
    # S == "WA"
    else:
        AC_questions[P]["wa_cnt"] += 1
        
AC_cnt = sum([1 for a in AC_questions if a['ac'] is True])
WA_cnt = sum([a["wa_cnt"] for a in AC_questions if a["ac"] is True])

print(AC_cnt, WA_cnt)

### FIXED CODE ###

# input
N, M = map(int, input().split())

# check
AC_questions = {}
for i in range(M):
    P, S = map(str, input().split())

    if P not in AC_questions:
        AC_questions[P] = {
            "wa_cnt": 0,
            "ac": False
        }

    if AC_questions[P]["ac"] is True:
        continue
    elif S == "AC":
        AC_questions[P]["ac"] = True
    # S == "WA"
    else:
        AC_questions[P]["wa_cnt"] += 1

AC_cnt = sum([1 for key in AC_questions.keys() if AC_questions[key]['ac'] is True])
WA_cnt = sum([AC_questions[key]["wa_cnt"] for key in AC_questions.keys() if AC_questions[key]["ac"] is True])

print(AC_cnt, WA_cnt)
import sys
n = int (input())
words = []
for i in range (n) :
    words.append(input())
for x in range(len(words)):
    if words.count(words[x]) > 1 or words[x+1][0] != words[x][-1]:
        print("No")
        sys.exit()
    else:
        "Yes"

### FIXED CODE ###

n = int(input())
l= []
x = 0
for elt in range(n):
    inp = input()
    l.append(inp)
for elt in range(len(l)):
    if l.count(l[elt]) > 1 :
        print("No")
        x+=1
        break

    else:
        if elt < len(l)-1:
            if l[elt][-1] != l[elt+1][0]:
                print("No")
                x += 1
                break
if x == 0:
    print("Yes")
N , M = map(int, input().split())

L=[[0]*2 for i in range(M)]

for i in range(M):
    L[i][0] , L[i][1] = map(int, input().split())

A=[0]*M
B=[0]*M

L=sorted(L ,key=lambda x: x[0])

for i in range(M):
    if L[i][0] == 1:
        A[i]=L[i][1]
    else:
        break
A=A[0:i]

L=sorted(L ,key=lambda x: -x[1])

for i in range(M):
    if L[i][1] == N:
        B[i]=L[i][0]
    else:
        break
B=B[0:i]

if((max(A)<min(B))or(max(B)<min(A))):
        print("IMPOSSIBLE")
        exit()

for i in B:
    if i == 10**10 : 
        print("IMPOSSIBLE")
        exit()
    if i in A:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")


### FIXED CODE ###

N , M = map(int, input().split())

L=[[0]*2 for i in range(M)]

for i in range(M):
    L[i][0] , L[i][1] = map(int, input().split())

A=[0]*M
B=[0]*M

L=sorted(L ,key=lambda x: x[0])

for i in range(M):
    if L[i][0] == 1:
        A[i]=L[i][1]
    else:
        break
A=A[0:i]

L=sorted(L ,key=lambda x: -x[1])

for i in range(M):
    if L[i][1] == N:
        B[i]=L[i][0]
    else:
        break
B=B[0:i]

if((len(A)==0)or(len(B)==0)):
    print("IMPOSSIBLE")
    exit()
if((max(A)<min(B))or(max(B)<min(A))):
    print("IMPOSSIBLE")
    exit()

A.sort()
B.sort()
i=0
j=0
while((i<len(A))and(j<len(B))):
    if A[i] == B[j]:
        print("POSSIBLE")
        exit()
    elif A[i] > B[j]:j+=1
    else:i+=1
print("IMPOSSIBLE")
from collections import defaultdict

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

g = defaultdict(list)
g2 = defaultdict(list)
done = [0] * (N+1)
memo = [0] * (N+1)
for x, y in xy:
    g[x].append(y)
    g2[y].append(x)

def dp_2(v):
    max_len = 0
    if done[v] == 1:
        return memo[v]
    
    for i in g2[v]:
        max_len = max(max_len, dp(i) + 1)
    done[v] = 1
    memo[v] = max_len
    return max_len
    
    
def dp(v):
    max_len = 0
    if done[v] == 1:
        return memo[v]
    else:
        for to in g[v]:
            max_len = max(max_len, dp(to)+1)
        done[v] = 1
        memo[v] = max_len
        return max_len

ans = 0
for v in range(1, N+1):
    ans = max(ans, dp2(v))
print(ans)

### FIXED CODE ###

from collections import defaultdict, deque

def topological_sort(vertex:list, edge:list):
    graph = {i: [] for i in vertex}
    for i, j in edge:
        graph[i].append(j)
        
    inp_cnt = defaultdict(int)
    outs = defaultdict(list)
    for inp, out in edge:
        inp_cnt[out] += 1
        outs[inp].append(out)

    result = []
    queue = deque([i for i in vertex if inp_cnt[i]==0])
    while queue:
        v = queue.popleft()
        result.append(v)
        for v2 in outs[v]:
            inp_cnt[v2] -= 1
            if inp_cnt[v2] == 0:
                queue.append(v2)
    return result

N, M = map(int, input().split())
vertex = list(range(1, N+1))
edge = [list(map(int, input().split())) for _ in range(M)]
graph = {i: [] for i in vertex}
for i, j in edge:
    graph[i].append(j)

sorted_vertecies = topological_sort(vertex, edge)
dp = [0] * (N+1)
for i in sorted_vertecies:
    ends = graph[i]
    for j in ends:
        dp[j] = max(dp[j], dp[i] + 1)
print(max(dp))
N, K = map(int, input().split())
P = list(map(int, input().split()))
C = list(map(int, input().split()))
c = [1] * N
m = [[0] * (N+1) for i in range(N)]
for i in range(N):
    m[i][1] = (C[P[i]-1])
for i in range(N):
    j = i
    while P[j]-1 != i:
        j = P[j]-1
        c[i] += 1
        m[i][c[i]] = m[i][c[i]-1] + C[P[j]-1]
ans = max(C)
for i in range(N):
    if m[i][c[i]] > 0:
        if  m[i][c[i]] * (K//c[i]) + max(m[i][1:K%c[i]+1]) > ans:
            ans = m[i][c[i]] * (K//c[i]) + max(m[i][1:K%c[i]+1])
    else:
        if max(m[i][1:min(c[i],K)+1]) > ans:
            ans = max(m[i][1:min(c[i],K)+1])
print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
P, C = [list(map(int, input().split())) for _ in range(2)]
c = [1] * N
m = [[0] * (N+1) for i in range(N)]
for i in range(N):
    m[i][1] = (C[P[i]-1])
ans = max(C)
for i in range(N):
    j = i
    while P[j]-1 != i:
        j = P[j]-1
        c[i] += 1
        m[i][c[i]] = m[i][c[i]-1] + C[P[j]-1]
    if m[i][c[i]] > 0:
        ans = max(ans, m[i][c[i]] * (K//c[i]-1) + max(m[i] + [m[i][c[i]] + m[i][j+1] for j in range(K%c[i])]))
    else:
        ans = max(ans, max(m[i][1:min(c[i],K)+1]))
print(ans)
N, K, *h = map(int, open(0).read().split())
h = sorted(h)
ans=float("inf")
for i in range(len(h)-k+1):
	ma = h[i+k-1]
	mi = h[i]
	ans = min(ans,ma-mi)

print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
ans=float("inf")
for i in range(len(h)-k+1):
	ma = h[i+k-1]
	mi = h[i]
	ans = min(ans,ma-mi)

print(ans)
スコード
m
1
import numpy
2
n = int(input())
3
m = list(map(int,input().split()))
4
s = 1
5
a = 0
6
if 0 in m:
7
  print(0)
8
  a =1
9
else:
10
  for i in range(n):
11
    s=s*m[i-1]
12
    if s>10**18:
13
      print(-1)
14
      a = 1
15
      break
16
if a == 0:
17
  print(s)
※ 512 KiB まで

### FIXED CODE ###

import numpy
n = int(input())
m = list(map(int,input().split()))
s = 1
a = 0
if 0 in m:
  print(0)
  a =1
else:
  for i in range(n):
    s=s*m[i-1]
    if s>10**18:
      print(-1)
      a = 1
      break
if a == 0:
  print(s)
def slove():
    import sys
    import collections
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    b = collections.Counter(list(map(int, input().rstrip('\n').split()))).most_common()
    aa = []
    bb = []
    for i in range(n):
        if a[i][1] % 2 != 0:
            aa.append(a[i][0])
        if b[i][1] % 2 != 0:
            bb.append(b[i][0])
    t = 0
    for av in a:
        for bv in b:
            t = t ^ (av + bv)
    print(t)


if __name__ == '__main__':
    slove()


### FIXED CODE ###

import sys
import bisect

readline = sys.stdin.buffer.readline
mod = 10 ** 9 + 7
n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))


def f(md):
    pos = n - 1
    res = 0
    for av in a:
        while True:
            if pos != -1 and av + b[pos] >= md:
                pos -= 1
            else:
                res += pos + 1
                break
    return res


def solve():
    dp = [0] * 31
    for i in range(28, -1, -1):
        md = pow(2, i + 1)
        for j in range(n-1, -1, -1):
            b[j] %= md
            a[j] %= md
        a.sort()
        b.sort()
        res1, res2, res3 = f(md // 2), f(md // 2 * 2), f(md // 2 * 3)
        dp[i] += (n - (res1 + res3 - res2)) % 2
    t = 0
    for i in range(31):
        t += pow(2, i) * (dp[i] % 2)
    print(t)


if __name__ == '__main__':
    solve()
import numpy as np

a=list(input))
b=list(input))
c=[]
for i in range(0,len(a)+len(b)):
    c=np.append(c,a[i]+b[i],axis=0)
print("c")

### FIXED CODE ###

a=list(input())
b=list(input())
d=""
for i in range(0,len(b)):
    c=a[i]+b[i]
    d=d+c

if len(b)+1 == len(a):
    d = d+ a[len(a)-1]

print(d)
from sys import stdout

cs = {
    1: [None] + list("abcde"),
    2: [None] + list("fghij"),
    3: [None] + list("klmno"),
    4: [None] + list("pqrst"),
    5: [None] + list("uvwxy"),
    6: [None] + list("z.?! "),
}

while True:
    try:
        it = iter(raw_input().strip())
    except ValueError:
        break

    try:
        r = c = None
        s = []
        while True:
            r = int(it.next())
            c = int(it.next())
            s += [cs[r][c]]
            r = c = None
    except KeyError:
        stdout.write("NA\n")
    except IndexError:
        stdout.write("NA\n")
    except StopIteration:
        if not r and not c:
            stdout.write(''.join(s) + "\n")
        else:
            stdout.write("NA\n")
        continue

### FIXED CODE ###

from sys import stdout

cs = {
    1: [None] + list("abcde"),
    2: [None] + list("fghij"),
    3: [None] + list("klmno"),
    4: [None] + list("pqrst"),
    5: [None] + list("uvwxy"),
    6: [None] + list("z.?! "),
}

while True:
    try:
        it = iter(raw_input().strip())
    except EOFError:
        break

    try:
        r = c = None
        s = []
        while True:
            r = int(it.next())
            c = int(it.next())
            s += [cs[r][c]]
            r = c = None
    except KeyError:
        stdout.write("NA\n")
    except IndexError:
        stdout.write("NA\n")
    except StopIteration:
        if not r and not c:
            stdout.write(''.join(s) + "\n")
        else:
            stdout.write("NA\n")
        continue
N=input()

import sympy
import math
import numpy as np
a=sympy.factorint(math.factorial(N))

a=np.array([a for a in a.values()])

print len(np.where(a>=74)[0])\
        +len(np.where(a>=24)[0])*(len(np.where(a>=2)[0])-1)\
        +len(np.where(a>=14)[0])*(len(np.where(a>=4)[0])-1)\
        +(len(np.where(a>=4)[0])*(len(np.where(a>=4)[0])-1)*(len(np.where(a>=2)[0])-2))/2

### FIXED CODE ###

N=input()
Ans=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 8, 8, 11, 11, 11, 11, 14, 14, 32, 32, 35, 35, 35, 35, 42, 42, 42, 42, 49, 49, 49, 49, 49, 49, 75, 75, 86, 86, 86, 86, 86, 86, 123, 123, 131, 131, 131, 131, 148, 148, 153, 153, 170, 170, 170, 170, 170, 170, 227, 227, 227, 227, 227, 227, 250, 250, 323, 323, 324, 324, 324, 324, 354, 354, 354, 354, 384, 384, 384, 384, 384, 391, 491, 491, 529, 529, 529, 529, 529, 529, 543]

print Ans[N]
s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)-1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      for j in range(len(t)):
        s[i+j] =  t[j]
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')



### FIXED CODE ###

s = input()[::-1]
t = input()[::-1]
for i,c in enumerate(s):
  if (c == t[0] or c == '?') and (i+len(t) < len(s)+1):
    for j in range(len(t)):
      if t[j] != s[i+j] and s[i+j] != '?':
        break
    else:
      str_list = list(s)
      for j in range(len(t)):
        str_list[i+j] =  t[j]
      s = ''.join(str_list)
      print(s.replace('?', 'a')[::-1])
      break
else:
  print('UNRESTORABLE')
N , L= map(int,input().split())
lst = list()
lst2 = ''
for i in range(L):
    lst.append(input())
for k in range(N):
    for j in range(N-1):
        if lst[j] > lst[j+1]:
            lst[j],lst[j+1] = lst[j+1] ,lst[j]

for M in range(L):
    lst2 += lst[M]
print(lst2)


### FIXED CODE ###

N,L=map(int, input().split())
S=[]
for i in range(N):
    S.append(input())
S.sort()
result=''
for j in range(N):
    result+=S[j]     
print(result)
today_weather = input('')

if today_weather = 'Sunny' :
	print('Cloudy')
elif today_weather = 'Cloudy' :
	print('Rainy')
else :
	print('Sunny')

### FIXED CODE ###

today_weather = input()

if today_weather == 'Sunny' :
	print('Cloudy')
elif today_weather == 'Cloudy' :
	print('Rainy')
else :
	print('Sunny')
N,M = map(int, input().split())
A = list(map(int,input().split())).sort()

for i in range(N):
	A[N] // 2
	A.sort()

B = sum(A)

print(B)

### FIXED CODE ###

N, M = map(int,input().split())
A = list(map(int,input().split()))

A.sort(reverse = True)
i = 0
for j in range(M):
	A[i] = A[i]//2
	if i <= N-2 and A[i] < A[i+1] and A[0] < A[i+1]:
		i += 1
	else :
		A.sort(reverse=True)
		i = 0
print(str(sum(A)))
x, k, d = map(int, input().split())
if x >= 0:
    if x - k * d >= 0:
        print(x - k * d)
    else:
        # 最初に負になってしまうところとその直前を巡回する
        ok, ng = k, 0
        while (ok - ng) > 1:
            mid = (ok + ng) // 2
            if x - mid * d <= 0:
                # いきすぎ
                ok = mid
            else:
                ng = mid
        # ok回目で負にたどり着く？
        rest = k - ok
        if rest % 2 == 0:
            # いまいるところに戻ってこれる
            print(abs(x - ok * d))
        else:
            # 一回正方向にいどうしたもの
            print(x - (ok - 1) * d)
else:
    if x + k * d <= 0:
        print(abs(x + k * d))
    else:
        # 最初に正になるところ
        ok, ng = ok, 0
        while (ok - ng) > 1:
            mid = (ng + ok) // 2
            if x + mid * k >= 0:
                ok = mid
            else:
                ng = mid
        rest = k - ok
        if rest % 2 == 0:
            print(x + ok * d)
        else:
            print(abs(x + (ok - 1) * d))

### FIXED CODE ###

x, k, d = map(int, input().split())
if x >= 0:
    if x - k * d >= 0:
        print(x - k * d)
    else:
        # 最初に負になってしまうところとその直前を巡回する
        ok, ng = k, 0
        while (ok - ng) > 1:
            mid = (ok + ng) // 2
            if x - mid * d <= 0:
                # いきすぎ
                ok = mid
            else:
                ng = mid
        # ok回目で負にたどり着く？
        rest = k - ok
        if rest % 2 == 0:
            # いまいるところに戻ってこれる
            print(abs(x - ok * d))
        else:
            # 一回正方向にいどうしたもの
            print(x - (ok - 1) * d)
else:
    if x + k * d <= 0:
        print(abs(x + k * d))
    else:
        # 最初に正になるところ
        ok, ng = k, 0
        while (ok - ng) > 1:
            mid = (ng + ok) // 2
            if x + mid * d >= 0:
                ok = mid
            else:
                ng = mid
        rest = k - ok
        if rest % 2 == 0:
            print(x + ok * d)
        else:
            print(abs(x + ok * d - d))
a, b, c = map(int, input().split())

if 4*a*b < (c-a-b)**2 ans c > a+b:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a, b, c = map(int, input().split())
 
if 4*a*b < (c-a-b)**2 and c > a+b:
  print("Yes")
else:
  print("No")
n,x = map(int,input().split())
l = list(map(int,input().split()))

ans = 0
d = 0
while 1:
    if d > x:
        break
    d += l[ans]
    ans += 1
print(ans)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))

ans = [0]
for i in range(n):
    ans.append(ans[i]+l[i])
count = 0
for i in ans:
    if i <= x:
        count += 1
print(count)
from collections import Counter
S = input()[::-1]
MOD = 2019

X = [0]

for i, s in enumerate(S):
    X.append((X[-1] + int(s) * pow(10, i, MOD)) %MOD)
    print(X)

C = Counter(X)
ans = 0

for v in C.values():
    ans += v * (v-1) // 2

print(ans)

### FIXED CODE ###

from collections import Counter
S = input()[::-1]
MOD = 2019

X = [0]
for i, s in enumerate(S):
    X.append((X[-1] + int(s) * pow(10, i, MOD)) % MOD)

C = Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)
while True:

  n = int(raw_input())

  if n == 0:
    break

  l = []

  for i in range(n):
    l.append(int(raw_input())

  print (sum(l) - max(l) - min(l)) / (len(l) - 2)

### FIXED CODE ###

while True:
    n = int(raw_input())

    if n == 0:
        break

    L = [int(raw_input()) for _ in range(n)]

    print (sum(L) - max(L) - min(L)) / (n - 2)
a = int(input())

if True == a.isupper():
  Print("A")
else :
  print("a")
  


### FIXED CODE ###

a = input()
 
if True == a.isupper():
  print("A")
else :
  print("a")