Harryxun/stf_run huggingface dataset:
def is_p(s):
    return s == s[::-1]
s = input()
n = len(s)
l, r = (n - 1)//2, l + 1
print('Yes' if is_p(s) and is_p(s[:l]) and is_p(s[r:]) else 'No')

### FIXED CODE ###

def is_palindrome(s):
    len_s = len(s)
    ans = True
    for i in range(len_s // 2):
        if s[i] != s[-(i + 1)]:
            ans = False
    return ans

s = input()
len_s = len(s)
ans = True
if is_palindrome(s) == False:
    ans = False
if is_palindrome(s[0:(len_s - 1) // 2]) == False or is_palindrome(s[(len_s + 1) // 2:len_s]) == False:
    ans = False
if ans:
    print('Yes')
else:
    print('No')
import math
a, b, c, d = map(int, input().split())
cd = c*d//math.gcd(c, d)

print(b-(b//c+b//d-b//cd) - ((a-1)-((a-1)//c+(a-1)//d-(a-1)//cd)))

### FIXED CODE ###

from fractions import gcd
a, b, c, d = map(int, input().split())
cd = c*d//gcd(c, d)

print(b-(b//c+b//d-b//cd) - ((a-1)-((a-1)//c+(a-1)//d-(a-1)//cd)))
K=int(input())
A,B = map(int,input().split())
flg = False:
for i in range(A,B+1):
    if i%K == 0:
        flg = True:
if flg == True:
    print("OK")
else:
    print("NG")


### FIXED CODE ###

K=int(input())
A,B = map(int,input().split())
flg = False
for i in range(A,B+1):
    if i%K == 0:
        flg = True
if flg == True:
    print("OK")
else:
    print("NG")
k = input()
a, b = map(int,input().split())

if k*4 >= a:
    if k*4 <= b:
        print("OK")
    else:
        print("NG")

else:
    print("NG")
    

### FIXED CODE ###

k = int(input())
a, b = map(int,input().split())

flug = 0

A = list(range(a, b+1))

for number in A:
    if number % k == 0:
        flug = 1
        
    else:
        continue

if flug == 1:
    print("OK")
else:
    print("NG")
import math
abc = input()
abc = abc.split(' ')
a = int(abc[0])
b = int(abc[1])
c = int(abc[2])

if (c-a-b>0) and 4*a*b<(c-a-b)*(c-a-b):
    print('Yes')
else:
    print('No')



### FIXED CODE ###

array = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, \
2, 5, 4, 1, 4, 1, 51]

inp = input()

inp = int(inp)

print('{}'.format(array[inp-1]))
d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)

### FIXED CODE ###

from collections import Counter

N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)
from collections import deque
H,W = map(int,input().split())
n = int(input())
a_ls = list(map(int, input().split()))
color_q = deque()
for color, times in enumerate(a_ls,1):
    for _ in range(times):
        color_q.append(color)
ans_mat = [[0] * W for _ in range(W)]
for y in range(H):
    for x in range(W):
        ans_mat[y][x] = color_q.popleft()
for i,y in enumerate(range(H)):
    ans_ls = ans_mat[y]
    if i % 2 == 1:
        ans_ls = ans_ls[::-1]
    ans_ls = list(map(str,ans_ls))
    print(' '.join(ans_ls))

### FIXED CODE ###

from collections import deque
H,W = map(int,input().split())
n = int(input())
a_ls = list(map(int, input().split()))
color_q = deque()
for color, times in enumerate(a_ls,1):
    for _ in range(times):
        color_q.append(color)
ans_mat = [[0] * W for _ in range(H)]
for y in range(H):
    for x in range(W):
        ans_mat[y][x] = color_q.popleft()
for i,y in enumerate(range(H)):
    ans_ls = ans_mat[y]
    if i % 2 == 1:
        ans_ls = ans_ls[::-1]
    ans_ls = list(map(str,ans_ls))
    print(' '.join(ans_ls))
a, b = map(int, input())
print((a-1)*(b-i))

### FIXED CODE ###

a, b = map(int, input().split(" "))
print((a-1)*(b-1))
s = int(input()) - int(input())
if s < 0:
  print('No')
else:
  if s % 500 == 0:
	print('Yes')
  else:
    print('No')


### FIXED CODE ###

N = int(input())
A = int(input())

ans = N % 500
if max(ans - A, 0):
  print('No')
else:
  print('Yes')
N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
subX = []

for i in range(M-1):
  subX.append(X[i+1]-X[i])
  
subX = sorted(subX)  
ans = sum(subX)

for i in range(N-1):
  ans -= subX[-i-1]

print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
X = sorted(list(map(int, input().split())))
subX = []

if N >= M:
  print(0)
else:
  for i in range(M-1):
    subX.append(X[i+1]-X[i])
  
  subX = sorted(subX)  
  ans = sum(subX)

  if N>= 2:
    for i in range(N-1):
      ans -= subX[-i-1]

  print(ans)
n=input()
a=[]

a=map(int,raw_input().split())

b=[0]*10000
c=0
while c <= n-2:
    b[a[c]]+=1
    c+=2

d=[0]*10000
e=1
while e <= n-1:
    d[a[e]]+=1
    e+=2

f=sorted(b)[-2]
g=sorted(d)[-2]



if max(b) == n/2 and max(d) == n/2 and b.index(max(b)) == d.index(max(d)):
    print(n/2)
elif max(b) == n/2 and max(d) == n/2 and b.index(max(b)) != d.index(max(d)):
    print(0)
elif b.index(max(b)) == d.index(max(d)):
    print(n-max(b)-max(f,g))
else:
    print(n-max(b)-max(d))

### FIXED CODE ###

n=input()
a=[]

a=map(int,raw_input().split())

b=[0]*100001
c=0
while c <= n-2:
    b[a[c]]+=1
    c+=2

d=[0]*100001
e=1
while e <= n-1:
    d[a[e]]+=1
    e+=2

f=sorted(b)[-2]
g=sorted(d)[-2]



if max(b) == n/2 and max(d) == n/2 and b.index(max(b)) == d.index(max(d)):
    print(n/2)
elif max(b) == n/2 and max(d) == n/2 and b.index(max(b)) != d.index(max(d)):
    print(0)
elif b.index(max(b)) == d.index(max(d)):
    print(n-max(b)-max(f,g))
else:
    print(n-max(b)-max(d))
a,b=map(int,input().split())
cnt=0
for i in range(a,b+1):
    if str(i)　==　str(i)[::-1]:
        cnt+=1　#count++はダメ
       
print(cnt)


### FIXED CODE ###

a,b=map(int,input().split())
cnt = 0
for i in range(a, b+1):
	if str(i) == str(i)[::-1]:
		cnt += 1
 
print(cnt)
X,N = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]

if N != 0:
    sorted_p = sorted(p)
    flag = 0

    for x in range(N-1):
        diff = abs(X - sorted_p[x])
        if diff == 0:
            flag = 1
            break
        if diff <= abs(X-sorted_p[x+1]):
            break

    def checknum(d,loweridx,upperidx):
        upper = sorted_p[upperidx]
        lower = sorted_p[loweridx]
        if X-d == lower:
            if X+d == upper:
                checknum(d+1,loweridx-1,upperidx+1)
            elif X-d == lower and X+d != upper:
                print(X+d)        
        else:
            return print(X-d)

    checknum(1,x-1,x+1)
else:
    print(X)

### FIXED CODE ###

X,N = [int(x) for x in input().split()]
p = [int(x) for x in input().split()]

for d in range(X+1):
    for f in [-1,1]:
        a = X + d*f
        if p.count(a) == 0:
            print(a)
            exit()
N = input()
a = []

for i in range(N):
    a.append(map(int, input().strip().split()))

for j in range(len(a)):
    number_1 = a[j][0]
    number_2 = a[j][1]
    number_3 = a[j][2]

    number_1 = number_1 * 2
    number_2 = number_2 * 2
    number_3 = number_3 * 2

    if number_1 = number_2 + number_3:
        print("YES")
    if number_2 = number_3 + number_1:
        print("YES")
    if number_3 = number_1 + number_2:
        print("YES")

    else:
        print("NO")

### FIXED CODE ###

N = input()
a = []
for i in range(N):
    a.append(map(int, raw_input().split()))

for j in range(N):

    x = a[j][0] ** 2
    y = a[j][1] ** 2
    z = a[j][2] ** 2

    if x == y + z:
        print "YES"
    elif y == x + z:
        print "YES"
    elif z == x + y:
        print "YES"
    else:
        print "NO"
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def fib(n):
    '''f(n)=f(n-1)+f(n-2)'''
    a, b = 0, 1
    for _ in range(n-1):
        a, b = b, a+b
    return b


n, m = map(int, input().split())
mod = 10**9+7
a = [int(input()) for _ in range(m)]
ans = fib(a[0])*fib(n-a[m-1]) % mod
for i in range(m-1):
    if a[i+1]-a[i] == 1:
        ans = 0
        break
    ans = ans * fib(a[i+1]-a[i]-1) % mod

print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline


def fib(n):
    '''f(n)=f(n-1)+f(n-2)'''
    a, b = 0, 1
    for _ in range(n-1):
        a, b = b, a+b
    return b


n, m = map(int, input().split())
mod = 10**9+7
a = [int(input()) for _ in range(m)]
if not a:
    ans = fib(n+1) % mod
else:
    ans = fib(a[0])*fib(n-a[m-1]) % mod
    for i in range(m-1):
        if a[i+1]-a[i] == 1:
            ans = 0
            break
        ans = ans * fib(a[i+1]-a[i]-1) % mod

print(ans)
a=int(input())
inport math
b=math.ceil(a/2)
print(a/b)

### FIXED CODE ###

import math
a=int(input())
b=math.ceil(a/2)
print(b/a)
n=int(input())
ans='No'
for i in range(10):
  if n//i<10 and n%i==0:
    ans='Yes'

print(ans)

### FIXED CODE ###

n=int(input())
ans='No'
for i in range(1,10):
  if n//i<10 and n%i==0:
    ans='Yes'

print(ans)
import collections

N = int(input())

S = []
for _ in range(N):
    S.append(input())

c = collections.Counter(S)
c1 = c.most_common()

# print(c1[0][0])

tmp = []
for i in range(len(c1)):
    tmp.append(c1[i][0])
    print(sorted(tmp))
    if (c1[0][1] > c1[i][1]):
        break

ans = sorted(tmp)
for i in range(len(ans)):
    print(ans[i])

### FIXED CODE ###

import sys 
from collections import Counter

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
l = read().decode().split()
c = Counter(l)

max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] >= max]

print('\n'.join(sorted(ans)))
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if A in "0":
        print("0")
        exit()
    else:
        for i in A:
            ans *= i
            if ans > 10**18:
                print("-1")
                exit()
        print(ans)
resolve()

### FIXED CODE ###

def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    ans = 1
    if 0 in A:
        print(0)
        exit()
    for i in A:
        ans *= i
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)
resolve()
# coding: utf-8
# Your code here!

