Harryxun/stf_run huggingface dataset:
"""
Print Test Cases
"""

def main():
    i = 1
    while True:
        x = int(raw_input().strip())
        if x == 0:
            break
        print "Case %d: %d" % (i, x)
        i += 1

if __name__ == '__main__':
    main()


### FIXED CODE ###

i=1
while True:
    x = int(input().strip())
    if x==0:
        break
    else:
        print('Case {0}: {1}'.format(i,x))
        i += 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pysnooper # @pysnooper.snoop()
from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()

    print('\33[32m' + 'end' + '\033[0m')


### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from pprint import pprint as pp
from pprint import pformat as pf

def solve():
    k = int(input())
    a, b = map(int, input().split())
    v = k
    while not (v > b):
        if a <= v <= b:
            print("OK")
            return 0
        v += k
    print("NG")
    return 0


if __name__ == '__main__':
    solve()
n = int(input())
s = set(filter(lambda x : n % x == 0 and n / x < 10, [x for x in range(1, 10)])

print("Yes" if len(s) == 0 in s else "No")

### FIXED CODE ###

s = {x*y for x in range(1, 10) for y in range(1, 10)}

print("Yes" if int(input()) in s else "No")
import sys
sys.setrecursionlimit(10**5)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]
    memo = [None for i in range(n)]

    # def rec(n):
    #     if memo[n-1] == None:
    #         if n <= 1:
    #             memo[n-1] = 0
    #         elif n == 2:
    #             memo[n-1] = abs(h[1]-h[0])
    #         else:
    #             d1 = rec(n-2)+abs(h[n-1]-h[n-3])
    #             d2 = rec(n-1)+abs(h[n-1]-h[n-2])
    #             memo[n-1] = min(d1,d2)
    #     return memo[n-1]
        
    # print(rec(n))

    def f(n):
        if memo[n-1] != None:
            return memo[n-1]
        if n <= 1:
            memo[0] = 0
            return 0
        elif n == 2:
            memo[1] = abs(h[1]-h[0])
            return memo[1]
        else:
            d1 = abs(h[n-1]-h[n-2]) + f(n-1)
            d2 = abs(h[n-1]-h[n-3]) + f(n-2)
            memo[n-1] = min(d1,d2)
            return memo[n-1]

    print(f(n))


if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**5)
def main():
    n = int(input())
    h = [int(x) for x in input().split()]
    memo = [None for i in range(n)]

    def rec(n):
        if memo[n-1] == None:
            if n <= 1:
                memo[n-1] = 0
            elif n == 2:
                memo[n-1] = abs(h[1]-h[0])
            else:
                d1 = rec(n-2)+abs(h[n-1]-h[n-3])
                d2 = rec(n-1)+abs(h[n-1]-h[n-2])
                memo[n-1] = min(d1,d2)
        return memo[n-1]
        
    print(rec(n))

if __name__ == "__main__":
    main()
# -*- coding: utf-8 -*-
  2 
  3 A = input()
  4 B = input()
  5 C = input()
  6 D = input()
  7 L = A + B
  8 R = C + D
  9 if L == R:
 10     print("Balanced")
 11 elif L <= R:
 12     print("Right")
 13 else :
 14     print("Left")

### FIXED CODE ###

# -*- coding: utf-8 -*-
A,B,C,D = map(int, input().split())
L = A + B
R = C + D
if L == R:
    print("Balanced")
elif L < R:
    print("Right")
else :
    print("Left")
S1 = input()
S2 = '2' + S1[0]
res = 0

for s in S1:
    if S2[-1] == s:
        S2 += s
    else:
        S2 = S2[:-1:]
        res += 2

print(res)


### FIXED CODE ###

S1 = input()
S2 = ''
res = 0

for s in S1:
    if len(S2) == 0 or S2[-1] == s:
        S2 += s
    else:
        S2 = S2[:-1:]
        res += 2

print(res)
N=raw_input()

n=0

for i in range(0,N):
    n+=i

print n

### FIXED CODE ###

N=int(raw_input())

n=0

for i in range(0,N+1):
    n+=i

print n
a,b,c = map(int, input().split())
if b / a == 1 and c / a == 1:
  print("No")
