Harryxun/stf_run huggingface dataset:
x,k,d = [int(i) for i in input().split()]
for i in range(k):
  x+=d if x<0 else -d
  if abs(x)<d:
    x=(abs(x)-d)*x/abs(x) if (k-1-i)&1==1 else x
    break
print(x)

### FIXED CODE ###

x,k,d = [int(i) for i in input().split()]
x=abs(x)
x=x-k*d if x>=k*d else abs(x%d-(k-x//d)%2*d)
print(x)
A, B, K = map(int, input().split())
N = B - A + 1
nums = list(range(A, B + 1))
ans = set()

for i in range(min(K, N)):
    ans.add(nums[i])

nums.reverse()
for i in range(min(K, N)):
    ans.add(nums[i])


ans = list(ans)
ans.sort()
for i in ans:
    print(i)


### FIXED CODE ###

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

ans = set()
for i in range(A, min(B + 1, A + K)):
    ans.add(i)

for i in range(max(A, B - K + 1), B + 1):
    ans.add(i)
ans = sorted(list(ans))
for i in ans:
    print(i)
w,h,x,y = map(int,input().split())

hx = h * x
hx2 = h * (w-x)
wy = w * y
wy2 = w * (h-y)

if(hx > hx2) :
    d1 = hx2
else :
    d1 = hx

if(wy > wy2) :
    d2 = wy2
else :
    d2 = wy


if(d1 == d2) :
    ff = 0
else :
    ff = 0

if(d1 > d2) :
    print(str(d1) + " " + str(ff))
else :
    print(str(d2) + " " + str(ff))

### FIXED CODE ###

x,a = map(int,input().split())
if ( x < a ) :
    print(0)
else :
    print(10)
a = int(input())
b = int(input())
c = int(input())
print((a+b)*h/2)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
print(int((a+b)*c/2))
a = int(input())
b=int(input())
ans =max(a-b*2,0)
print(ans)

### FIXED CODE ###

A,B = map(int,input().split())
curtain = int(B*2)
if A > curtain:
    ans = A - curtain
else:
    ans = 0
print(ans)
A,B,H,M = map(int,input().split(' '))
# 30: 12h/360° 6:  60min/360°
theta = abs((30 * H + 30 * M / 60)- 6 * M)
if(theta > 180):
    theta -= 180
elif(theta == 180):
    print(A + B)
    return
print(math.sqrt(A**2 + B**2 - 2 * A * B * math.cos(math.radians(theta))))


### FIXED CODE ###

from math import (pi,cos,sqrt,radians)

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

    # 長針、短針の0時0分からの角度を求める
    HTheta = H/12 * 360 + 1/12 * (M/60) *  360
    MTheta = M/60 * 360
    # |長針-短針|で角度θを求める
    Theta = abs(HTheta - MTheta) 
    # θ=180ならA+Bを出力して終了
    if Theta == 180:
        print(A + B)
        return
    # 予言定理を求める
    print(sqrt(A*A + B*B - 2*A*B*cos(radians(Theta))))

main()
def actual(n, a, b):
    s = ''

    # 無限ループにはならない前提
    while True:
        s += '青' * a + '赤' * b

        if len(s) >= n:
            return s[:n].count('青')

n, a, b = map(int, input().split())
print(actual(n, a, b))


### FIXED CODE ###

def actual(n, a, b):
    n_op_least = n // (a + b)

    n_blue_least = a * n_op_least
    adjustment = min(n % (a + b), a)

    return n_blue_least + adjustment

n, a, b = map(int, input().split())
print(actual(n, a, b))
import randam
n = map(int, open(0).read().split())
for i in range(365):
  print(random.randint(1, 26))

### FIXED CODE ###

#!/usr/bin/env python3
import random
n, *a = map(int, open(0).read().split())
for i in range(n):
    print(random.randint(1, 26))
N,M = map(int,input().split())
XYZ = [[int(x) for x in input().split()] for _ in range(M)]

par = [i for i in range(N)]
rank = [0]*N


def root(x):
    tmp = x
    while par[tmp]!=tmp:
        tmp = par[tmp]
    return tmp

def urite(x,y):
    rx = root(x)
    ry = root(y)
    if rx==ry:
        return
    if rank[rx] < rank[ry]:
        rx,ry = ry,rx
    if rank[rx] == rank[ry]:
        rank[rx] += 1
    par[ry] = rx

for xyz in XYZ:
    urite(x,y)

ans = 0
for i in N:
    if par[i] == i:
        ans += 1
print(ans)


### FIXED CODE ###

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

par = [i for i in range(N)]
rank = [0]*N


def root(x):
    tmp = x
    while par[tmp]!=tmp:
        tmp = par[tmp]
    return tmp

def unite(x,y):
    rx = root(x)
    ry = root(y)
    if rx==ry:
        return
    if rank[rx] < rank[ry]:
        rx,ry = ry,rx
    if rank[rx] == rank[ry]:
        rank[rx] += 1
    par[ry] = rx

for x,y,z in XYZ:
    unite(x-1,y-1)

ans = 0
for i in range(N):
    if par[i] == i:
        ans += 1
print(ans)
H, W = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(H)]
visited = [[True]*(W+2)] + [[True]+[False]*W+[True] for _ in range(H)] + [[True]*(W+2)]

dirs = [
  (1, 0),
  (0, 1),
  (-1, 0),
  (0, -1)
]
direction = 0
x, y = 1, 1
carry = 0
ans = []
while not visited[y][x]:
  visited[y][x] = True
  m[y-1][x-1] += carry
  if carry:
    ans[-1] += [y, x]

  carry = m[y-1][x-1] % 2
  if carry:
    ans.append([y, x])
    m[y-1][x-1] -= 1 # 別にいらない

  # 今の向きに進めないなら右に曲がる
  nx, ny = x + dirs[direction][0], y + dirs[direction][1]
  if visited[ny][nx]:
    direction = (direction + 1) % 4
  x += dirs[direction][0]
  y += dirs[direction][1]

if len(ans[-1]) < 4:
  y, x = ans.pop()
  m[y-1][x-1] += 1 # もどす

print(len(ans))
for a in ans:
  print(' '.join(list(map(str, a))))

### FIXED CODE ###

H, W = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(H)]
visited = [[True]*(W+2)] + [[True]+[False]*W+[True] for _ in range(H)] + [[True]*(W+2)]

