Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 1)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
_d = (2 * 10 ** 5) // d
D = X % d + (d * _d) + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 1):
  ans[i] = solve(i, 0)
  
Us[0] = 1 % u
Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i-1] * 2) % u
  Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(X <= 2 * 10 ** 5 + 1):
    if(x[i] == '0'):
      print(solve2(X + 2 ** (n - i - 1), u))
    else:
      print(solve2(X - 2 ** (n - i - 1), d))
  else:
    if(x[i] == '0'):
      print(solve2(U + Us[n-i-1], u))
    else:
      print(solve2(D - Ds[n-i-1], d))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

n = int(input())
x = input()
z = '1' * n
o = '0' * n
X = int(x, 2)

if (n == 1 and x == '1'):
  print(0)
  exit()

if (z == x):
  u = n - 1
  d = n - 1
elif (o == x):
  u = 1
  d = 1
else:
  tmp = len(list(filter(lambda x: x == '1', x)))
  u = tmp + 1
  d = tmp - 1


def popcount(i):
  return i % len(list(filter(lambda x: x == '1', format(i, 'b'))))


def solve(i, count):
  if (i <= 2 * 10**5 and ans[i] != 0):
    return count + ans[i]
  elif (i == 0):
    return count
  else:
    return solve(popcount(i), count + 1)


def solve2(i, div):
  if (i <= 2 * 10**5):
    return ans[i]
  else:
    return ans[i % div] + 1


ans = [0] * (2 * 10 ** 5 + 4)
_u = (2 * 10 ** 5) // u
U = X % u + (u * _u) + u
if(d != 0):
  _d = (2 * 10 ** 5) // d
  D = X % d + (d * _d) * 2 + d * 2
Us = [0] * (2 * 10 ** 5)
Ds = [0] * (2 * 10 ** 5)
for i in range(1, 2 * 10 ** 5 + 4):
  ans[i] = solve(i, 0)
Us[0] = 1 % u
if(d != 0):
  Ds[0] = 1 % d
for i in range(1, 2 * 10 ** 5):
  Us[i] = (Us[i - 1] * 2) % u
  if(d != 0):
    Ds[i] = (Ds[i-1] * 2) % d

for i in range(n):
  if(x[i] == '0'):
    print(solve2(U + Us[n-i-1], u))
  else:
    if (d == 0):
      print(0)
    else:
      print(solve2(D - Ds[n-i-1], d))
for i in range(0, N+1):
    for j in range(0, N+1-i):
        if i == ((Y - 1000*N - 4000*j) / 9000):
            if (N-i-j) >= 0: print(str(i) + " " + str(j) + " " +str(N-i-j))
            exit()
print ("-1 -1 -1")

### FIXED CODE ###

def calcPattern(N, Y):
    for i in range(0, N+1):
        for j in range(0, N+1):
            if i == ((Y - 1000*N - 4000*j) / 9000):
                if (N-i-j) >= 0: return (str(i) + " " + str(j) + " " +str(N-i-j))
    return ("-1 -1 -1")

n,y = map(int, input().split())
print(calcPattern(n,y))
N = int(input())
A = [int(i) for i in input().split()]

A.sort()
su = 0
m = 0
for i in range(N):
    if A[i] < 0:
       su -= A[i]
       m += 1
    else:
       su += A[i]

if m % 2 == 1:
    print(su - 2 * A[m])
else:
    print(su)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]

m = 0
su = 0
mi = 10 ** 10
for ai in A:
    if ai < 0:
        m += 1
    mi = min(mi, abs(ai))
    su += abs(ai)

if m % 2 == 1:
    print(su - 2 * mi)
else:
    print(su)
L,R = map(int,input().split())
mod = 2019
if R-L==1:
    print((L*R)%mod)
    exit()
li = [i%mod for i in range(L,R+2019)]
li.sort()
if li[0]==0:
    print(li[1]*li[2])