else:
  print("Yes)

### FIXED CODE ###

a,b,c = map(int, input().split())
count = 0
if a == b:
  count = count + 1
if b == c:
  count = count + 1
if c == a:
  count = count + 1
if count != 1:
  print("No")
else:
  print("Yes")
H, N = map(int, input().split())
A = list(map(int, input().split()))

A.sort(reverse=True)
if H - A[0] - A[1] <= 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

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

if sum(A) >= H:
    print("Yes")
else:
    print("No")
d = int(input())
dict = {'25':'Christmas','24':'Christmas Eve',
        '23':'Christmas Eve Eve',
        '22':'Christmas Eve Eve Eve'}

print(dict[d])

### FIXED CODE ###

d = input()
dict = {'25':'Christmas','24':'Christmas Eve',
        '23':'Christmas Eve Eve',
        '22':'Christmas Eve Eve Eve'}

print(dict[d])
a, b = input().split()
x = int(a)
y = int(b)

if x < y:
    print("a < b")
elif x > y:
    print("a > b")
elif x == y:
    print("a == b")
    


### FIXED CODE ###

a, b, c, d, f = input().split()
lw = int(a)
lh = int(b)
x = int(c)
y = int(d)
r = int(f)

if x - r >= 0 and x + r <= lw:
    if y - r >= 0 and y + r <= lh:
        print("Yes")
    else:
        print("No")
else:
    print("No")
n,k=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
d=[0]*(n-1)
for j in range(n-1):
  d[j+1]=d[j]+h[j+1]-h[j]
m=1000000001
for l in range(1,n-k+1):
  m=min(m,d[l+k-1]-d[l])
print(m)
  
  
  
  


### FIXED CODE ###

n,k=map(int,input().split())
h=[int(input()) for i in range(n)]
h.sort()
d=[0]*n
for j in range(n-1):
  d[j+1]=d[j]+h[j+1]-h[j]
m=float('inf')
for l in range(n-k+1):
  m=min(m,d[l+k-1]-d[l])
print(m)
n=int(input())
a=
a=list(int(input()) for i in range(n-1))
if a[i]=max(a) for i in range(n-1):
  a.remove(a[i])
  print(max[a])
else:
  print(max[a])

### FIXED CODE ###

##C
n=int(input())
a=list(int(input()) for i in range(n))
b=sorted(a)

for i in range(n):
    if a[i]==b[-1]:
        print(b[-2])
    else:
        print(b[-1])
S = String(input().length())
if S == S[::-1]:
  print("Yes")
else:
  print("No")


### FIXED CODE ###

s = input()
n = len(s)
left = s[:(n-1)//2]
print('Yes' if left == left[::-1] == s[(n+3)//2 - 1:]  else 'No')
n,m , k = [int(x) for x in input().strip().split()]

a = [int(x) for x in input().strip().split()]
b = [int(x) for x in input().strip().split()]

dp = [[-1 for j in range(m+1)] for i in range(n+1)]
def solve(i,j,t):
    if i==n and j==m:
        return 0

    if dp[i][j]!=-1:
        return dp[i][j]

    if i==n:
        if t+b[j]<k:
            dp[i][j] = 1+solve(i,j+1,t+b[j])
        elif t+b[j]==k:
            dp[i][j] = 1
        else:
            dp[i][j]=0
    elif j==n:
        if t+a[i]<k:
            dp[i][j] = 1+solve(i+1,j,t+a[i])
        elif t+a[i]==k:
            dp[i][j] = 1
        else:
            dp[i][j]=0
    else:
        if t+b[j]<k:
            t1 = 1+solve(i,j+1,t+b[j])
        elif t+b[j]==k:
            t1 = 1
        else:
            t1=0

        if t+a[i]<k:
            t2 = 1+solve(i+1,j,t+a[i])
        elif t+a[i]==k:
            t2 = 1
        else:
            t2=0

        dp[i][j] = max(t1,t2)
    
    return dp[i][j]

print(solve(0,0,0))

        

### FIXED CODE ###

import bisect

n, m , k = [int(x) for x in input().strip().split()]

a = [int(x) for x in input().strip().split()]
b = [int(x) for x in input().strip().split()]

pa = []
pb = []
s=0
for e in a:
    s+=e
    pa.append(s)

s=0
for e in b:
    s+=e
    pb.append(s)

res=0
for i in range(n):
    elem = k-pa[i]
    if elem<0:
        break
    ind = bisect.bisect_right(pb,elem)
    # print(ind, i)
    res = max(res, ind+i+1)

for i in range(m):
    elem = k-pb[i]
    if elem<0:
        break
    ind = bisect.bisect_right(pa,elem)
    # print(ind, i)
    res = max(res, ind+i+1)

ind = bisect.bisect_right(pa,k)
res = max(res, ind)

ind = bisect.bisect_right(pb,k)
res = max(res, ind)

print(res)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin
from collections import Counter

cnt = Counter()
for line in stdin:
    start, end = (int(s) for s in line.split())
    if start or end:
        cnt[start] += 1
        cnt[end] += 1
    else:
        assert cnt[1] == 1
        assert cnt[2] == 1
        eulerian_graph = sum(i % 2 for i in cnt.values()) == 2
        print('OK' if eulerian_graph else 'NG')
        cnt.clear()

### FIXED CODE ###

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin
from collections import Counter

cnt = Counter()
for line in stdin:
    start, end = (int(s) for s in line.split())
    if start or end:
        cnt[start] += 1
        cnt[end] += 1
    else:
        semi_eulerian = sum(i % 2 for i in cnt.values()) == 2
        if semi_eulerian and cnt[1] % 2 and cnt[2] % 2:
            print('OK')
        else:
            print('NG')
        cnt.clear()
def fragOptimalJump(h,n,k):
    dp=[0]*(n+1)
    dp[2]=abs(h[1]-h[2])
    for i in range(3,n+1):
        l=i-k
        if l<0:
            l=1
        min=10000000000
        for j in range(l,i):
            d=dp[j]+abs(h[i]-h[j])
            if d<min:
                min=d
            
        dp[i]=min
    return dp[n]



N,k=input().split()
N,k=int(N),int(k)
H=[0]*(N+1)
read = [int(n) for n in input().split()]
H=[0]+read
print(fragOptimalJump(H,N,k))


### FIXED CODE ###

def fragOptimalJump(h,n):
    dp=[0]*(n+1)
    dp[2]=abs(h[1]-h[2])
    for i in range(3,n+1):
        dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
    return dp[n]
  
N=int(input())
read = [int(n) for n in input().split()]
H=[0]+read
print(fragOptimalJump(H,N))
from sys import stdin
import numpy as np
N,K=list(map(int,(stdin.readline().strip().split())))
print(np.gcd(N,K))

### FIXED CODE ###

from sys import stdin
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) #再帰定義
N,K=list(map(int,(stdin.readline().strip().split())))
if N%K==0:print(0)
else:
    M=10**19
    while(True):
        M = N
        N=N%K
        if M==N:
            M = N
            N-=K
            if N<=0:
                if abs(N)<abs(M):
                    print(abs(N))
                    break
                else:
                    print(abs(M))
                    break
s=input()
if str(s[2:])!=0 and str(s[2:])<=12:
  if str(s[:2])!=0 str(s[:2])<=12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if str(s[:2])!=0 str(s[:2])<=12:
    print('MMYY')
  else:
    print('NA')

### FIXED CODE ###

s=input()
if int(s[2:])!=0 and int(s[2:])<=12:
  if int(s[:2])!=0 and int(s[:2])<=12:
    print('AMBIGUOUS')
  else:
    print('YYMM')
else:
  if int(s[:2])!=0 and int(s[:2])<=12:
    print('MMYY')
  else:
    print('NA')
n = input()

m = len(n)
f = 0
ans = 0

for i in range(m):
    ans += n[i]
    
    
if m>1 and n[0] == 1:
    if n[1] == 0:
        ans += 9
print(ans)

### FIXED CODE ###

n = input()

m = len(n)
f = 0
ans = 0

for i in range(m):
    ans += int(n[i])
    
    
if m>1 and n[0] == '1':
    if n[1] == '0':
        ans += 9
print(ans)
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return input().split()
def S(): return input().rstrip()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n = II()
    st = LSR(n)
    x = S()
    ans = 0
    te = 0
    for s, t in st:
        if te:
            ans += t
        if s == x:
            te = 1
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()


### FIXED CODE ###

#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return input().split()
def S(): return input().rstrip()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    n = II()
    st = LSR(n)
    x = S()
    ans = 0
    te = 0
    for s, t in st:
        if te:
            ans += int(t)
        if s == x:
            te = 1
    print(ans)
    return


#main
if __name__ == '__main__':
    solve()
import sys
    stdin=sys.stdin
     
    ns = lambda:stdin.readline().rstrip()
    ni = lambda:int(stdin.readline().rstrip())
    nm = lambda:map(int,stdin.readline().split())
    nl = lambda:list(map(int,stdin.readline().split()))
     
    N,K=nm()
    A=nl()
     
    city_l=[]
    city_l.append(1)
    city_c=[0]*(N+1)
    city_c[1]+=1
    n_city=A[0]
    flag=True
    r_start=-1
    r_end=-1
    while(flag):
        city_c[n_city]+=1
        city_l.append(n_city)
        if(city_c[n_city]>1):
            r_start=city_l.index(n_city)+1
            r_end=len(city_l)-1
            flag=False
        n_city=A[n_city-1]
     
    if(K<r_end):
        print(city_l[K-1])
     
     
    else:
        K2=K-r_end
        K2=K2%(r_end-r_start+1)
        if(K2==0):
           print(A[city_l[r_end-1]-1])
        else:
           print(A[city_l[r_start+K2-2]-1])
     

### FIXED CODE ###

import sys
stdin=sys.stdin

ns = lambda:stdin.readline().rstrip()
ni = lambda:int(stdin.readline().rstrip())
nm = lambda:map(int,stdin.readline().split())
nl = lambda:list(map(int,stdin.readline().split()))

S=list(ns())
T=list(ns())
T2=T[0:len(T)-1]
print('Yes' if S==T2 else 'No')
#memo
exit()

import math

def nasu(A, B, L, D, M, T):
  ans = nasuA(A, B, L, D, M, T)
  ans += nasuB(B, L, D, M, T)
  return ans % M

def nasuA(A, B, L, D, M, T):
  ans = A % M
  ans += powA(A, B, L, D, M, T) % M
  return ans % M

def powA(A, B, L, D, M, T):
  k = 0
  while T[k + 1] <= L:
    k += 1
    if k + 1 == len(L):
      break
  ans = powA2(A, T[k], D, M)
  if L != T[k]:
    ans +=  powA(A, B, L - T[k], D, M) * k % M
  return ans % M
 
def powA2(A, L, D, M):



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

N = math.ceil(math.log(A + 1, 10))
k = pow(10, N)
D = [[0, 0] for _ in range(20)]
while L > 0:
  n = min(L, (k - 1 - A) // B + 1)
  print(n)
  D[N - 1][0] = A
  D[N - 1][1] = n
  L -= n
  N += 1
  k *= 10
  A += n * B

T = [1]
while T[-1] < 10 ** 18:
  T.append(T[-1] * 2)

print(D)
ans = 0
for i in range(20):
  a = D[i][0]
  l = D[i][1]
  if l == 0:
    continue
  ans = (ans + nasu(a, B, l, pow(10, i), M, T)) % M
  
print(ans)

### FIXED CODE ###

import math
import sys
sys.setrecursionlimit(10000)

def nasu(A, B, L, D, M):
  if L == 1:
    return A
  ans = nasuA(A, L, D, M)
  ans = (ans + nasuB(1, L - 1, D, M) * B * D) % M
  return ans % M

def nasuB(B, L, D, M):
  if L == 1:
    return B
  ans = powB(1, L, D, M) % M
  return ans % M

def powB(B, L, D, M):
  if L == 1:
    return B
  k = 0
  t = D
  while T[k + 1] <= L:
    k += 1
    t = t * t % M
    if k + 1 == len(T):
      break
  ans = powB2(B, T[k], D, M) % M
  if L != T[k]:
    ans += nasu(T[k] + 1, 1, L - T[k], D, M) * t % M 
    #ans += powB(1, L - T[k], D, M) * t % M
    #ans += powA(-T[k], L - T[k], D, M) * t % M
  return ans % M
 
def powB2(B, L, D, M):
  if L == 1:
    return 1
  ans = powB2(B * 2, L // 2, D * D % M, M) * (D + 1) % M
  ans = ans + nasuA(1, L // 2, D * D % M, M) * B * D % M
  return ans

def nasuA(A, L, D, M):
  if L == 1:
    return A
  ans = powA(A, L, D, M) % M
  return ans % M

def powA(A, L, D, M):
  if L == 1:
    return A
  k = 0
  t = D
  while T[k + 1] <= L:
    k += 1
    t = t * t % M
    if k + 1 == len(T):
      break
  ans = powA2(A, T[k], D, M)
  if L != T[k]:
    ans +=  powA(A, L - T[k], D, M) * t % M
  return ans % M
 
def powA2(A, L, D, M):
  if L == 1:
    return A
  return powA2(A, L // 2, D * D % M, M) * (D + 1) % M

def powmod(a, n, M):
  ans = 1
  while n:
    if n & 1:
      ans = (ans * a) % M
    a = a * a % M
    n >>= 1
  return ans

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

N = math.ceil(math.log(A + 1, 10))
k = pow(10, N)
D = [[0, 0] for _ in range(20)]
while L > 0:
  n = min(L, (k - 1 - A) // B + 1)
  D[N - 1][0] = A
  D[N - 1][1] = n
  L -= n
  N += 1
  k *= 10
  A += n * B
T = [1]
while T[-1] < 10 ** 19:
  T.append(T[-1] * 2)
BI = (((B // M) + 1) * M - B) % M
ans = 0
for i in range(20):
  l = D[i][1]
  a = D[i][0] + (l - 1) * B
  if l == 0:
    continue
  ans = ans * powmod(pow(10, i + 1), l, M) % M
  ans = (ans + nasu(a, BI, l, pow(10, i + 1), M)) % M
print(ans)
n,m=map(int,input().split())
py=[[0]*3 for _ in range(m)]
for i in range(m):
    p,y=map(int,input().split())
    py[i][0],py[i][1],py[i][2]=p,y,i
py.sort()
ans=[[''] for _ in range(m)]
cnt=[0]*m
for p,y,i in py:
    cnt[p]+=1
    ans[i]='0'*(6-len(str(p)))+str(p)+'0'*(6-len(str(cnt[p])))+str(cnt[p])
ans.sort()
for i in ans:
    print(i)

### FIXED CODE ###

def resolve():
    n,m=map(int,input().split())
    py=[[0]*3 for _ in range(m)]
    for i in range(m):
        p,y=map(int,input().split())
        py[i][0],py[i][1],py[i][2]=p,y,i
    py.sort()
    ans=[[''] for _ in range(m)]
    cnt=[0]*(n+1)
    for p,y,i in py:
        cnt[p]+=1
        ans[i]='0'*(6-len(str(p)))+str(p)+'0'*(6-len(str(cnt[p])))+str(cnt[p])
    for i in ans:
        print(i)


if __name__ == '__main__':
    resolve()
n=int(input())
s1=0
s2=0
s3=list()
s4=list()
s5=list()
for i in range(n):
    a=str(input())
    a=a.replace(r'()','')
    if len(a)==0:
        continue
    if a[0]=="(" and a[-1]=="(":
        s1+=len(a)
    elif a[0]==")" and a[-1]==")":
        s2+=len(a)
    else:
        x=len(a.replace("(",""))
        y=len(a)-x
        if x<=y:
            s3.append([x,y])
        elif x==y:
            s4.append(x)
        else:
            s5.append([x,y])
            
s3.sort(key=lambda x:x[0])
s5.sort(key=lambda x:x[1])

flag=0
limit=s1
for i in range(len(s3)):
    if limit>=s3[i][0]:
        limit=limit-s3[i][0]+s3[i][1]
    else:
        flag=1
        print("No")
        break

if limit<max(s4):
    print("No")
    flag=1
    
if flag==0:
    for i in range(len(s5)):
        if limit>=s5[i][1]:
            limit=limit-s3[i][1]+s3[i][0]
        else:
            flag=1
            print("No")
            break

if flag==0:
    print("Yes")

### FIXED CODE ###

n=int(input())
s1=0
s2=0
s3=list()
s4=list()
s5=list()
for i in range(n):
    a=str(input())
    b=str()
    while a!=b:
        b=a
        a=a.replace(r'()','')
    if len(a)==0:
        continue
    if a[0]=="(" and a[-1]=="(":
        s1+=len(a)
    elif a[0]==")" and a[-1]==")":
        s2+=len(a)
    else:
        x=len(a.replace("(",""))
        y=len(a)-x
        if x<y:
            s3.append([x,y])
        elif x==y:
            s4.append(x)
        else:
            s5.append([x,y])
            
s3.sort(key=lambda x:x[0])
s5.sort(key=lambda x:x[1])

flag=0
limit=s1

if len(s3)!=0:
    for i in range(len(s3)):
        if limit>=s3[i][0]:
            limit=limit-s3[i][0]+s3[i][1]
        else:
            flag=1
            print("No")
            break

x=limit

if len(s4)!=0:
    if limit<max(s4):
        print("No")
        flag=1

limit=s2
if len(s5)!=0:    
    if flag==0:
        for i in range(len(s5)):
            if limit>=s5[i][1]:
                limit=limit-s5[i][1]+s5[i][0]
            else:
                flag=1
                print("No")
                break

if flag==0 and len(s4)!=0:
    if limit<max(s4):
        print("No")
        flag=1

if flag==0 and x==limit:
    print("Yes")
elif flag==0:
    print("No")
a,p=map(int, input())
p+=a*3
print(p//2)

### FIXED CODE ###

a,p=map(int, input().split())
p+=a*3
print(p//2)
N = int(input())
import math
def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n)) + 1):
    if n % k == 0:
      return False
  return True
if is_prime(N):
  print(N-1)
else:
  a = np.floor(math.sqrt(N))
  while True:
    if N%a==0:
      break
      a=a-1
      b=N/a
      print(int(a+b-2))

### FIXED CODE ###

N = int(input())
import math
def is_prime(n):
  if n == 1: return False
  for k in range(2, int(math.sqrt(n)) + 1):
    if n % k == 0:
      return False
  return True
if is_prime(N):
  print(N-1)
else:
  a = math.floor(math.sqrt(N))
  while True:
    if N%a==0:
      break
    a=a-1
  print(int(a+N/a-2))
N=int(input())
S = []
for j in range(N):
    S.append(input())
from collections import Counter
S2=collections.Counter(S)
S1=S2.most_common()

S3=[]
S3.append(S1[0][0])
for i in range(1,len(S1)):
    if S1[i][1]==S1[0][1]:
        S3.append(S1[i][0])
    else:
        break
S3=sorted(S3)
[print(i) for i in S3]

### FIXED CODE ###

N=int(input())
S = []
for j in range(N):
    S.append(input())
import collections
S2=collections.Counter(S)
S1=S2.most_common()

S3=[]
S3.append(S1[0][0])
for i in range(1,len(S1)):
    if S1[i][1]==S1[0][1]:
        S3.append(S1[i][0])
    else:
        break
S3=sorted(S3)
for i in range(0, len(S3)):
    print(S3[i])
a,b,c=[input() for i range(3)]
print(a[0]+b[1]+c[2])

### FIXED CODE ###

a,b,c=[input() for i in range(3)]
print(a[0]+b[1]+c[2])
n, m = map(int, input().split())
ans=0
if n==1 and m==1:
    ans=1
else:
    ans=abs(n-2)*abs(m-2)
print(ans)

### FIXED CODE ###

s1=input()
s2=input()
s3=input()
print(s1[0]+s2[1]+s3[2])
n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n - 1)
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))

### FIXED CODE ###

n = int(input())
b = list(map(int,input().split()))
a = [b[0]]

for i in range(n-2):
    a.append(min(b[i],b[i+1]))

a.append(b[-1])
print(sum(a))
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 9

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10
print(sum(a))

### FIXED CODE ###

def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = [str(input()) for _ in range(5)]

n = 10
cnt = 0

for i in range(len(a)):
	if int(a[i][-1]) < n and int(a[i][-1]) != 0 :
		n = int(a[i][-1])
		cnt = i

for i in range(len(a)):
	if i == cnt:
		a[i] = int(a[i])
	elif int(a[i][-1]) == 0:
		a[i] = int(a[i])
	else:
		a[i] = (int(a[i])//10 + 1)*10

print(sum(a))
W, H, x, y = map(int, input().split())

if (x == 0 and y == 0) or (x == W and y == H) or (x == 0 and y == H) or (x == W and y == 0):
    print((W*H)/2, 0)
elif x = W/2 and y = H/2:
    print((W*H)/2, 1)
else:
    A = W*y
    B = W*(H-y)
    C = H*x
    D = H*(W-x)
    dup = 0
    if min(A,B) == min(C,D):
        dup = 1
    print(max(min(A,B), min(C,D)), dup)

### FIXED CODE ###

W, H, x, y = map(int, input().split())

if x == W/2 and y == H/2:
    print((W*H)/2, 1)
else:
    print((W*H)/2, 0)