dirs = [
  (1, 0),
  (0, 1),
  (-1, 0),
  (0, -1)
]
direction = 0
x, y = 1, 1
carry = 0
ans = []
while not visited[y][x]:
  visited[y][x] = True
  m[y-1][x-1] += carry
  if carry:
    ans[-1] += [y, x]

  carry = m[y-1][x-1] % 2
  if carry:
    ans.append([y, x])
    m[y-1][x-1] -= 1 # 別にいらない

  # 今の向きに進めないなら右に曲がる
  nx, ny = x + dirs[direction][0], y + dirs[direction][1]
  if visited[ny][nx]:
    direction = (direction + 1) % 4
  x += dirs[direction][0]
  y += dirs[direction][1]

if len(ans) > 0 and len(ans[-1]) < 4:
  y, x = ans.pop()
  m[y-1][x-1] += 1 # もどす

print(len(ans))
for a in ans:
  print(' '.join(list(map(str, a))))
import math
from bisect import bisect
x1,y1,x2,y2 = map(int,input().split())
N = int(input())
src = [tuple(map(int,input().split())) for i in range(N)]
src.sort()
if x1 > x2:
    x1,x2 = x2,x1
    y1,y2 = y2,y1

arc = 5 * math.pi

if x1 == x2:
    if y1 > y2:
        y1,y2 = y2,y1
    ans = 100 * (y2-y1)
    for x,y in src:
        if x == x1 and y1 < y < y2:
            ans += arc*2 - 20
            break
    print(ans)
    exit()

