Harryxun/stf_run huggingface dataset:
a = input()
print(a.replace(',' , ' ')

### FIXED CODE ###

a,b,c = input().split(",")
print(a, b, c)
import sys
for i in range(10000):
 j=int(input)
 if j==0:
  sys.exit()
 print("Case",str(i)+":",j)

### FIXED CODE ###

i=1
while 1:
 j=int(input())
 if j==0:
  break
 print("Case",str(i)+":",j)
 i+=1
n, k = list(map(int, input().split()))
vs = list(map(int, input().split()))


def doit(vv, kk):
    if kk == 0:
        return 0
    return max(vv[0] + doit(vv[1:], kk - 1),
               vv[-1] + doit(vv[:-1], kk - 1),
               doit(vv[1:], kk - 2) if kk > 1 else 0,
               doit(vv[:-1], kk - 2) if kk > 1 else 0)


print(doit(vs, k))


### FIXED CODE ###

import sys
sys.setrecursionlimit(101)

n, k = list(map(int, input().split()))
vs = list(map(int, input().split()))
memo = {}


def doit(l, r, kk):
    if kk == 0 or l > r:
        return 0
    if (l, r, kk) not in memo:
        memo[(l, r, kk)] = max(vs[l] + doit(l + 1, r    , kk - 1),
                           vs[r] + doit(l    , r - 1, kk - 1),
                                   doit(l + 1, r    , kk - 2) if kk > 1 else 0,
                                   doit(l    , r - 1, kk - 2) if kk > 1 else 0)
    return memo[(l, r, kk)]


print(doit(0, n - 1, k))
n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
total = 0
for i in a:
  total += a
if n < total:
  print(-1)
else:
  print(n - total)


### FIXED CODE ###

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
total = 0
for i in a:
  total += i
if n < total:
  print(-1)
else:
  print(n - total)
r = float(input())
x = r * r * 3.14159265
y = r * 2 * 3.14159265
print("{0:f} {1:f}", format(x, y))



### FIXED CODE ###

r = float(input())
x = r * r * 3.14159265359
y = r * 2 * 3.14159265359
print("{0:.10f} {1:.10f}".format(x, y))
import heapq
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

low = 1
high = 10**9

if n == 1:
    print((a[0]+k-1)//k)
    exit()

while low+1 < high:
    tmp = 0
    mid = (low + high) //2
    #print(mid)
    
    for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
    print(tmp,mid)
    
    if tmp <= k:
        high = mid
    else:
        low = mid
        
print(high)


### FIXED CODE ###

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

low = 0
high = 10**9

if k == 0:
    print(max(a))
    exit()

    
while low+1 < high:
    tmp = 0
    mid = (low + high) //2
    
    for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
        
    if tmp <= k:
        high = mid
    else:
        low = mid
        
print(high)
import collections
from math import factorial
n = int(input())
s = [''.join(sorted(input())) for i in range(n)]
c = collections.Counter(s)
count = list(c.values())
ans = 0
for num in count:
    if num >= 2:
        b = factorial(num) / factorial(2) / factorial(num - 2)
        ans += int(b)
print(ans)

### FIXED CODE ###

import collections
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under


n = int(input())
s = [''.join(sorted(input())) for i in range(n)]
c = collections.Counter(s)
count = list(c.values())
ans = 0
for num in count:
    if num >= 2:
        b = cmb(num, 2)
        ans += int(b)
print(ans)
n=input()
k=input()
print(n-k+1)

### FIXED CODE ###

n,k=map(int,input().split())
print(n-k+1)
L, R = map(int, input().split())
l = L % 2019
r = R % 2019
ans = 10 ** 12
if l > r:
    ans = 0
else:
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            ans = min(ans, i * j % 2019)
print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = min(N * A, B)
print(ans)
print("YES") if int(input().gsub(" ", "")) % 4 == 0 else print("NO")

### FIXED CODE ###

print("YES") if int(input().replace(" ", "")) % 4 == 0 else print("NO")
A,B=input()
print(int(A)-int(B)*2)


### FIXED CODE ###

A,B=input().split()
ans=int(A)-int(B)*2
if ans > 0:
  print(ans)
else:
  print(0)
n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
if k>n:
    k=n-1
dp=np.array([int(0) for _ in range(n)])
dp[1]=abs(a[0]-a[1])
 
for i in range(2,n):
  ind = max(0,i-k)
  dp[i]=np.minimum(np.sum(dp[ind:i]+abs(a[i]-a[ind:i]))s)
  #dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]))
#print(dp[n-1])
print(dp[-1])

### FIXED CODE ###

n,k=list(map(int,input().split()))
a=list(map(int,input().split()))
if k>n:
    k=n-1
dp=[int(0) for _ in range(n)]
dp[1]=abs(a[0]-a[1])
 
for i in range(2,n):
  ind = max(0,i-k)
  dp[i]=min([dp[v]+abs(a[i]-a[v]) for v in range(ind,i)])
  #dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]))
#print(dp[n-1])
print(dp[-1])
n = int(input())
A = list(map(int, input().split()))

print('second' if all(A[i] % 2 == 0 for i in range(n)) else 'first')


### FIXED CODE ###

n = int(input())
A = [int(input()) for i in range(n)]

print('second' if all(A[i] % 2 == 0 for i in range(n)) else 'first')
"""
小数の状態だと処理しづらいので、与えられた数を全て10**9倍して小数を確実になくした上で
問題文を下記のように言い換える。
「積が10**18の倍数になるような数の組み合わせの数がいくつあるか」
数Aiがあり、Aiの2の素因数の数がn, 5の素因数の数がmのとき、
数Ai自体ですでにmin(n,m)個の0の数を持っている。この場合、のこり必要な0の数はx = 18-min(n,m)個である。
ここで、n == mの場合：
Aiの相方は少なくとも2,5の素因数をそれぞれx個以上持っていなくてはならない。
n > mの場合：
Aiの相方は少なくとも2の素因数をx-(n-m)個、5の素因数をx個持っていなくてはいけない。

m > nの場合：
Aiの相方は少なくとも2の素因数をx個以上、5の素因数をx-(m-n)個以上持っていなくてはならない。
"""
N = int(input())
dp = [[0]*(19) for _ in range(19)]
ans = 0
for _ in range(N):
    a = float(input())
    a *= 10**9
    two = 0
    while a % 2 == 0:
        a //= 2
        two += 1
    five = 0
    while a % 5 == 0:
        a //= 5
        five += 1

    ans += dp[18-two][18-five]
    for i in range(two+1):
        for j in range(five+1):
            dp[i][j] += 1
print(ans)

### FIXED CODE ###

def div(n, d):
    cnt = 0
    while n % d == 0 and cnt < 18:
        n //= d
        cnt += 1
    return cnt


n = int(input())
dp = [[0]*19 for _ in range(19)]
#dp[i][j] -> 2の素因数がi以上,5の素因数がj以上の数字の数

ans = 0
for _ in range(n):
    x = round(float(input()) * pow(10, 9))
    two = div(x, 2)
    five = div(x, 5)
    ans += dp[18 - two][18 - five]
    for i in range(two + 1):
        for j in range(five + 1):
            dp[i][j] += 1

print(ans)
import math
a, b, n = map(int, input().split())
if b>n:
    print(math.floor(a*n/b))
else:
  	x = b-1
    print(math.floor(a*x/b))

### FIXED CODE ###

import math
a, b, n = map(int, input().split())
if b>n:
    print(math.floor(a*n/b))
else:
    x = b-1
    print(math.floor(a*x/b))
N = input()
if (N[-1] == str(3)):
    print('bon')
elif(int(N[-1]) == 0 or int(N[-1]) == 1 or int(N[-1]) == 6 or int(N[-1]) == 8 ):
    print('pon')
else:
    print('hon')

### FIXED CODE ###

S = input()
T = input()
if(T[0:len(T)-1] == S):
    print('Yes')
else:
    print('No')
from collections import deque

def process_command(dll, commands):
    for cmd in commands:
        # print(cmd)
        if cmd.startswith('insert') or cmd.startswith('delete '):
            t = cmd.split(' ')
            cmd = t[0]
            num_str = t[1]
        if cmd == 'insert':
            dll.append(int(num_str))
        elif cmd == 'delete':
            temp = []
            result = dll.pop()
            while result != int(num_str):
                temp.append(result)
                result = dll.pop()
            temp = temp[::-1]
            dll.extend(temp)
        elif cmd == 'deleteFirst':
            dll.pop()
        elif cmd == 'deleteLast':
            dll.popleft()
        # print(dll)
        # print('=' * 64)


if __name__ == '__main__':
    # ??????????????\???
    commands = []
    num = int(input())
    for i in range(num):
        commands.append(input())
    #commands.append(('insert', '5'))
    #commands.append(('insert', '2'))
    #commands.append(('insert', '3'))
    #commands.append(('insert', '1'))
    #commands.append(('delete', '3'))
    #commands.append(('insert', '6'))
    #commands.append(('delete', '5'))

    # ??????
    dll = deque()
    process_command(dll, commands)

    # ???????????????
    dll.reverse()
    print('{0}'.format(' '.join(map(str, dll))))

### FIXED CODE ###

from collections import deque

def process_command(dll, commands):
    # line_count = 1
    for cmd in commands:
        # print('processing line: {0}'.format(line_count))
        # line_count += 1
        # print(cmd)
        try:
            cmd, num_str = cmd.split()
        except ValueError:
            pass
        # if cmd.startswith('insert') or cmd.startswith('delete '):
        #     t = cmd.split(' ')
        #     cmd = t[0]
        #     num_str = t[1]
        if cmd == 'insert':
            dll.appendleft(int(num_str))
        elif cmd == 'delete':
            # deque.index() ????????¨??§???????????? python3.5??\???????????§???????????§??¢???
            if int(num_str) in dll:  # ?????????????????????????????¨???????????´?????????????????????????????????
                temp = []
                result = dll.popleft()
                while result != int(num_str):
                    temp.append(result)
                    result = dll.popleft()
                temp = temp[::-1]
                dll.extendleft(temp)
        elif cmd == 'deleteFirst':
            dll.popleft()
        elif cmd == 'deleteLast':
            dll.pop()
        # print(dll)
        # print('=' * 64)


if __name__ == '__main__':
    # ??????????????\???
    commands = []
    num = int(input())
    commands = [input() for i in range(num)]

    # ??????
    dll = deque()
    process_command(dll, commands)

    # ???????????????
    print('{0}'.format(' '.join(map(str, dll))))
from collections import deque
n, m = map(int, input().split())
INF = 100000000

to = [[] for _ in range(m)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
print('Yes')
q = deque([])
dist = [INF] * n
pre = [-1] * n
dist[0] = 0
q.append(0)

while len(q) > 0:
    v = q.popleft()
    for i in to[v]:
        if dist[i] != INF:
            continue
        dist[i] = dist[v] + 1
        pre[i] = v
        q.append(i)

for i in range(1, n):
    ans = pre[i]
    ans += 1
    print(ans)


### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
INF = 100000000

to = [[] for _ in range(100005)]
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
print('Yes')
q = deque([])
dist = [INF] * n
pre = [-1] * n
dist[0] = 0
q.append(0)

while len(q) > 0:
    v = q.popleft()
    for i in to[v]:
        if dist[i] != INF:
            continue
        dist[i] = dist[v] + 1
        pre[i] = v
        q.append(i)

for i in range(1, n):
    ans = pre[i]
    ans += 1
    print(ans)
n = int(input())
a = list(map(int,input().split()))
g = []
ans = 0
for j in range(60):
    d = 0
    for i in range(n):
        d += a[i]&1
        a[i] >>= 1
    g.append(d)
for i in range(60):
    ans += g[i]*(n-g[i])*(pow(2,i,1000000007))
    ans = ans % (1000000007)
print(ans%(1000000007))

### FIXED CODE ###

import numpy as np

n = int(input())
arr = np.array([int(i) for i in input().split()])
mod = 10 ** 9 + 7
s = 0

for i in range(60):
    c1 = np.count_nonzero(arr & 1) # 自分がnp.sumを利用したがどうしても正解になれなかった。なぜ？
    s += 2 ** i * c1 * (n - c1)
    arr >>= 1

print(s % mod)
from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[x] > self.r[y]):
            x,y = y,x
        self.r[x] += self.r[y]
        self.r[y] = x
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
ans = 0
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)


### FIXED CODE ###

from collections import Counter

class UnionFind:
    def __init__(self,num:int):
        self.r = [-1 for i in range(num)]
    def root(self,x:int):
        if(self.r[x] < 0):
            return x
        self.r[x] = self.root(self.r[x])
        return self.r[x]
    def unite(self,x:int,y:int):
        rx = self.root(x)
        ry = self.root(y)
        if(rx == ry):
            return False
        if(self.r[rx] > self.r[ry]):
            rx,ry = ry,rx
        self.r[rx] += self.r[ry]
        self.r[ry] = rx
        return True
    def size(self,x:int):
        return -self.r[self.root(x)]

N,M = map(int,input().split())
group = UnionFind(N)
for i in range(M):
    A,B = map(int,input().split())
    group.unite(A-1,B-1)
ans = 0
for i in range(N):
    ans = max(ans,group.size(i))
print(ans)
rate=380000.0 #yen/btc

n=int(input())
otoshidama=0
for i in range(n):
  x,u=map(input().split())
  if u == "JPY":
    otoshidama+=float(x)
  else:
    otoshidama+=float(x)*rate
print(otoshidama)

### FIXED CODE ###

rate=380000.0 #yen/btc

n=int(input())
otoshidama=0
for i in range(n):
  x,u=map(str,input().split())
  if u == "JPY":
    otoshidama+=float(x)
  else:
    otoshidama+=float(x)*rate
print(otoshidama)
s1=input().replace("eraser","")
s2=s1.replace("erase","")
s3=s2.replace("dreamer","")
s4=s3.replace("dream","")
if s:
	print("No")
else:
	print("Yes")
"""
#failed
import itertools

s=str(input())
add=["dream","dreamer","erase","eraser"]
t=[]

for i,_ in enumerate(add,1):
	for j in itertools.permutations(add,r=i):
		t.append("".join(j))

print(t)

temp=False
for i in range(len(t)):
	if(s==t[i]):
		temp=True
		break

if temp==True:
	print("Yes")
else:
	print("No")
	

"""

### FIXED CODE ###

s = input().replace("eraser","").replace("erase","").replace("dreamer","").replace("dream","")
if s:
    print("NO")
else:
    print("YES")

"""
#failed
import itertools

s=str(input())
add=["dream","dreamer","erase","eraser"]
t=[]

for i,_ in enumerate(add,1):
	for j in itertools.permutations(add,r=i):
		t.append("".join(j))

print(t)

temp=False
for i in range(len(t)):
	if(s==t[i]):
		temp=True
		break

if temp==True:
	print("Yes")
else:
	print("No")
	

"""
a = [int(input())]

for i in range(100000):
  if a[i] % 2 == 0:
    a.append(a[i]//2)
    else:
      a.append(3*a[i] + 1)
    
    if a[i+1] in a[:i]:
      print(i+2)
      break
      

### FIXED CODE ###

a = [int(input())]

for i in range(100000):
  if a[i] % 2 == 0:
    a.append(a[i]//2)
  else:
    a.append(3*a[i] + 1)
    
  if a[i+1] in a[:i]:
    print(i+2)
    break
#! /usr/bin/python
# -*- coding: utf-8 -*-

def main():
    # input
    while(True):
        try:
            data = int(raw_input())
            print(countArea(data))
        except EOFError:
            break

def countArea(n):
    if n == 1:
        return 2
    else:
        return countArea(n-1) + n
        
if __name__=='__main__':
    main()

### FIXED CODE ###

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

def main():
    # input
    while(True):
        try:
            data = int(raw_input())
            print(countArea(data))
        except EOFError:
            break

def countArea(n):
    ans = 2
    while(n > 1):
        ans = ans + n
        n -= 1

    return ans

if __name__=='__main__':
    main()
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0

for i in range(A+1):
 for j in range(B+1):
  reX = X - A*i - B*j;
  if 0<= reX <= C:
   count+=1
   
print(count)

### FIXED CODE ###

X = input()
A = input()
B = input()
X = int(X)
A = int(A)
B = int(B)

reX = X - A;
print(reX%B)
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if B-A+ > (W-V)*T:
  print("YES")
else:
  print("NO")


### FIXED CODE ###

A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())
if abs(B-A)+(W-V)*T > 0:
  print("NO")
else:
  print("YES")
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce, lru_cache
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

n = INT()
a = LIST()
m = max(a)

c = [0]*(m+1)
for x in a:
    c[x] += 1

k = max(sum(c[i::i]) for i in range(2, m+1))

if k <= 1:
    print("pairwise coprime")
elif k < n:
    print("setwise coprime")
else:
    print("not coprime")

### FIXED CODE ###

from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce, lru_cache
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def MAP1()  : return map(lambda x:int(x)-1,input().split())
def LIST()  : return list(MAP())
def LIST1() : return list(MAP1())

n = INT()
a = LIST()
m = max(a)

primes = [0]*(m+1)
primes[1] = 1
for i in range(2, m+1):
    if primes[i] == 0:
        for j in range(1, m//i+1):
            primes[i*j] = i

count = [0]*(m+1)
for x in a:
    y = x
    while primes[y] != y:
        count[primes[y]] += 1
        p = primes[y]
        while y % p == 0:
            y //= p
    if primes[y] >= 2:
        count[primes[y]] += 1

if max(count) <= 1:
    print("pairwise coprime")
else:
    g = 0
    for x in a:
        g = gcd(g, x)
    if g == 1:
        print("setwise coprime")
    else:
        print("not coprime")
# https://atcoder.jp/contests/abc132/tasks/abc132_d
# K個を区別なくi個のグループに分ける通りの数？
# 制約はたかだか2000
# 赤の壁のパターンを考えるとか？[WIP]
# mod取りながらcombination


MOD = 10**9 + 7


def combination_mod(n, r, mod):
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod


C = [[1], [1, 1]]
'''
1
1, 1
1, 2, 1
1, 3, 3, 1
'''
for i in range(2, 2001):
    tmp = [1]
    for j in range(1, i):
        tmp.append((C[i - 1][j - 1] + C[i - 1][j]) % MOD)
    tmp.append(1)
    C.append(tmp)


N, K = list(map(int, input().split()))
left1 = N - K + 1
left2 = K - 1
# for i in range(1, K + 1):
#     ans = combination_mod(left1, i, MOD) * combination_mod(left2, i - 1, MOD)
#     # print(ans)
#     print(ans % MOD)

for i in range(1, K + 1):
    ans = C[left1][i] * C[left2][i - 1]
    # print(ans)
    print(ans % MOD)


### FIXED CODE ###

# https://atcoder.jp/contests/abc132/tasks/abc132_d
# K個を区別なくi個のグループに分ける通りの数？
# 制約はたかだか2000
# 赤の壁のパターンを考えるとか？[WIP]
# mod取りながらcombination


MOD = 10**9 + 7


def combination_mod(n, r, mod):
    if r > n:
        return 0  # このような通りの数は無いため便宜上こう定義する
    r = min(r, n - r)
    nf = rf = 1
    for i in range(r):
        nf = nf * (n - i) % mod
        rf = rf * (i + 1) % mod
    return nf * pow(rf, mod - 2, mod) % mod


C = [[1], [1, 1]]
'''
1
1, 1
1, 2, 1
1, 3, 3, 1
# '''
# for i in range(2, 2002):
#     tmp = [1]
#     for j in range(1, i):
#         tmp.append((C[i - 1][j - 1] + C[i - 1][j]) % MOD)
#     tmp.append(1)
#     C.append(tmp)


N, K = list(map(int, input().split()))
left1 = N - K + 1
left2 = K - 1
for i in range(1, K + 1):
    ans = combination_mod(left1, i, MOD) * combination_mod(left2, i - 1, MOD)
    # print(ans)
    print(ans % MOD)

# for i in range(1, K + 1):
#     ans = C[left1][i] * C[left2][i - 1]
#     # print(ans)
#     print(ans % MOD)
print(x*x*x)


### FIXED CODE ###

x = int(input())
if x <= 100 and x >= 1:
	print(x*x*x)
import sympy
n = int(input())
c = 0
for i, j in sympy.factorint(n).items():
    for k in range(j):
        if n % i ** (k + 1) == 0:
            n = n / i ** (k + 1)
            c = c + 1
        else:
            break
print(c)

### FIXED CODE ###

def factorint(n):
    d = dict()
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            c = 0
            while n % i == 0:
                c += 1
                n /= i
            d[i] = c
    if n != 1:
        d[n] = 1
    return d

n = int(input())
c = 0
for i, j in factorint(n).items():
    for k in range(j):
        if n % i ** (k + 1) == 0:
            n = n / i ** (k + 1)
            c += 1
        else:
            break
print(c)
n,k=[int(i) for i in input().split()]
r,s,p=[int(i) for i in input().split()]
hand=input()
ans=0
for i in range(k):
  free=True
  j=i
  while j<n:
    if free=True or hand[j-k]!=hand[j]:
      if hand[j]='r':
        ans+=p
      elif hand[j]='s':
        ans+=r
      else:
        ans+=s
      free=False
    else:
      free=True
    j+=k
print(ans)

### FIXED CODE ###

n,k=[int(i) for i in input().split()]
r,s,p=[int(i) for i in input().split()]
hand=input()
ans=0
for i in range(k):
  free=True
  j=i
  while j<n:
    if free==True or hand[j-k]!=hand[j]:
      if hand[j]=='r':
        ans+=p
      elif hand[j]=='s':
        ans+=r
      else:
        ans+=s
      free=False
    else:
      free=True
    j+=k
print(ans)
a = list(map(str, input().split()))
if a[1] == “+”:
    print(int(a[0]) + int(a[2]))
else:
    print(int(a[0]) - int(a[2]))


### FIXED CODE ###

a = list(map(str, input().split()))
if a[1] == "+":
  print(int(a[0]) + int(a[2]))
else:
  print(int(a[0]) - int(a[2]))
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

C = [A[i] - B[i] for i in range(n)]
C.sort()

if sum(C)<0:
  print(-1)
  exit()
  
ans = 0

for collections import deque
C = deque(C)
c = 0
while 1:
  nc = C.popleft()
  if nc >=0:
    break
  c+= nc
  ans += 1
  while c<0:
    c+=C.popright()
    ans += 1
print(ans)

### FIXED CODE ###

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

C = [A[i] - B[i] for i in range(n)]
C.sort()

if sum(C)<0:
  print(-1)
  exit()
  
ans = 0

from collections import deque
C = deque(C)
c = 0
while C:
  nc = C.popleft()
  if nc >=0:
    break
  c+= nc
  ans += 1
  while c<0:
    c+=C.pop()
    ans += 1
print(ans)