H, W = map(int, input().rstrip().split(' '))

field = []
for _ in range(H):
    temp_field = []
    for s in input():
        temp_field.append(0 if s == '.' else 1)
    field.append(temp_field)
    
dp = [[0] * (W + 1) for _ in range(H+1)]
dp[0][1] = 1

for h in range(1, H+1):
    for w in range(1, W+1):
        if field[h-1][w-1] == 0:
            dp[h][w] = dp[h-1][w] + dp[h][w-1]
            
#print(int(dp[-1][-1] % (1e9 + 7)))
print((dp[-1][-1] % (1_000_000_007)))


### FIXED CODE ###

# coding: utf-8
# Your code here!

H, W = map(int, input().rstrip().split(' '))

field = []
for _ in range(H):
    temp_field = []
    for s in input():
        temp_field.append(0 if s == '.' else 1)
    field.append(temp_field)
    
dp = [[0] * (W + 1) for _ in range(H+1)]
dp[0][1] = 1

for h in range(1, H+1):
    for w in range(1, W+1):
        if field[h-1][w-1] == 0:
            dp[h][w] = dp[h-1][w] + dp[h][w-1]
            
print(dp[-1][-1] % (1000000007))
import math
N,M = (int(T) for T in input().split())
S = input()
T = input()

Length = N*M//math.gcd(N,M)
String = ['']*Length
Flag   = True