if y1 == y2:
    if x1 > x2:
        x1,x2 = x2,x1
    ans = 100 * (x2-x1)
    for x,y in src:
        if y == y1 and x1 < x < x2:
            ans += arc*2 - 20
            break
    print(ans)
    exit()

assert x1 < x2

if y1 < y2:
    lis = []
    for x,y in src:
        if x < x1: continue
        if x > x2: break
        if not y1 <= y <= y2: continue
        i = bisect(lis, y)
        if i == len(lis):
            lis.append(y)
        else:
            lis[i] = y
    ans = 100 * (x2-x1 + y2-y1)
    ans += len(lis) * (arc - 20)
    print(ans)
else:
    lds = []
    for x,y in src:
        if x < x1: continue
        if x > x2: break
        if not y2 <= y <= y1: continue
        if i == 0:
            lds.append(y)
        else:
            lds[-i] = y
    ans = 100 * (x2-x1 + y1-y2)
    ans += len(lds) * (arc - 20)
    print(ans)

### FIXED CODE ###

import math
from bisect import bisect
x1,y1,x2,y2 = map(int,input().split())
N = int(input())
src = [tuple(map(int,input().split())) for i in range(N)]
src.sort()
if x1 > x2:
    x1,x2 = x2,x1
    y1,y2 = y2,y1

arc = 5 * math.pi

if x1 == x2:
    if y1 > y2:
        y1,y2 = y2,y1
    ans = 100 * (y2-y1)
    for x,y in src:
        if x == x1 and y1 < y < y2:
            ans += arc*2 - 20
            break
    print(ans)
    exit()

if y1 == y2:
    if x1 > x2:
        x1,x2 = x2,x1
    ans = 100 * (x2-x1)
    for x,y in src:
        if y == y1 and x1 < x < x2:
            ans += arc*2 - 20
            break
    print(ans)
    exit()

if y1 < y2:
    lis = []
    for x,y in src:
        if x < x1: continue
        if x > x2: break
        if not y1 <= y <= y2: continue
        i = bisect(lis, y)
        if i == len(lis):
            lis.append(y)
        else:
            lis[i] = y
    ans = 100 * (x2-x1 + y2-y1)
    if len(lis) in (x2-x1+1, y2-y1+1):
        ans += (len(lis)-1) * (arc - 20)
        ans += arc*2 - 20
    else:
        ans += len(lis) * (arc - 20)
    print(ans)
else:
    lds = []
    for x,y in src:
        if x < x1: continue
        if x > x2: break
        if not y2 <= y <= y1: continue
        i = bisect(lds, -y)
        if i == len(lds):
            lds.append(-y)
        else:
            lds[i] = -y
    ans = 100 * (x2-x1 + y1-y2)
    if len(lds) in (x2-x1+1, y1-y2+1):
        ans += (len(lds)-1) * (arc - 20)
        ans += arc*2 - 20
    else:
        ans += len(lds) * (arc - 20)
    print(ans)
a,b=int(input())
print(a*b)

### FIXED CODE ###