else:
    print(li[0*li[1])

### FIXED CODE ###

L,R = map(int,input().split())
r = min(R,L+4038)
ans = 2018
for i in range(L,r+1,1):
    for j in range(i+1,r+1):
        tmp = (i*j)%2019
        ans = min(tmp,ans)
print(ans)
from math import factorial

N, K = map(int, input().split())
MOD = 10 ** 9 + 7
for i in range(1, K + 1):
    ans = factorial(N - K + 1) // (factorial(i) * factorial(N - K + 1 - i)) * factorial(K - 1) // (
                factorial(i - 1) * factorial(K - 1 - i + 1))
    print(ans % MOD)


### FIXED CODE ###

from math import factorial

N, K = map(int, input().split())
MOD = 10 ** 9 + 7
for i in range(1, K + 1):
    if N-K+1 < i or K-1 < i-1:
        ans = 0
    else:
        ans = factorial(N - K + 1) // (factorial(i) * factorial(N - K + 1 - i)) * factorial(K - 1) // (
                factorial(i - 1) * factorial(K - 1 - i + 1))
    print(ans % MOD)
n, m = map(int, input().split())
b = [0] * m
count = 0

for _ in range(n):
    a = list(map(int, input().split()))
    for i in range(1, a[0] + 1):
        b[a[i]] += 1

for i in range(m):
    if b[i] == n:
        count += 1

print(count)

### FIXED CODE ###

n, m = map(int, input().split())
b = [0] * m
count = 0

for _ in range(n):
    a = list(map(int, input().split()))
    for i in range(1, a[0] + 1):
        b[a[i] - 1] += 1

for i in range(m):
    if b[i] == n:
        count += 1

print(count)
input_lines = input().split()
N = int(input_lines[0])
M = int(input_lines[1])
S = input()
T = input()

def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

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

L = int(lcm(N,M))
x = 1
count = 0
if N >= M:
    big = N
    small = M
else:
    big = M
    small = N
    
while True:
    k = L*x
    flag = 1
    for j in range(small):
        left = 0
        right = big - 1
        while left <= right:
            mid = (left+right)//2
            if((mid-1)*k/big+1 == (j-1)*k/small+1):
                if(S[mid-1] != T[j-1]):
                    flag = 0
                    count += 1
                    break
                else:
                    break
            elif((mid-1)*k/big+1 > (j-1)*k/small+1):
                right = mid - 1
            else:
                left = mid + 1
    if(flag == 1):
        print(k)
        break
    if(count == 2):
        print(-1)
        break
    x += 1


### FIXED CODE ###

input_lines = input().split()
N = int(input_lines[0])
M = int(input_lines[1])
S = input()
T = input()

def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

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

L = int(lcm(N,M))
x = 1
count = 0
while True:
    k = L*x
    flag = 1
    starti = 0
    startj = 0
    for i in range(starti, N):
        for j in range(startj, M):
            hoge = i*k/N+1
            fuga = j*k/M+1
            if(hoge < fuga):
                startj = j - 1
                break
            elif(hoge == fuga):
                if(S[i] != T[j]):
                    flag = 0
                    count += 1
                    break
        if(flag == 0):
            break
    if(flag == 1):
        print(k)
        break
    if(count == 2):
        print(-1)
        break
    x += 1