for Nk in range(0,N):
    String[Nk*(Length//N)] = S[Nk]

for Mk in range(0,M):
    Target = String[Mk*(Length//M)]
    if Target=='' or Target==T[Mk]:
        String[Mk*(Length//M)] = T[Mk]
    else:
        Flag = False
        break        
if Flag:
    print(Length)
else:
    print(-1)

### FIXED CODE ###

import math
N,M = (int(T) for T in input().split())
S = input()
T = input()
Length = N*M//math.gcd(N,M)
Flag   = True
SIndex = [Nk*(Length//N) for Nk in range(0,N)]
SList  = list(S)
    
for Mk in range(0,M):
    if Mk%(Length//N)==0:
        MInd = SIndex.index(Mk*(Length//M))
        if SList[MInd]!=T[Mk]:
            Flag = False
            break
        
if Flag:
    print(Length)
else:
    print(-1)
import sys
DBG =  not True
R = 1000000007
n = int(input())
c = []
for i in range(n):
    c.append(int(input()))
tot = 1
s = [0] * (n+1)
for i in range(n):
    if i > 0 and c[i] == c[i-1]:
        continue
    x = s[c[i]]
    tot = (tot + x) % R
    s[c[i]] = tot
    if DBG:
        print("i {} sci {} tot {} newt {}".format(i,x,s[c[i]],tot))
        print(s)
print(tot)


### FIXED CODE ###

import sys
DBG =  not True
R = 1000000007
MAXN = 200000
n = int(input())
c = []
for i in range(n):
    c.append(int(input()))
tot = 1
s = [0] * (MAXN+1)
for i in range(n):
    if i > 0 and c[i] == c[i-1]:
        continue
    x = s[c[i]]
    tot = (tot + x) % R
    s[c[i]] = tot
    if DBG:
        print("i {} sci {} tot {} newt {}".format(i,x,s[c[i]],tot))
        print(s)
print(tot)
a,b=map(int,input().split())
print(f'{a//b} {a%b} {f.5:float(a/b)}')

### FIXED CODE ###

a,b=map(int,input().split())
print(a//b,a%b,f'{a/b:f}')
a,b,c,d=map(int, input().split())
for i in range(c,1,-1):#cから2まで
    if c % i == 0 and d % i == 0:
        s = i
        break
s = (c // s) * (d // s) * s
print(b - a + 1 - b//c + a//c - b//d + a//d + b//s - a//s)

### FIXED CODE ###

def ABC162C(a,b):#from:https://atcoder.jp/contests/abc162/submissions/11871774
    while b != 0:
        a %= b
        if a == 0:break
        b %= a
    return max(a,b)
    

a,b,c,d=map(int,input().split())
e=c//ABC162C(c,d)*d
print(b-b//c-b//d+b//e-(a-1-(a-1)//c-(a-1)//d+(a-1)//e))
a,b,c,d,e=int(input(),split())
if(a==0):
  print(1)
elif(b==0):
  print(2)
elif(c==0):
  print(3)
elif(d==0):
  print(4)
else:
  print(5)

### FIXED CODE ###

a,b,c,d,e=list(map(int,input().split()))
if(a==0):
  print(1)
elif(b==0):
  print(2)
elif(c==0):
  print(3)
elif(d==0):
  print(4)
else:
  print(5)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

N = int(readline())
m = map(int,read().split())
AB = zip(m,m)

D = 2000

def cumprod(arr,MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U,MOD):
    x = np.arange(U,dtype=np.int64); x[0] = 1
    fact = cumprod(x,MOD)
    x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)
    fact_inv = cumprod(x,MOD)[::-1]
    return fact,fact_inv

fact,fact_inv = make_fact(10 ** 4,MOD)
fact = fact.tolist()
fact_inv = fact_inv.tolist()

C_to_A = [[] for _ in range(D+D+1)]
remove = 0
for a,b in AB:
    c = a+b
    C_to_A[c].append(D-a)
    remove += fact[c+c] * fact_inv[a+a] * fact_inv[b+b]
remove %= MOD

dp = np.zeros(D+D+1,np.int64)
for A in C_to_A[::-1]:
    dp[:0:-1] += dp[-1::-1]
    np.add.at(dp,A,1)
    dp %= MOD

x = (dp * dp[::-1] % MOD).sum() % MOD
x -= remove
if x&1:
    x += MOD
x //= 2
x %= MOD

print(x)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

N = int(readline())
m = map(int,read().split())
AB = zip(m,m)

D = 2000

def cumprod(arr,MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U,MOD):
    x = np.arange(U,dtype=np.int64); x[0] = 1
    fact = cumprod(x,MOD)
    x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)
    fact_inv = cumprod(x,MOD)[::-1]
    return fact,fact_inv

fact,fact_inv = make_fact(10 ** 4,MOD)
fact = fact.tolist()
fact_inv = fact_inv.tolist()

C_to_A = [[] for _ in range(D+D+1)]
remove = 0
for a,b in AB:
    c = a+b
    C_to_A[c].append(D-a)
    remove += fact[c+c] * fact_inv[a+a] * fact_inv[b+b]
remove %= MOD

dp = np.zeros(D+D+1,np.int64)
for A in C_to_A[::-1]:
    dp[1:] += dp[:-1].copy()
    np.add.at(dp,A,1)
    dp %= MOD

x = (dp * dp[::-1] % MOD).sum() % MOD
x -= remove
if x&1:
    x += MOD
x //= 2
x %= MOD

print(x)
n,m=map(int,input().split())
s=input()
t=input()
#l=n*m*k
import math


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct

def agc(n,m,s,t):
    if s[0]!=t[0]:
        return -1
    g=math.gcd(n,m)
    if g==1:
        return  n*m
    l=n*m/g

    if s[int(l//m)]!=t[int(l//n)]:
        return -1
    return  int(l)
print(agc(n,m,s,t))


### FIXED CODE ###

n,m=map(int,input().split())
s=input()
t=input()
#l=n*m//
import fractions

def agc(n,m,s,t):
    if s[0]!=t[0]:
        return -1
    g=fractions.gcd(n,m)
    if g==1:
        return  n*m
    l=n*m//g
    i=1
    while l*i<m*n:
        if s[int(l*i//m)]!=t[int(l*i//n)]:
            return -1
        i+=1
    return  int(l)
print(agc(n,m,s,t))
D, W = map(int, input().split())
if W == 100:
    print(101*(100**D))
else:
    print(W*(100**D))




### FIXED CODE ###


N = int(input())

N_str = str(N)
S = sum([int(N_str[i]) for i in range(len(N_str))])

if N % S == 0:
    print('Yes')
else:
    print('No')
b = input()

if b == 'A':
  print('A')
elif b == 'C':
  print('T')
elif b == 'G':
  print('C')
else:
  print(G)


### FIXED CODE ###

b = input()

if b == 'A':
  print('T')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C')
else:
  print('A')
n,k=list(map(int,input().split()))
for i in range(k,n+2):
	s+=i*(n+n-(i-1))//2+1-(i*(i-1))//2
print(s%(1000000007))

### FIXED CODE ###

import math
import queue

def readInt():
	return int(input())

def readInts():
	return list(map(int, input().split()))

def readChars():
	return input().split()



x = readInts()
n = x[0]
k = x[1]

def ts(l):
	return int((l*(l-1))/2)

def ts2(l):
	return int(l*(n+n-(l-1))/2)


#for i in range(k,n):
#	for j in range(0,n-i+1):
#iは個数

#a = range(0+1,n+n-1 +1) #2
#b = range(0+1+2,n+n-1+n-2 +1) #3

s = 0

for i in range(k,n+2):
	#x = range(ts(i),ts2(i)+1)
	#print(ts2(i)+1-ts(i))
	#print(x)
	s += ts2(i)+1-ts(i)

print(s%(1000000007))
a,*b,c=input()
print(a+len(b)+c)

### FIXED CODE ###

a,*b,c=input()
print(a+str(len(b))+c)
N = int(input())
L = [ 0 ] * 86

L[0] = 2
L[1] = 1

for i in range(2, N+1):
  L[i] = L[i-2] + L[i-1]

print (L[N])

### FIXED CODE ###

N = int(input())
L = [ 0 ] * 1000000

L[0] = 2
L[1] = 1

for i in range(2, N+1):
  L[i] = L[i-2] + L[i-1]

print (L[N])
s=list(map(int,input().split()))
num=1
cost=s[0]
while cost < s[1]:
    num+=1
    cost=num*s[0]-1
print(num)

### FIXED CODE ###

s=input()
t=input()
result=0
if s[:1]==t[:1]:
    result=result+1

if s[1:2]==t[1:2]:
    result=result+1

if s[2:3]==t[2:3]:
    result=result+1
print(result)
import numpy as np

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

s = 0

for i in range(max(h)+1):
    flag = False
    for j in range(n):
        if flag and h[j] == 0:
            s += 1
            flag = False
        elif not flag and h[j] > 0:
            flag = True

        h[j] = max(h[j]-1, 0)
    if flag:
        s += 1

print(s)



### FIXED CODE ###

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

print(a * b // 2)
s=input()
s = s.split("/")
if s[0] < 2019:
    print("Heisei")

if s[0] == 2019 and s[0]<= 4:
    print("Heisei")
else:
    print("TBD")

### FIXED CODE ###

s = input()
 
if s <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
def main():
	w,h,x,y = map(int,input().split())

	if w % 2 != 0 or h % 2 != 0:
		ans_2 = 0
	if w % 2 == 0 and h % 2 == 0 and w//2 == x and h // 2 == y:
		ans_2 = 1

	ans_1 = (w*h) /2

	print(ans_1, ans_2)



if __name__ == '__main__':
	main()

### FIXED CODE ###

def main():
	w,h,x,y = map(int,input().split())

	ans_2 = 0
	
	if w % 2 != 0 or h % 2 != 0:
		ans_2 = 0
	elif w % 2 == 0 and h % 2 == 0 and w / 2 == x and h / 2 == y:
		ans_2 = 1

	ans_1 = (w*h) /2

	print(ans_1, ans_2)

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

def is_cuttable(A, K, N):
    n = 0
    for a in A:
        i = np.ceil(a / N)
        n += int(i) - 1
        if n > K:
            return False
    return True

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

n_max = max(A)
n = n_max // 2
n_min = 0

while True:
    if is_cuttable(A, K, n):
        n_max = n
    else:
        n_min = n
    if n_max - n_min < 2:
        break
    n = (n_max - n_min) // 2 + n_min
print(n_max)

### FIXED CODE ###

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

def is_cuttable(N):
    n = 0
    for a in A:
        i = a // N
        if a % N == 0:
            i -= 1
        n += int(i)
        if n > K:
            return False
    return True

n_max = 10 ** 10
n_min = 0

while n_max - n_min > 1:
    n = (n_max + n_min) // 2
    if is_cuttable(n):
        n_max = n
    else:
        n_min = n
    
print(n_max)
M = int(nput())

print("{}".format(48-M))

### FIXED CODE ###

M = int(input())

print("{}".format(48-M))
class abc_168:
    
    def __init__(self):
        pass
    
    def A(self):
       N=int(input())
       hon=[2,4,5,7,9]
       pon=[0,1,6,8]
       bon=[3]
       
       ans=N%100
       ans=ans%10
       
       if ans in hon:print("hon")
       elif ans in pon:print("pon")
       else :print("bon")
    
    def B(self):
        K=int(input())
        S=input()
        
        if len(S)<=K:print(S)
        else:
            ans=S[0:K]+"..."
            print(ans)
        
    def C(self):
        ABHM=list(map(int,input().split()))
        cos=[]
        for i in range(361):cos.append(math.cos(math.radians(i)))
        
        if ABHM[2]==0:ABHM[2]=12
        if ABHM[3]==0:ABHM[3]=60
        
        radi=int(((abs(ABHM[2]-(ABHM[3]/5))*5)-(ABHM[3]%5))*6)
        #print(radi)
        ans=(ABHM[0]**2)+(ABHM[1]**2)-(2*ABHM[0]*ABHM[1]*cos[radi])
        #print(cos[radi])
        #print(ans)
        print(math.sqrt(ans))
        
        
            
    def D(self):
        pass
        
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_168()
    obj.C()

### FIXED CODE ###

import math

class abc_168:
    
    def __init__(self):
        pass
    
    def A(self):
       N=int(input())
       hon=[2,4,5,7,9]
       pon=[0,1,6,8]
       bon=[3]
       
       ans=N%100
       ans=ans%10
       
       if ans in hon:print("hon")
       elif ans in pon:print("pon")
       else :print("bon")
    
    def B(self):
        K=int(input())
        S=input()
        
        if len(S)<=K:print(S)
        else:
            ans=S[0:K]+"..."
            print(ans)
        
    def C(self):
        ABHM=list(map(int,input().split()))
        
        radi=abs((ABHM[2]*5)+((ABHM[3]*5)/60)-ABHM[3])*6
        #print(radi)
        ans=(ABHM[0]**2)+(ABHM[1]**2)-(2*ABHM[0]*ABHM[1]*math.cos(math.radians(radi)))
        print(math.sqrt(ans))
            
    def D(self):
        pass
        
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_168()
    obj.C()
a, b = map(int, input())
print(a * b)

### FIXED CODE ###

a, b = map(int, input().split())
print(a * b)
a = input()
b = input()
c = input()
d = input()
e = input()
k = input()
a < b < c < d < e

f = abs(e - a)
if k >= f:
    print('Yay!')
else:
    print(':(')

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
#a < b < c < d < e

f = abs(e - a)
if k >= f:
    print('Yay!')
else:
    print(':(')
n, min_num, max_num = [int(x) for x in input().split()]
xs = range(1, n + 1)

def digit_sum(x):
  return sum([int(d) for d in str(x)])
answers = [x for x in xs if min_num <= digit_sum(x) <= max_num]

print(sum(answers)) for x in answers

### FIXED CODE ###

n, min_num, max_num = [int(x) for x in input().split()]
xs = range(1, n + 1)

def digit_sum(x):
  return sum([int(d) for d in str(x)])
answers = [x for x in xs if min_num <= digit_sum(x) <= max_num]

print(sum(answers))
a, b = map(int,raw_input().split())

if a<b:
    print ("a < b")
elif a>b:
    print ("a > b")
elif a==b:
    print ("a == b")
else:
    print ("none")

### FIXED CODE ###

a, b = map(int, input().split())
if a < b:
    print('a < b')
elif a > b:
    print('a > b')
else:
    print('a == b')