A,B=map(int,input().split())
print(A*B)
n = int(input().strip())
a = list(map(int, input().split()))
b = [a[i] - (i + 1) for i in range(n)]
b.sort()
mid = b[n // 2]
ans = 0
for i in range(n):
    ans += abs(b - mid)
print(ans)


### FIXED CODE ###

n = int(input().strip())
a = list(map(int, input().split()))
b = [(a[i] - (i + 1)) for i in range(n)]
b.sort()
mid = b[n // 2]
ans = 0
for i in range(n):
    ans += abs(b[i] - mid)
print(ans)
# def i():
#     yield "100000"
#     a = 0
#     b = 0
#     c = 0
#     l = []
#     for i in range(100000):
#         import random
#         r = random.randint(0, 2)
#         if r == 0:
#             l.append(str(a))
#             a += 1
#         elif r == 1:
#             l.append(str(b))
#             b += 1
#         else:
#             l.append(str(c))
#             c += 1
#     yield " ".join(l)
# input = i().__next__
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    cur = 1
    nums = []
    for i in range(N):
        if A[i] == 0:
            cur *= 1
            nums.append(0)
            continue
        #A[i] != 0
        cnt = 0
        for j, n in enumerate(nums):
            if n == A[i] - 1:
                if cnt == 0:
                    nums[j] += 1
                cnt += 1
        cur *= cnt
        cur %= 10**9+7
        # print(nums)
    m = [0, 3, 6, 6]
    
    print((cur * m[len(nums)]) % (10**9+7))
main()

### FIXED CODE ###

# def i():
#     yield "100000"
#     a = 0
#     b = 0
#     c = 0
#     l = []
#     for i in range(100000):
#         import random
#         r = random.randint(0, 2)
#         if r == 0:
#             l.append(str(a))
#             a += 1
#         elif r == 1:
#             l.append(str(b))
#             b += 1
#         else:
#             l.append(str(c))
#             c += 1
#     yield " ".join(l)
# input = i().__next__
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    cur = 1
    nums = []
    for i in range(N):
        if A[i] == 0:
            cur *= 1
            nums.append(0)
            continue
        #A[i] != 0
        cnt = 0
        for j, n in enumerate(nums):
            if n == A[i] - 1:
                if cnt == 0:
                    if len(nums) <= j:
                        print(0)
                        return
                    nums[j] += 1
                cnt += 1
        cur *= cnt
        cur %= 10**9+7
        # print(nums)
    m = [0, 3, 6, 6]
    if len(nums) >= 4:
        print(0)
        return
    
    print((cur * m[len(nums)]) % (10**9+7))
main()
import sys
l = map(int, raw_input().split())
if (l[0] * l[1]) % 2 == 0:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

import sys
l = list(map(int, input().split()))
if (l[0] * l[1]) % 2 == 0:
    print("No")
else:
    print("Yes")
A = list(map(int, input().split())) 
count = 0
ans = 0

for i in range(10):
    ans = (r*f) - D 
    count = count + 1
    print(ans)
    if(count == 10):
        break


### FIXED CODE ###

A = list(map(int, input().split())) 
r = A[0]
D = A[1]
f = A[2]
 
 
count = 0
ans = 0
 
for i in range(10):
    f = (r*f) - D 
    count = count + 1
    print(f)
    if(count == 10):
        break
def main():
    N, K = map(int, input().split())
    L = list(map(int, input().split()))
    L.sort(reverse=True)

    print(sum(L[:K]))

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()



### FIXED CODE ###

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

    if (A%3 == 0) or (B%3 == 0) or ((A+B)%3 == 0):
        print("Possible")
    else:
        print("Impossible")

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()
n,k=map(int,input().split())
edge=[]
mod=10**9+7
for i in range(n-1):
    a,b=map(int,input().split())
    edge.append([a-1,b-1])
root=[[] for i in range(n)]
for [a,b] in edge:
    root[a].append(b)
    root[b].append(a)
def perm(k,n):
    x=1
    if k-n+1<=0:
        return 0
    for i in range(k,k-n,-1):
        x=x*i%mod
    return x
def dfs(node,depth,prev): 
    l=len(root[node])
    d=depth
    x=1
    if l==0:
        return 1
    if l==1 and depth>1:
        return 1
    if depth>1:
        x=perm(k-d,l-1)
    else:
        x=perm(k-d,l)
    for y in root[node]:
        if y!=prev:
            x=x*dfs(y,min(depth+1,2),node)%mod
    return x
count=dfs(0,1,0)*k%mod
print(count if count>0 else 0)

### FIXED CODE ###

n,k=map(int,input().split())
mod=10**9+7
import sys
sys.setrecursionlimit(10**9)
root=[[] for i in range(n)]
for i in range(n-1):
    a,b=map(int,input().split())
    root[a-1].append(b-1)
    root[b-1].append(a-1)
def perm(k,n):
    x=1
    if k-n+1<=0:
        return 0
    for i in range(k,k-n,-1):
        x=x*i%mod
    return x
def dfs(node,depth,prev): 
    l=len(root[node])
    d=depth
    x=1
    if l==0:
        return 1
    if l==1 and depth>1:
        return 1
    if depth>1:
        x=perm(k-d,l-1)
    else:
        x=perm(k-d,l)
    for y in root[node]:
        if y!=prev:
            x=x*dfs(y,2,node)%mod
    return x%mod
count=dfs(0,1,0)*k%mod
print(count if count>0 else 0)
import sys
input=lambda: sys.stdin.readline().rstrip()
mod=10**9+7
n=int(input())
edge=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)
inf=float("inf")
Par=[inf]*n
Par[0]=-1
Chk=[0]
while Chk:
  c=Chk.pop()
  for next in edge[c]:
    if Par[next]==inf:
      Par[next]=c
      Chk.append(next)

C=[-1]*n
def ch(x):
  ret=0
  if x!=0 and len(edge[x])==1:
    C[x]=0
    return C[x]
  else:
    for e in edge[x]:
      if e==Par[x]:
        continue
      else:
        ret+=ch(e)+1
    C[x]=ret
    return C[x]
ch(0)

H=[0]*n
H[0]=1
H[1]=pow(2,mod-2,mod)
for i in range(2,n):
  H[i]=(H[i-1]*H[1])%mod

ans=0
for i in range(n):
  if len(edge[i])==1:
    continue
  else:
    A=[]
    for e in edge[i]:
      if e==Par[i]:
        A.append(n-1-C[i])
      else:
        A.append(C[e]+1)
    cur=1+(len(edge[i])-1)*H[-1]
    for a in A:
      cur=(cur-H[n-1-a])%mod
    ans=(ans+cur)%mod
print((ans*H[1])%mod)

### FIXED CODE ###

import sys
input=lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(200000)
mod=10**9+7
n=int(input())
edge=[[] for i in range(n)]
for i in range(n-1):
  a,b=map(int,input().split())
  edge[a-1].append(b-1)
  edge[b-1].append(a-1)
inf=10**6
Par=[inf]*n
Par[0]=-1
Chk=[0]
while Chk:
  c=Chk.pop()
  for next in edge[c]:
    if Par[next]==inf:
      Par[next]=c
      Chk.append(next)

C=[-1]*n
def ch(x):
  ret=0
  if x!=0 and len(edge[x])==1:
    C[x]=0
    return C[x]
  else:
    for e in edge[x]:
      if e==Par[x]:
        continue
      else:
        ret+=ch(e)+1
    C[x]=ret
    return C[x]
ch(0)

H=[0]*n
H[0]=1
H[1]=pow(2,mod-2,mod)
for i in range(2,n):
  H[i]=(H[i-1]*H[1])%mod

ans=0
for i in range(n):
  if len(edge[i])==1:
    continue
  else:
    A=[]
    for e in edge[i]:
      if e==Par[i]:
        A.append(n-1-C[i])
      else:
        A.append(C[e]+1)
    cur=1+(len(edge[i])-1)*H[-1]
    for a in A:
      cur-=H[n-1-a]
    ans=(ans+cur)%mod
print((ans*H[1])%mod)
n, k = map(int, input().split())
a = [int(i) for i in input().split()]

lst = [1]
visit_now = 1

visit_list = [0] * n
visit_list[0] = 1
while True:
    visit_now = a[visit_now - 1]
    if visit_list[visit_now - 1] == 1:
        break
    lst.append(visit_now)


start = lst.index(visit_now)
loop_num = n - start - 1
lst = lst[start:]

k -= start
k %= loop_num

print(lst[k])
# print(lst, loop_num, loop_list, k)

### FIXED CODE ###

n, k = map(int, input().split())
a = [int(i) for i in input().split()]


lst = []
visit_now = 1
visit_list = [-1] * (n + 1)
cnt = 0

while visit_list[visit_now - 1] == -1:
    visit_list[visit_now - 1] = cnt
    lst.append(visit_now)
    visit_now = a[visit_now - 1]
    cnt += 1

start = visit_list[visit_now - 1]
loop_num = cnt - start

if k <= start:
    ans = lst[k]
else:
    k -= start
    k %= loop_num
    ans = lst[start + k]

print(ans)
import math

t = int(input())
abcd = []
for i in range(t):
    abcd.append(list(map(int, input().split())))

for i in range(t):
    if abcd[i][0] < abcd[i][1]:
        print("No")
    elif abcd[i][1] > abcd[i][3]:
        print("No")
    elif abcd[i][3] % abcd[i][1] == 0:
        if abcd[i][0] % abcd[i][1] > abcd[i][2]:
            print("No")
        else:
            print("Yes")
    else:
        gcd = math.gcd(abcd[i][1], abcd[i][3])
        if abcd[i][1] - gcd <= abcd[i][2]:
            print("Yes")
        else:
            print("No")

### FIXED CODE ###

import math

t = int(input())
abcd = []
for i in range(t):
    abcd.append(list(map(int, input().split())))

for i in range(t):
    if abcd[i][0] < abcd[i][1]:
        print("No")
    elif abcd[i][1] > abcd[i][3]:
        print("No")
    elif abcd[i][3] % abcd[i][1] == 0:
        if abcd[i][0] % abcd[i][1] > abcd[i][2]:
            print("No")
        else:
            print("Yes")
    else:
        big, small = abcd[i][1], abcd[i][3]
        while big % small:
            big, small = small, big % small
        gcd = small
        if abcd[i][1] - gcd <= abcd[i][2]:
            print("Yes")
        else:
            print("No")
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())