a = [input() for _ in range(int(input()))]
print("AC x {0}".format(a.count("AC"))
print("WA x {0}".format(a.count("WA"))
print("TLE x {0}".format(a.count("TLE"))      
print("RE x {0}".format(a.count("RE"))

### FIXED CODE ###

a = [input() for _ in range(int(input()))]
print("AC x {}".format(a.count("AC")))
print("WA x {}".format(a.count("WA")))
print("TLE x {}".format(a.count("TLE")))
print("RE x {}".format(a.count("RE")))
import math
V, E = [int(_) for _ in input().split()]
G = {}

for i in range(V):
    G[i] = {}
for _ in range(E):
    s, t, c = [int(_) for _ in input().split()]
    s -= 1  # 0を始点とする場合
    t -= 1  # 0を始点とする場合
    G[s][t] = -c

INF = math.inf

D = [INF] * V
D[0] = 0  # 0を始点とする場合
count = 0
while True:
    count += 1
    update = False
    for s in G.keys():
        for t in G[s].keys():
            if D[s] != INF and D[t] > D[s] + G[s][t]:
                D[t] = D[s] + G[s][t]
                update = True
    if not update:
        break
    if count == V:
        print('inf')
        exit()
print(-D[-1])


### FIXED CODE ###

V, E = [int(_) for _ in input().split()]
G = {}

for i in range(V):
    G[i] = {}
for _ in range(E):
    s, t, c = [int(_) for _ in input().split()]
    s -= 1  # 0を始点とする場合
    t -= 1  # 0を始点とする場合
    G[s][t] = -c

INF = float('inf')

D = [INF] * V
D[0] = 0  # 0を始点とする場合
count = 0
while True:
    count += 1
    update = False
    update_n = False
    for s in G.keys():
        for t in G[s].keys():
            if D[s] != INF and D[t] > D[s] + G[s][t]:
                D[t] = D[s] + G[s][t]
                update = True
                if t == V - 1:
                    update_n = True
    if not update or count == V:
        break
if update_n:
    print('inf')
else:
    print(-D[-1])
N, M = map(int, input().split())
A = list(map(int, input().split()))

A = sorted(A)[::-1]

waribiki = 0
index = 0

if len(A)==1:
    print(A[0]//pow(2,M))
    exit()

while waribiki < M:
    if index < N and A[index]>2 and A[index+1]>2:
        x = A[index] // A[index+1]
        if x+waribiki>M: x = M-waribiki
    else: x = 1

    if A[index] > 2:
        A[index] = A[index]//pow(2, x)
        waribiki+=x

    index += 1
    if index==N: index=0

print(sum(A))


### FIXED CODE ###

#!/usr/bin/env python3
import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x*(-1), A))  # 各要素を-1倍

heapq.heapify(A)

if N == 1:
    MAX = heapq.heappop(A)//2**M 
    if MAX < 0:
        print(0)
    else:
        print(MAX)
    exit()

cnt = 0
while M > 0:
    MAX = heapq.heappop(A)
    if MAX % 2 == 0:
        heapq.heappush(A, MAX//2)
    else:
        heapq.heappush(A, MAX//2+1)

    M -= 1

print(-sum(A))
import sys
input = sys.stdin.readline
import numpy as np
def print_ans(N, ar):
    b_list = np.zeros(10**9 + 1, dtype = int)
    flg = True
    for a in ar:
        if b_list[a] == 1:
            flg = False
            break
        b_list[a] = 1
    if flg:
        print("YES")
    else:
        print("NO")
    
    

if __name__ == '__main__':
    N = int(input().rstrip())
    ar = list(map(int,input().rstrip().split()))
    print_ans(N, ar)




### FIXED CODE ###

import sys
input = sys.stdin.readline
import numpy as np
def print_ans(N, ar):
    """Test Case
    >>> print_ans(5, [2, 6, 1, 4, 5])
    YES
    >>> print_ans(6, [4, 1, 3, 1, 6, 2])
    NO
    >>> print_ans(2, [10000000, 10000000])
    NO
    """
    br = set(ar)
    print("YES" if len(br) == N else "NO")
    

if __name__ == '__main__':
    N = int(input().rstrip())
    ar = list(map(int,input().rstrip().split()))
    print_ans(N, ar)
import math
N=int(input())
x=[0]*N
y=[0]*N
for i in range(N):
    x[i],y[i]=map(int,input().split())
ans_sum=0
for i in range(N):
    for j in range(N):
        if i!=j:
            ans_sum+=math.sqrt((x[i]-x[j])**2+(y[i]-y[j])**2)
print(ans_sum*(n-1)/math.factorial(N))

### FIXED CODE ###

import math
N=int(input())
x=[0]*N
y=[0]*N
for i in range(N):
    x[i],y[i]=map(int,input().split())
ans_sum=0
for i in range(N):
    for j in range(N):
            ans_sum+=math.sqrt((x[j]-x[i])**2+(y[j]-y[i])**2)
print(ans_sum/N)
import sys
sys.setrecursionlimit(10**8)
import functools
@functools.lru_cache(maxsize=None)  
def solve(N):
    if N==0:
        return 0
    if N==1:
        return D
    tmp=N*D    
    if N%2==0:
        tmp=min(tmp,solve(N//2)+A)
    else:
        tmp=min(tmp,solve((N-1)//2)+A+D,solve((N+1)//2)+A+D)
    if N%3==0:
        tmp=min(tmp,solve(N//3)+B)
    else:
        b=N%3 
        tmp=min(tmp,solve((N+(3-b))//3)+B+(3-b)*D,solve((N-b)//3)+B+b*D)
    if N%5==0:
        tmp=min(tmp,solve(N//5)+C)
    else:
        c=N%5
        tmp=min(tmp,solve((N-c)//5)+C+D*c,solve((N+(5-c))//5)+C+D*(5-c))
    return tmp

for _ in range(T):
    N,A,B,C,D=map(int,input().split())
    print(solve(N))


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**8)
T=int(input())

def solve(N):
    if N==0:
        return 0
    if N==1:
        return D
    if N in dic:
        return dic[N]
    tmp=N*D    
    if N%2==0:
        tmp=min(tmp,solve(N//2)+A)
    else:
        tmp=min(tmp,solve((N-1)//2)+A+D,solve((N+1)//2)+A+D)
    if N%3==0:
        tmp=min(tmp,solve(N//3)+B)
    else:
        b=N%3 
        tmp=min(tmp,solve((N+(3-b))//3)+B+(3-b)*D,solve((N-b)//3)+B+b*D)
    if N%5==0:
        tmp=min(tmp,solve(N//5)+C)
    else:
        c=N%5
        tmp=min(tmp,solve((N-c)//5)+C+D*c,solve((N+(5-c))//5)+C+D*(5-c))
    dic[N]=tmp
    return tmp

for _ in range(T):
    N,A,B,C,D=map(int,input().split())
    dic={}
    print(solve(N))
H, W, N = (int(i) for i in input().split())

P = []
for i in range(N):
    pa, pb = input().split()
    P.append((int(pa)-1, int(pb)-1))

Q = {}
for pa, pb in P:
    for i in range(3):
        for j in range(3):
            if (pa - i >= 0) and (pb - j >= 0) and (pa - i <= H - 3) and (pb - j <= W - 3):
                if (pa - i, pb - j) in Q:
                    Q[(pa - i, pb - j)] += 1
                else:
                    Q[(pa - i, pb - j)] = 1
cnt = [0] * 9
for k, v in Q.items():
    cnt[v] += 1
cnt[0] = (H - 2) * (W - 2) - len(Q)
print(cnt)

### FIXED CODE ###

H, W, N = (int(i) for i in input().split())

P = []
for i in range(N):
    pa, pb = input().split()
    P.append((int(pa)-1, int(pb)-1))

Q = {}
for pa, pb in P:
    for i in range(3):
        for j in range(3):
            if (pa - i >= 0) and (pb - j >= 0) and (pa - i <= H - 3) and (pb - j <= W - 3):
                if (pa - i, pb - j) in Q:
                    Q[(pa - i, pb - j)] += 1
                else:
                    Q[(pa - i, pb - j)] = 1
cnt = [0] * 10
for k, v in Q.items():
    cnt[v] += 1
cnt[0] = (H - 2) * (W - 2) - len(Q)
for i in range(10):
    print(cnt[i])
from heapq import heappop,heappush
n = int(input())
A = sorted(list(map(int,input().split())))
P = []
M = []
if n == 2:
    print(A[1]-A[0])
    print(A[1],A[0])
    exit()
if all(a == 0 for a in A):
    print(0)
    for i in range(n-1):
        print(0,0)
    exit()
def move():
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
for a in A:
    if a>=0:
        P.append(a)
    else:
        M.append(a)

if A[-1]>=0 and A[0]<=0:
    print(sum(abs(a) for a in A))
elif A[0]>=0:
    print(sum(A)-min(A)*2)
    mm = heappop(P)
    pp = heappop(P)
    print(mm,pp)
    heappush(M,mm-pp)
else:
    print(sum(abs(a) for a in A)+max(A)*2)
    mm = M[-1]
    pp = M[-2]
    print(mm,pp)
    M = M[:-2]
    heappush(P,mm-pp)
move()

### FIXED CODE ###

from heapq import heappop,heappush
n = int(input())
A = sorted(list(map(int,input().split())))
P = []
M = []
if n == 2:
    print(A[1]-A[0])
    print(A[1],A[0])
    exit()
def move():
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
for a in A:
    if a>=0:
        P.append(a)
    else:
        M.append(a)

if A[-1]>=0 and A[0]<0:
    print(sum(abs(a) for a in A))
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
elif A[0]>=0:
    print(sum(A)-min(A)*2)
    mm = heappop(P)
    pp = heappop(P)
    print(mm,pp)
    heappush(M,mm-pp)
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
else:
    print(sum(abs(a) for a in A)+max(A)*2)
    mm = M[-1]
    pp = M[-2]
    print(mm,pp)
    M = M[:-2]
    heappush(P,mm-pp)
    while len(P)!= 1:
        mm = heappop(M)
        pp = heappop(P)
        print(mm,pp)
        heappush(M,mm-pp)
    while len(M) != 0:
        mm = heappop(M)
        pp = heappop(P)
        print(pp,mm)
        heappush(P,pp-mm)
def f(j,k):
  tmp=j-C[k]
  if tmp>M[k]: M[k]
  return

while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): f(j,k)
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([M[i]*i for i in range(h+1) if M[i]>0])
  print s

### FIXED CODE ###

while 1:
  h,w = map(int, raw_input().split())
  if h==w==0: break
  M = [0]*(h+1)
  a=[0]*w
  for i in range(h):
    x = raw_input()
    b=[0]*w
    sp=-1
    C = [-1]*(h+1)
    for j in range(w):
      if x[j]=="*": c=0
      else: c=a[j]+1
      b[j]=c
      dw=c-sp
      if dw>0: C[sp+1:c+1]=[j]*dw
      elif dw<0:
        for k in range(c+1,sp+1): M[k]=max(M[k],j-C[k])
        C[c+1:sp+1]=[-1]*(-dw)
      sp=c
    for k in range(1,sp+1):
      if C[k]>=0: M[k]=max(M[k],w-C[k])
    a=b
  s=max([a*b for a,b in zip(M, range(h+1))])
  print s
for q in range(12000):
    a = tuple(map(int, input().split()))
    b = input()
    if a[0] == 0 and b[0] == '0':
        break

    hit = 0
    for i in range(4):
        if a[i] == int(b[i]):
            hit = hit + 1

    blow = 0
    for j in range(4):
        for i in range(4):
            if (int(b[j]) == a[i]) and (a[i] != int(b[i])) and (a[j] != int(b[j])):
                blow = blow + 1

    print(hit, blow)

### FIXED CODE ###

while True:
    a, b = input().split()
    if a[0] is '0' and b[0] is '0':
        break
 
    hit = sum(1 for c, d in zip(a, b) if d is c)
    blow = sum(1 for e in b if e in a) - hit
    print(hit, blow)
def flatten(nested_list):
    return [e for inner_list in nested_list for e in inner_list]
nk = input().split()
kai = int(nk[0])
banme = int(nk[1])
lis = []
i = 0
while(i < kai):
    c = input().split()
    a = int(c[0])
    b = int(c[1])
    n = 0
    tmplis = [a] * b
    lis.append(tmplis)
    print(lis)
    i += 1
    pass
lis = flatten(lis)
slis = sorted(lis)
ans = slis[banme]
print(ans)

### FIXED CODE ###

string = input().split()
a = int(string[0])
b = int(string[1])
c = int(string[2])
if a <= c and b >= c:
    print("Yes")
    pass
else:
    print("No")
    pass
print(x*x*x)


### FIXED CODE ###

number = int(input())
print(number**3)
s=input()
if s=="RRR":
	print(3)
elif s=="RRS" or s=="SRR":
	print(2)
elif s=="SSR" or s=="SRS" or s=="RSS" or s=="RSR”:
	print(1)
else:
	print(0)

### FIXED CODE ###

s=input()
if s=="RRR":
	print(3)
elif s=="RRS" or s=="SRR":
	print(2)
elif s=="SSR" or s=="SRS" or s=="RSS" or s=="RSR":
	print(1)
else:
	print(0)
S = input()
T = input()

sl = len(S)
tl = len(T)

for i in range(sl-tl+1):
    s = S[i:i+tl]
    flag = True
    for j in range(tl):
        if s[j] == T[j]:
            continue
        elif s[j] == '?':
            continue
        elif s[j] != T[j] and s[j] != '?':
            flag = False
            break
            
    if flag == True:
        ans = S[:i] + T + s[i+tl:]
        break
        
if flag == False:
    print('UNRESTORABLE')
else:
    print(ans.replace('?','a'))
            

### FIXED CODE ###

S = input()
T = input()
S2 = S.replace('?','a')
ans = []

for i in range(len(S)-len(T)+1):
    S_sub = S[i:i+len(T)]
    
    check = True
    
    for s,t in zip(S_sub,T):
        if s != t and s == '?':
            continue
        elif s == t:
            continue
        elif s != t and s != '?':
            check = False
            break
        
    if check == True:
        tmp = S2[:i] + T + S2[i+len(T):]
        ans.append(tmp)
        
if len(ans) != 0:
    answer = sorted(ans)[0]
else:
    answer = 'UNRESTORABLE'
    
print(answer)
a,b,c,d = [int(x) for x in input.sprit()]
print(a*b) if (a*b) >= (c*d) else print(c*d)


### FIXED CODE ###

a,b,c,d = [int(x) for x in input().split()]
print(a*b) if (a*b) >= (c*d) else print(c*d)
import math
x=int(input())
primemode = True
while primemode:
  sos = True
  for n in range(math.floor(math.sqrt(x))):
    if n+1 != 1:
      if x\(n+1) == 0:
        sos = False
  if sos:
    primemode = False
  x = x+1
print(x)

### FIXED CODE ###

import math
x=int(input())
primemode = True
while primemode:
  sos = True
  for n in range(math.floor(math.sqrt(x))):
    if n+1 != 1:
      if x%(n+1) == 0:
        sos = False
  if sos:
    primemode = False
  else:
    x = x+1
print(x)
K,X=input().split()
if 500 * K >= X:
  return 'Yes'
else:
  return 'No'

### FIXED CODE ###

K,X=(int(x) for x in input().split())
if 500 * K >= X:
    print('Yes')
else:
    print('No')
import math
xyzk = list(map(int,input().split()))
abc = [list(map(int,input().split())) for a in range(3)]
ab=[]
for a in abc[0]:
    for b in abc[1]:
        ab.append(a+b)
ab.sort()
ab.reverse()
abc[2].sort()
abc[2].reverse()
abc2=[]
for c in range(abc[2]):
    for a in range(min([xyzk[3]/(c+1),len(ab)])):
        abc2.append(abc[2][c]+ab[a])
abc2.sort()
abc2.reverse()
for a in range(xyzk[3]):
    print(abc2[a])

### FIXED CODE ###

import math
xyzk = list(map(int,input().split()))
abc = [list(map(int,input().split())) for a in range(3)]
ab=[]
for a in abc[0]:
    for b in abc[1]:
        ab.append(a+b)
ab.sort()
ab.reverse()
abc[2].sort()
abc[2].reverse()
abc2=[]
for c in range(len(abc[2])):
    for a in range(min([math.ceil(xyzk[3]/(c+1)),len(ab)])):
        abc2.append(abc[2][c]+ab[a])
abc2.sort()
abc2.reverse()
for a in range(xyzk[3]):
    print(abc2[a])
# -*- coding: utf-8 -*-
A = int(input())
if A < 1:
    print('×')
else:
    B = int(input())
    if B < 0:
        print('×')
    else:    
        T = int(input())
        if T < 0 and T > 20:
            print('×')
        else:                    
            T+=0.5
            ans = (T // A) *B
            print(ans)

### FIXED CODE ###

hoge = input()

a, b, t = [int(x) for x in hoge.split(' ')]

print(int(((t+0.5)//a)*b))
L,R,d = input(int(_) for _ in input().split())

for i in range(d):
  if(i%d == 0) cnt++
  
print(cnt)

### FIXED CODE ###

L,R,d=map(int, input().split())
cnt=0
 
for i in range(L, R+1):
  if i%d == 0: cnt+=1
  
print(cnt)
#a, b, c = map(int, input().split())
a, b, c = map(int, input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES)
else:
  print("NO")

### FIXED CODE ###

# スペース区切りの整数の入力
a, b, c = map(int, input().split())
num = a*100 + b*10 + c
if num % 4 == 0:
  print("YES")
else:
  print("NO")
def check(N):
    if type(N) == int and N >= 1 and N <= 9:
        return(N**3)       
check(N)

### FIXED CODE ###

N = int(input())
if N >= 1 and N <= 9:
  print(N**3)
n = int(input())
a = input().split(" ")
lista = [int(n) for n in a]
if 0 in lista:
  print(0)
  exit(0)
else:
  kotae=1
  for i in range(n+1):
    kotae=kotae*lista[i]
    if kotae>10**18:
        print(-1)  
        exit(0)
  print(kotae)


### FIXED CODE ###

n = int(input())
a = input().split(" ")
kotae=1
listaa = [int(n) for n in a]
lista = sorted(listaa)
if lista[0]==0:
  print(0)
  exit()
for i in range(n):
  kotae*=lista[i]
  if kotae>10**18:
    kotae=-1
    break
if kotae>10**18:
  kotae=-1
print(kotae)
# -*- coding: utf-8 -*-

N = int(input())
a = list(map(int, input().split(" ")))
c = []

for i in a:
  count = 0
  while not(a % 2):
    a = int(a / 2)
    count += 1
    c.append(count)
print(min(c))

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
N = int(input())
a = list(map(int, input().split(" ")))
c = []
 
for i in a:
  count = 0
  while not(i % 2):
    i = int(i / 2)
    count += 1
  c.append(count)
print(min(c))
N = int(input())
A = list(map(int,input().split()))

import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

score = 0
for i in range(N):
    B = A
    keep = B.pop(0)
    n = gcd_list(B)
    if n > score:
        score = n
    A.append(keep)


print(score)

### FIXED CODE ###

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

import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

L = [0 for i in range(N+1)]
R = [0 for j in range(N+1)]

for i in range(N):
    L[i+1] = fractions.gcd(L[i],A[i])
    R[N-1-i] = fractions.gcd(R[N-i],A[N-i-1])

M = 0
for i in range(N):
    M = max(M,fractions.gcd(L[i],R[i+1]))

print(M)