Harryxun/stf_run huggingface dataset:
a=int(input())
S=input()

if a=>3200:
  print(S)
else:
  print("red")

### FIXED CODE ###

a=int(input())
S=input()

if a>=3200:
  print(S)
else:
  print("red")
import bisect


def dfs(v, x, g, used, ans):
    used[v] = True
    res = x[v]
    for e in g[v]:
        if used[e[0]]:
            continue
        r = dfs(e[0], x, g, used, ans)
        if r:
            ans.append(e[1])
        res ^= r
    return res


def main():
    n, m = map(int, input().split())
    ab = [[] for _ in range(n)]
    ans = []
    g = [[] for _ in range(n+1)]
    used = [False] * (n+1)

    for i in range(n):
        ab[i] = list(map(int, input().split()))
    ab = sorted(ab, key=lambda x: x[0])
    al = list(map(lambda x: x[0], ab))
    for i in range(m):
        l, r = map(int, input().split())
        l = bisect.bisect_left(al, l)
        r = bisect.bisect_right(al, r)
        g[l].append((r, i+1))
        g[r].append((l, i+1))

    x = [0] * (n+1)
    x[0] = ab[0][1]
    for i in range(n-1):
        x[i+1] = ab[i][1] ^ ab[i+1][1]
    x[n] = ab[n-1][1]

    for i in range(n+1):
        if used[i]:
            continue
        if dfs(i, x, g, used, ans):
            print(-1)
            return

    ans.sort()
    print(len(ans))
    print(*ans)


main()


### FIXED CODE ###

import bisect
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


def dfs(v, x, g, used, ans):
    used[v] = True
    res = x[v]
    for e in g[v]:
        if used[e[0]]:
            continue
        r = dfs(e[0], x, g, used, ans)
        if r:
            ans.append(e[1])
        res ^= r
    return res


def main():
    n, m = map(int, input().split())
    ab = [[] for _ in range(n)]
    ans = []
    g = [[] for _ in range(n+1)]
    used = [False] * (n+1)

    for i in range(n):
        ab[i] = list(map(int, input().split()))
    ab = sorted(ab, key=lambda x: x[0])
    al = list(map(lambda x: x[0], ab))
    for i in range(m):
        l, r = map(int, input().split())
        l = bisect.bisect_left(al, l)
        r = bisect.bisect_right(al, r)
        g[l].append((r, i+1))
        g[r].append((l, i+1))

    x = [0] * (n+1)
    x[0] = ab[0][1]
    for i in range(n-1):
        x[i+1] = ab[i][1] ^ ab[i+1][1]
    x[n] = ab[n-1][1]

    for i in range(n+1):
        if used[i]:
            continue
        if dfs(i, x, g, used, ans):
            print(-1)
            return

    ans.sort()
    print(len(ans))
    print(*ans)


main()
input_line=int(input())
count=0
input_list=[]
while count < input_line:
  input_list.append(input())
  count+=1
ans={}
max_appeard=0
ans_list=[]
list_set=set[ans_list]
for item in list_set:
    appeard=input_list.count(item)
    ans[item]=appeard
    if appeard > max_appeard:
        max_appeard=appeard
for key,value in ans.items():
    if value==max_appeard:
        ans_list.append(key)
ans_list.sort()
for item in ans_list:
  print (item)

### FIXED CODE ###

from collections import defaultdict

H=int(input())
d = defaultdict(int)
for _ in range(H):
    d[input()] += 1
max_appeard=max(d.items(), key=lambda x: x[1])[1]
ans=[k for k,v in d.items() if v == max_appeard]
ans.sort()
for item in ans:
  print (item)
def u(a,b):
  if(a<b):
    z = b
    b = a
    a = z
   r = a % b;
  while(r!=0):
    a = b
    b = r
    r = a % b
  return b

l = int(input())
s = 0
for i in range(1,l+1):
  for i2 in range(1,l+1):
    z = u(i,i2)
    for i3 in range(1,l+1):
      z2 = u(z,i3)
      s+=z2
print (s)

### FIXED CODE ###

def u(a,b):
  if(a<b):
    z = b
    b = a
    a = z
  r = a % b
  while(r!=0):
    a = b
    b = r
    r = a % b
  return b
 