N = int(input())
xx = inpl()
L = int(input())

K = N.bit_length()
db_r = [[0]*K for i in range(N)]
for i,x in enumerate(xx):
    ind = bisect.bisect_right(xx,x+L)
    db_r[i][0] = ind-1

for k in range(1,K):
    for i in range(N):
        db_r[i][k] = db_r[db_r[i][k-1]][k-1]

def check(a,b,d):
    L = d.bit_length()
    for k in range(L):
        if d & (1<<k):
            a = db_r[a][k]
    return a >= b

Q = int(input())
for i in range(Q):
    a,b = inpl()
    a -= 1
    b -= 1
    a,b = min(a,b),max(a,b)
    OK = N
    NG = 0
    while OK-NG>1:
        mid = (OK+NG)//2
        if check(a,b,mid): OK = mid
        else: NG = mid
    print(OK)


### FIXED CODE ###

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

N,A = inpl()
aa = inpl()

dp = [[[0]*(50*N+5) for j in range(N+1)] for i in range(N)]
# dp[i][j][k] : i 枚目まで見て，j枚選んで，合計がk の通り

for i in range(N):
    dp[i][0][0] = 1


for i in range(N):
    a = aa[i]
    for j in range(1,i+2):
        for k in range(50*j+5):
            dp[i][j][k] = dp[i-1][j][k]
            if k >= a:
                dp[i][j][k] += dp[i-1][j-1][k-a]