l = int(input())
s = 0
for i in range(1,l+1):
  for i2 in range(1,l+1):
    z = u(i,i2)
    for i3 in range(1,l+1):
      z2 = u(i3,z)
      s+=z2
print (s)
a, b = input().split()
a = int(a)
# b = int(float(b) * 100 +0.1)
b = int(b.replace(".". ""))
print(int(a*b) // 100)


### FIXED CODE ###

a, b = input().split()
a = int(a)
b = int(float(b) * 100 +0.1)
print(int(a*b) // 100)
for i in range(1, 11):
    for j in range(1, 11):
        str = str(i) + "x" + str(j) + "=" + str(j*i)
        print(str)

### FIXED CODE ###

for i in range(1, 10):
    for j in range(1, 10):
        string = str(i) + "x" + str(j) + "=" + str(j*i)
        print(string)
a=input()
print("Good") if a[0]!=a[1]&a[1]!=a[2]&a[2]!=a[3] else print("Bad")

### FIXED CODE ###

a=input()
if a[0]==a[1] or a[1]==a[2] or a[2]==a[3]:
  print("Bad")
else:
  print("Good")
N=[int(x) for x in input().split()]
if not N[2]%N[1]==0:
   c=N[2]//N[1]+1
else:
    c=N[2]//N[1]
if not N[0]%N[3]==0:
   d=N[0]//N[3]+1
else:
    d=N[0]//N[3]
if d>=c:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N=[int(x) for x in input().split()]
if N[0]>N[1]:
    print("safe")
else:
   print("unsafe")
def main():
    import sys
    input = sys.stdin.readline

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

    from scipy.sparse import csgraph, csr_matrix

    start = [i for i in range(N-1)] + [i for i in range(N-2)]
    end = [i+1 for i in range(N-1)] + [i+2 for i in range(N-2)]
    cost = [abs(h1-h2) for h1, h2 in zip(H[0:-1], H[1:])] + \
        [abs(h1-h2) for h1, h2 in zip(H[0:-2], H[2:])]
    csr = csr_matrix((cost, (start, end)), shape=(N, N))
    d = csgraph.shortest_path(csr, method='D')

    print(int(d[0][N-1]))


if __name__ == "__main__":
    main()


### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline

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

    inf = float("inf")
    dp = [inf]*N

    dp[0] = 0
    step1, step2 = inf, inf

    for i in range(1, N):
        step1 = abs(H[i-1]-H[i]) + dp[i-1]
        if i >= 2:
            step2 = abs(H[i-2]-H[i]) + dp[i-2]
        step = min(step1, step2)

        dp[i] = min(dp[i], step)
    print(dp[-1])


if __name__ == "__main__":
    main()
N,K=map(int,input().split())
print((N//K)**3+((K+1)%2)*(N//K+(N-(N//K)*K)//(K//2))**3)

### FIXED CODE ###

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

if K%2==1:
  print((N//K)**3)
else:
  print((N//K)**3+(N//K+(N-(N//K)*K)//(K//2))**3)
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

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

t = 0
for i in a:
    m = i
    while m % 2 == 0:
        t += 1
        m /= 2

print(t)


### FIXED CODE ###

#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

d, n = map(int, input().split())

a = 0
if d == 0:
    a = n
    if n == 100:
        a += 1
elif d == 1:
    a = 100 * n
    if n == 100:
        a += 100
elif d == 2:
    a = 100 * 100 * n
    if n == 100:
        a += 100 * 100

print(a)
#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 -D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004- D
x2006 = r * x2005- D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
X = [x2001,x2002,x2003,x2004,x2005,x2006,x2007.x2008,x2009,x2010]
print(X)

### FIXED CODE ###

#coding:utf-8
r,D,x = map(int,input().split())
x2001 = r * x - D
x2002 = r * x2001 - D
x2003 = r * x2002 - D
x2004 = r * x2003 - D
x2005 = r * x2004 - D
x2006 = r * x2005 - D
x2007 = r * x2006 - D
x2008 = r * x2007 - D
x2009 = r * x2008 - D
x2010 = r * x2009 - D
print(x2001)
print(x2002)
print(x2003)
print(x2004)
print(x2005)
print(x2006)
print(x2007)
print(x2008)
print(x2009)
print(x2010)
D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        for i in additional_:
            if i[1] != 1:
                add_score = i
                break
        
        for k in range(1, add_score[1]):
            score += add_score[0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)

### FIXED CODE ###

D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        # for i in additional_:
        #     if i[1] > 1:
        #         add_score = i
        #         break

        add_score = additional_[0]

        for k in range(add_score[1]-1):
            score += add_score[0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
if N == 1:
    print(1)
    exit()
xy.sort(key = lambda x:x[0])
d = {}
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        tmp = (xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
        if not tmp in d:
            d[tmp] = 0
        d[tmp] += 1
        #print(xy[i][0] - xy[j][0], xy[i][1] - xy[j][1])
    #print()
d = sorted(d.items(), key = lambda x:-x[1])
print(N - d[0][1])

### FIXED CODE ###

N, K = map(int, input().split())
print(N%K)
s=input()
ans="AC"
cnt1=0
cnt2=0
cnt3=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            ans="WA"
    if i==1:
        cnt1+=s[i].isupper()*1
    if i>=2:
        if i==len(s)-1:
            if s[i]=="C":
                ans="WA"
        elif s[i]=="C":
            cnt2+=1
        else:
            cnt3+=s[i].isupper()*1
if cnt1!=0 or cnt2!=1 or cnt!=0:
    ans="WA"
print(ans)

### FIXED CODE ###

s=input()
ans="AC"
cnt1=0
cnt2=0
cnt3=0
for i in range(len(s)):
    if i==0:
        if s[i]!="A":
            ans="WA"
    if i==1:
        cnt1+=s[i].isupper()*1
    if i>=2:
        if i==len(s)-1:
            if s[i]=="C":
                ans="WA"
            elif s[i].isupper()*1>0:
                ans="WA"
        elif s[i]=="C":
            cnt2+=1
        else:
            cnt3+=s[i].isupper()*1
if cnt1!=0 or cnt2!=1 or cnt3!=0:
    ans="WA"
print(ans)
n = int(input())
a = list(map(int,input().split()))
ball = [0 for i in range(n)]
count = 0
index = []

for i in range(n-1, (n+1)//2 -1, -1):
    if a[i] == 1:
        ball[i] = 1
        count += 1
        index.append(i+1)
for i in range((n+1)//2, -1, -1):
    if ball[i + (i+1)] % 2 != a[i]:
        ball[i] = ball[i + (i+1)] + 1
        count += 1
        index.append(i+1)
    else:
        ball[i] = ball[i + (i+1)]
        
ans = ""
for i in range(len(index)):
    if i < len(index)-1:
        ans += str(index[i]) + " "
    else:
        ans += str(index[i])
print(count)
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
ball = [0 for i in range(n)]
count = 0 #ボールが入ってる箱の数
index = [] #ボールが入ってる番号

for i in range(n-1, -1, -1):
    balls = 0
    j = i
    while j +(i+1) < n:
        j += i + 1
        balls += ball[j]
    
    if a[i] != balls%2:
        ball[i] = 1
        count += 1
        index.append(i+1)
        
ans = ""
for i in range(len(index)):
    if i < len(index)-1:
        ans += str(index[i]) + " "
    else:
        ans += str(index[i])
print(count)
print(ans)
n, c = map(int, input().split())
data = [[0 for i in range(c+1)] for j in range(10**5+1)]
for i in range(n):
    s, t, channel = map(int, input().split())
    data[s][channel] += 1
    data[t+1][channel] -= 1
for i in range(c+1):
    for j in range(1,10**5+1):
        data[j][i] += data[j-1][i]
ans = 0
for i in range(10**5+1):
    sum_channel = 0
    for j in range(c+1):
        if data[i][j] == 1:
            sum_channel += 1
    ans = max(ans, sum_channel)
print(ans) 


### FIXED CODE ###

n, c = map(int, input().split())
data = [[0 for i in range(c+1)] for j in range(10**5+2)]
for i in range(n):
    s, t, channel = map(int, input().split())
    data[s][channel] += 1
    data[t+1][channel] -= 1
for i in range(c+1):
    for j in range(1,10**5+2):
        data[j][i] += data[j-1][i]
ans = 0
for i in range(10**5+2):
    sum_channel = 0
    for j in range(c+1):
        if data[i][j] == 1:
            sum_channel += 1
    ans = max(ans, sum_channel)
print(ans)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1E+7)
def main():
    N, Q = map(int, input().split())
    link = [[] for _ in range(N+1)]
    for n in range(N-1):
        a, b = map(int, input().split())
        link[a].append(b)
        link[b].append(a)
    V = [0] * (N+1)
    ans = [0] * (N+1)
    for q in range(Q):
        p, x = map(int, input().split())
        V[p] += x

    def dfs(i, parent, acc):
        V[i] += acc
        for j in link[i]:
            if j != parent:
                dfs(j,i,V[i])
    cur = 1
    parent = 0
    acc = 0
    dfs(cur, parent , acc)
    V = [str(v) for v in V]
    print (" ".join(V[1:]))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x

def dfs(v,parent,add):
    value[v] += add
    for x in graph[v]:
        if x == parent:
            continue
        dfs(x,v,value[v])

dfs(1,0,0)

answer = ' '.join(map(str,value[1:]))
print(answer)
n = int(input())
s = list(input())
x = 0
for i in range(n):
    a = s[:i]
    b = s[i:]
    temp_set = set(a) & set(b)
    x = max(x, len(temp_set))

print(x)

### FIXED CODE ###

a, b = map(int, input().split())
calcs = [a + b, a - b, a * b]
print(max(calcs))
def common():
   X = raw_input()
   Y = raw_input()
         
   for i in range(0. len(X)+1):
      s[i] = 0
         
   for i in range(0, len(X)):
      t = s + []
      for j in range(1, len(Y)):
         if s[i] == j[i]:
            s[j+1] = t[j] + 1
         elif s[j+1] < s[j]:
            s[j+1] = s[j]
      
   return s[-1]

q = input()     
for k in range(0, q):
   common()

### FIXED CODE ###

def common():
   X = raw_input()
   Y = raw_input()
  
   s = [0 for i in range(len(Y)+1)]
 
   for j in range(0, len(X)):
      t = s + []
      for k in range(0, len(Y)):
         if X[j] == Y[k]:
            s[k+1] = t[k] + 1
         elif s[k+1] < s[k]:
            s[k+1] = s[k]
  
   print s[-1]
 
q = input()
for l in range(0, q):
   common()
N = int(input())
X = str(input())
X10 = int(X,2)

one_num = X.count("1")
one_mod = one_nom

for i in range(N):
    target = int(X[i])
    if target == 0:
        plus = pow(2,N-i-1)
        ones = one_num + 1
    else:
        plus = -pow(2,N-i-1)
        ones = one_num-1
    Xnow = X10+plus
    count = 0
    if Xnow == 0:
        print(count)
        continue
    Xnow = Xnow%ones
    count+=1
    for j in range(1000):
        if Xnow == 0:
            break
        Xnow2 = bin(Xnow)
        ones = Xnow2.count("1")
        Xnow = Xnow%ones
        count+=1
    print(count)


### FIXED CODE ###

N = int(input())
x2 = input()
x10 = int(x2, 2)
popc =  x2.count("1")
#print("x10", x10)
#print("popc", popc)
#popc: Nを2進数で表したときの1の個数

#以下で1つフリップさせた時の入力に対する余りを事前に計算
if popc <= 1:
    xp = x10%(popc+1)
    xm = 0
else:
    xp = x10%(popc+1)
    xm = x10%(popc-1)
#print("xp", xp)
#print("xm", xm)

#以下でフリップさせた場所のみを計算
for i in range(N):
    if x2[i] == "1":
        if popc == 1:
            print(0)
            continue
        tmp = (xm - pow(2, N-i-1, popc-1))%(popc-1)
    else:
        tmp = (xp + pow(2, N-i-1, popc+1))%(popc+1)
        
    #print("tmp", tmp)
    ans = 1
    while tmp > 0:
        tmp %= bin(tmp).count("1")
        ans += 1
    print(ans)
def func(n,k):
    SUM = 0
    ans = 0
    A = [int(input()) for _ in range(n)]
    for i in range(k-1):
        SUM += A[i]
    for i in range(k,len(A)):
        ans = max(ans,SUM+A[i]-A[i-k])
        SUM = SUM+A[i]-A[i-k]
    print(ans)

for _ in range(10)
    n,k = [int(s) for s in input().split()]
    if n == 0 and k ==0:
        break
    else:
        func(n,k)


### FIXED CODE ###

def func(n,k):
    SUM = 0
    ans = 0
    A = [int(input()) for _ in range(n)]
    for i in range(k):
        SUM += A[i]
    for i in range(k,len(A)):
        ans = max(ans,SUM+A[i]-A[i-k])
        SUM = SUM+A[i]-A[i-k]
    print(ans)

for _ in range(10):
    n,k = [int(s) for s in input().split()]
    if n == 0 and k ==0:
        break
    else:
        func(n,k)
def resolve():
    #n=int(input())
    #a,b=map(int,input().split())
    #x=list(map(int,input().split()))
    #a=[list(map(lambda x:int(x)%2,input().split())) for _ in range(h)]

    def calc(x):#xは数字
        xn=x
        x=bin(x)[2:]
        cnt=sum(list(map(int,list(x))))
        return xn%cnt

    n=int(input())
    f=[]
    f.append(0)
    for i in range(1,2**18+1):
        f.append(f[calc(i)]+1)

    x=input()
    cnt=sum(list(map(int,list(x))))
    x=int(x,2)
    ans=[]
    for i in range(n):
        if x>>i&1:
            ans.append(f[(x-2**i)%(cnt-1)]+1)
        else:
            ans.append(f[(x+2**i)%(cnt+1)]+1)
    print(*ans[::-1],sep='\n')

if __name__ == '__main__':
    resolve()

### FIXED CODE ###

def resolve():
    #n=int(input())
    #a,b=map(int,input().split())
    #x=list(map(int,input().split()))
    #a=[list(map(lambda x:int(x)%2,input().split())) for _ in range(h)]

    def popcount(n):
        c=format(n,'b').count('1')
        if c!=0:
            return n%c
        else:
            return 0
    def f(n):
        count=0
        while n>0:
            n=popcount(n)
            count+=1
        return count
        
    n=int(input())    
    x=input()
    cnt=x.count('1')
    x10=int(x,2)
    ans=[]
    a=x10%(cnt+1)
    if cnt==1:
        b=0
    else:
        b=x10%(cnt-1)
    for i in range(n):
        if x[i]=='1' and cnt==1:
            print(0)
            continue
        elif x[i]=='1':
            cal=(b-pow(2,n-1-i,cnt-1))%(cnt-1)
        else:
            cal=(a+pow(2,n-1-i,cnt+1))%(cnt+1)
        print(f(cal)+1)

if __name__ == '__main__':
    resolve()
s=input()
t=input()
l=[]
for i in range(len(s)-len(t)+1):
    sl=copy.deepcopy(s)
    for j in range(len(t)):
        if sl[i+j]!=t[j] and sl[i+j]!='?':
            break
    else:
        s = s[:i] + t + s[i+len(t):]
        l.append(s.replace('?', 'a'))
l.sort()
if l:
    print(l[0])
else:
    print('UNRESTRABLE')

### FIXED CODE ###

s=input()
t=input()
l=[]
for i in range(len(s)-len(t)+1):
    for j in range(len(t)):
        if s[i+j]!=t[j] and s[i+j]!='?':
            break
    else:
        a=s[:i]+t+s[i+len(t):]
        l.append(a.replace('?', 'a'))
l.sort()
if l:
    print(l[0])
else:
    print('UNRESTORABLE')
print "Hello"

### FIXED CODE ###

S = input()
if S <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
  
def prod(n):
  result = 1
  for x in n:
    result *= x
  return result
  
a = prime_factorize(n)
b = [a.pop(-1)]


while prod(a) > prod(b):
  prev_result = prod(a) + prod(b)
  b.append(a.pop(0))

try:
  if prev_result < prod(a) + prod(b):
    a.append(b.pop(-1))

except:
  pass
print(prod(a)-1 +prod(b)-1)

### FIXED CODE ###

n = int(input())

ans = 1e18
for i in range(1, n):
	if i**2 > n:
		break
	if (n%i)== 0:
		j = n/i
		ans = int(min(ans, i+j-2))
print(ans)
while 1:
    s = input()
    if s == '-':break
    n = input()
    for i in range(n):
        h = int(input())
        s = s[h:] + s[:h]
    print(s)

### FIXED CODE ###

while True:
    s = input()
    if s == '-':break
    n = int(input())
    for i in range(n):
        h = int(input())
        s = s[h:] + s[:h]
    print(s)
def main():
  N = int(input())

  for i range(26):
    if i * 4 > N:
      break
    if (N - i * 4) % 7 == 0:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()
  

### FIXED CODE ###

def main():
  N = int(input())

  for i in range(26):
    if i * 4 > N:
      break
    if (N - i * 4) % 7 == 0:
      print('Yes')
      return
  print('No')

if __name__ == '__main__':
  main()
N, K, X, Y = map(int, input().split())


print(abs(X * K + (N - K) * Y))


### FIXED CODE ###

n = int(input())
k = int(input())
x = int(input())
y = int(input())

if n > k:
    print(x * k + (n - k) * y)
else:
    print(n * x)
n,k = map(int, input().split())
a =list(map(int, input().split()))
ans =1

if n == k:
   for i in a:
       ans *= i
       if abs(ans) >10**9+7:
           ans = ans%(10**9+7)
elif all(i <= 0 for i in a) and k%2 ==1:
    a.sort(reverse = True)
    for i in range(k):
        ans *= a[i]
        if abs(ans) > 10 ** 9 + 7:
            ans = ans % (10 ** 9 + 7)
else:
    am =[]
    ap =[]

    a.sort(key = abs,reverse = True)
    amax = a[:k]
    amin = a[k:]
    c=1
    for i in amax:
        if i<0:
            am.append(i)
            c *=-1
        elif i>0:
            ap.append(i)
    if c ==1:
        for i in amax:
            ans *= i
            if abs(ans) > 10 ** 9 + 7:
                ans = ans % (10 ** 9 + 7)
    else:

        if min(amin)/min(ap) > max(amin)/max(am):
            amax.remove(max(am))
            amax.append(max(amin))
        else:
            amax.remove(min(ap))
            amax.append(min(amin))
        for i in amax:
            ans *= i
            if abs(ans) > 10 ** 9 + 7:
                ans = ans % (10 ** 9 + 7)

print(ans% (10 ** 9 + 7))


### FIXED CODE ###

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

if n == k:
   for i in a:
       ans *= i
       if abs(ans) >10**9+7:
           ans = ans%(10**9+7)

elif all(i <= 0 for i in a) and k%2 ==1:
    a.sort(reverse = True)
    for i in range(k):
        ans *= a[i]
        if abs(ans) > 10 ** 9 + 7:
            ans = ans % (10 ** 9 + 7)

else:
    am =[]
    ap =[]

    a.sort(key = abs,reverse = True)
    amax = a[:k]
    amin = a[k:]
    c=1
    if 0 in amax:
        ans = 0
    else:
        for i in amax:
            if i<0:
                am.append(i)
                c *=-1
            elif i>0:
                ap.append(i)
        if c ==1:
            for i in amax:
                ans *= i
                if abs(ans) > 10 ** 9 + 7:
                    ans = ans % (10 ** 9 + 7)
        else:
            if ap == []:
                amax.remove(max(am))
                amax.append(max(amin))

            elif max(am)*min(amin) < min(ap)*max(amin):
                amax.remove(max(am))
                amax.append(max(amin))
            else:
                amax.remove(min(ap))
                amax.append(min(amin))
            for i in amax:
                ans *= i
                if abs(ans) > 10 ** 9 + 7:
                    ans = ans % (10 ** 9 + 7)

print(ans % (10 ** 9 + 7))