ans = 0
for j in range(N+1):
    ans += dp[-1][j][j*A]

print(ans-1)
def pre_cmb_mod(n, mod):
    if n == 0:
        return [1], [1]
    fact = [1, 1]
    inv = [0, 1]
    factinv = [1, 1]
    for i in range(2, n+1):
        fact.append((fact[-1] * i) % mod)
        inv.append((-inv[mod % i] * (mod//i)) % mod)
        factinv.append((factinv[-1] * inv[-1]) % mod)
    return fact, factinv


def cmb_mod(n, r, mod, fact, factinv):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n - r] % mod
  
  mod = 10**9 + 7
n, a, b = map(int, input().split())

fact, factinv = pre_cmb_mod(n, mod)

result = 0
for r in range(1, n+1):
    if r == a or r == b:
        continue
    result += cmb_mod(n, r, mod, fact, factinv)
    result %= mod

print(result)

### FIXED CODE ###

def comb_mod(n, k, p):
    """
    nCk mod p
    """
    numerator = 1
    denominator = 1
    for i in range(k):
        numerator *= n - i
        numerator %= p
        denominator *= i + 1
        denominator %= p
    return numerator * pow(denominator, p-2, p) % p

mod = 10**9 + 7
n, a, b = map(int, input().split())
result = pow(2, n, mod) - 1

for i in (a, b):
    result -= comb_mod(n, i, mod)
result %= mod

print(result)
import math


def nCr(n,r):
    result = math.factorial(n)//math.factorial(r)//math.factorial(n-r)
    return result

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

total = nCr(N,2) + nCr(M,2)

print(total)




### FIXED CODE ###

import math


def nCr(n,r):
    if n<r:
        return 0
    
    result = math.factorial(n)//math.factorial(r)//math.factorial(n-r)
    return result

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

total = nCr(N,2) + nCr(M,2)

print(total)
a,b=input().split()
if a[0]==b[2] and a[1]==b[1] and a[2]==b[0]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a=input()
b=input()
if (a[0]==b[2] and a[1]==b[1] and a[2]==b[0]):
  print("YES")
else:
  print("NO")
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
cnt=0
c=Counter(a)
for u in c.keys():
  if int(u)>c[u]:
    cnt+=v
  else:
    cnt+=c[u]-int(u)
print(cnt)

### FIXED CODE ###

from collections import Counter
n=int(input())
a=list(map(int,input().split()))
cnt=0
c=Counter(a)
for u in c.keys():
  if int(u)>c[u]:
    cnt+=c[u]
  else:
    cnt+=c[u]-int(u)
print(cnt)
s = input()

sl = list(s)
sl.append("2")

n = len(sl)
res=[]

temp =1
for i  in range(n-1):
    if sl[i+1] == sl[i]:
        temp +=1
    else:
        res.append(temp)
        temp = 1

resu = n-1

while len(res) >1:
    resu = min(resu,max(res[0],res[1:]))
    x = res.pop(1)
    res[0]  = res[0]+x    
"""
    if res[0] > sum(res[1:]):
        resu = min(resu,res[0])
        x = res.pop(1)
        res[0] = res[0]+x
    else:
        resu = min(resu,sum(res[1:]))
        x = res.pop(1)
        res[0] =res[0]+x
"""
print(resu)

### FIXED CODE ###

s = input()

sl = list(s)
sl.append("2")

n = len(sl)
res=[]

temp =1
for i  in range(n-1):
    if sl[i+1] == sl[i]:
        temp +=1
    else:
        res.append(temp)
        temp = 1

resu = n-1
m = n-1

while len(res) >1:
    resu = min(resu,max(res[0],m-res[0]))
    x = res.pop(1)
    res[0]  = res[0]+x    
    
print(resu)
import pandas
N=int(input())
A_=list(map(int,input().split()))
ss=pd.Series(A_)
print(len(pd.unique(ss))


### FIXED CODE ###

N=int(input())
A_=set([input() for i in range(N)])
print(len(A_))
nums = [int(input()) for _ in range(int(input()))]
nums_dict = dict()
for i in nums:
    nums_dict[i] = True
print(len(nums_dict.keys()))

### FIXED CODE ###

print("2018/01/" + input()[-2:])