Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

sa = sum(a)
sb = sum(b)

al = sb-sa

if al<0:
    print('No')
    exit()

double = 0
single = 0

for i in range(n):
    diff = b[i]-a[i]
    diff_ = -diff
    if diff > 0:
        double += diff//2
        single += diff%2
    if diff < 0:
        single += diff_

dnokori = al - double
snokori = al - single


if dnokori < 0 or snokori<0:
    print('No')
    exit()

if snokori/dnokori == 2:
    print('Yes')
else:
    print('No')



### FIXED CODE ###

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

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

sa = sum(a)
sb = sum(b)

al = sb-sa

if al<0:
    print('No')
    exit()

doub = 0
sing = 0

for i in range(n):
    diff = b[i]-a[i]
    if diff > 0:
        doub += -(-diff//2)
        sing += diff%2
    if diff < 0:
        sing += -diff

dnokori = al - doub
snokori = al - sing

if dnokori < 0 or snokori<0:
    print('No')
    exit()

if dnokori==0 and snokori==0:
    print('Yes')
    exit()

if dnokori==0:
    print('No')
    exit()

if snokori/dnokori == 2:
    print('Yes')
else:
    print('No')
import sys
input = sys.stdin.readline

S = input()
Q = int(input())
A = [(input().split("")) for _ in range(Q)]

for i in range(Q):
  if A[i] == ["1"]:
    S = ''.join(list(reversed(S)))
  else:
    if A[i][1] == "1":
      S = S + A[i][2]
    else:
      S = A[i][2] + S
      
print(S)
    


### FIXED CODE ###

s = input()
q = int(input())
par = 0
pre = ""
pos = ""

for i in range(q):
  t = input().split()
  if t[0] == "1":
    par += 1
  elif (par + int(t[1]))%2 == 1:
    pre = t[2] + pre
  else:
    pos = pos + t[2]
    
ans = pre + s + pos

if par%2 == 0:
  print(ans)
else:
  print(ans[::-1])
h, w = map(int, input().split())
a=0
b=0
c=0
for i in range(h):
    if i%2==0:
        a=a+1
for j in range(w):
    if j%2==1:
        b=b+1
c=a+b
print(c)

### FIXED CODE ###

k=[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]
s=int(input())
s=s-1
print(k[s])
sample = input() # two numbers in a string
new_sample = sample.split(" ")
ball = new_sample[0]
color = new_sample[1]
product = color

for i in range(1, ball):
  product *= color-1
print(product)
  
  

### FIXED CODE ###

sample = input() # two numbers in a string
new_sample = sample.split(" ")

ball = int(new_sample[0]) # number of balls
color = int(new_sample[1]) # number of colors
if ball > 1 and color == 1:
  print(0)
else:
  product = color
  for i in range(1, ball):
    product *= (color-1)
  print(product)

  
# 3 balls, 10 colors
# 1st spot, 10 choices
# 2nd spot, 9 choices
# 3rd spot, 9 choices
n = int(input())
a = list(map(int,input().split()))
res = 0
for i in range(2,n:
    if a[i-1] == i:
        res += 1
print(res)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
res = 0
i = 1
while i < n+1:
    if a[i-1] == i:
        res += 1
        i+=2
    else:
        i+=1
print(res)
import math

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

maxn=math.gcd(A,B)
count=0
list=[]
def isPrime(n):
  if n == 2:
    return True
  if n % 2 == 0:
    return False

  # nの平方根まで計算する
  m = math.floor(math.sqrt(n)) + 1
  for p in range(3, m, 2):
      if n % p == 0:
        return False
  return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))


### FIXED CODE ###

import math
import fractions
A,B = map(int,input().split())

maxn=fractions.gcd(A,B)
list=[]
def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False
    if n==3:
        return True
    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m,2):
        if n % p == 0:
            return False
    return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))
N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        min = a
        max = b
        count = 1
    else:
        if min < a && a<max:
            min =a
        if max > b && b >min:
            max = b
if M == i+1:
    print(max-min+1)
else:
    print(0)

### FIXED CODE ###

N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        L = a
        R = b
        count = 1
    else:
        if L < a:
            L =a
            if L>R:
                break
        if R > b:
            R = b
            if R < L:
                break
if M == i+1:
    print(R-L+1)
else:
    print(0)
# coding: utf-8
# Your code here!
N, K = map(int,input().split())

link = [[] for i in range(N)]
link[0] = [i for i in range(1,N)]
for i in range(1,N):
    link[i].append(0)
    
from scipy.special import comb
    
maxnum = comb(N-1,2)

if maxnum < K:
    print(-1)
else:
    for i in range(1,N):
        for j in range(1,N):
            if i < j:
                if maxnum != K:
                    link[i].append(j)
                    link[j].append(i)
                    maxnum -= 1
                else:
                    continue
    print(sum([len(l) for l in link])//2)
    for i in range(N):
        for j in link[i]:
            if i < j:
                print(i+1, j+1)

                
        
    


### FIXED CODE ###

# coding: utf-8
# Your code here!
N, K = map(int,input().split())

link = [[] for i in range(N)]
link[0] = [i for i in range(1,N)]
for i in range(1,N):
    link[i].append(0)

def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

if N == 2 and K == 0:
    print(1)
    print("1 2")
elif N == 2 and K == 1:
    print(-1)
elif comb(N-1,2) < K:
    print(-1)
else:
    maxnum = comb(N-1,2)
    for i in range(1,N):
        for j in range(1,N):
            if i < j:
                if maxnum != K:
                    link[i].append(j)
                    link[j].append(i)
                    maxnum -= 1
                else:
                    continue
    print(sum([len(l) for l in link])//2)
    for i in range(N):
        for j in link[i]:
            if i < j:
                print(i+1, j+1)
import math

N = int(input())
i = 0

c = math.log(N-1, 26)
A = list(range(int(c)+1))

while(N!=0):
  c,d = divmod(N-1, 26)
  A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))


### FIXED CODE ###

import math

N = int(input())
i = 0

#c = math.log(N-1, 26)
#A = list(range(int(c)+1))
A = []

while(N!=0):
  c,d = divmod(N-1, 26)
  A.append(chr(d+97))
  #A[i] = chr(d+97)
  N = c
  i+=1

A.reverse()
print("".join(A))
def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10

n = int(input())
print("Yes" if x % f(x) == 0 else "No")

### FIXED CODE ###

def f(x):
    ret = 0
    while x != 0:
        ret += x%10
        x //= 10
    return ret

n = int(input())
print("Yes" if n % f(n) == 0 else "No")
N, A, B = map(int,input().split())

q, mod = divmod(N, A+B)


if A == 0 :
    print(0)

elif N >A+B :
    if mod <= A :
        print(q*A+mod)
    if mod > A :
        print(q*A+A)
    
elif N == A+B :
    print(q*A)

elif N < A+B :
    print(N)
    
elif N < A :
    print(N)

### FIXED CODE ###

S = input()
if S == 'AAA' or S == 'BBB' :
    print('No')
else :
    print('Yes')
n,m = map(int, input().split())
a = list(map(int, input().split()))

from functools import reduce
import fractions,math
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

num = lcm(a)
thr = m - num//2

if thr <= 0:
    print(0)
else:
    print(-(-thr//num))

### FIXED CODE ###

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

from functools import reduce
import fractions
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)
def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

def get2(num):
    cnt=0
    while num %2==0:
        cnt+=1
        num//=2
    return cnt

div2=get2(a[0])
for i in range(len(a)):
    if div2 != get2(a[i]):
        print(0)
        exit()

num = lcm(a)
thr = m - num//2

if thr < 0:
    print(0)
else:
    print(thr//num + 1)
class UnionFind():
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]
        # 正==子: 根の頂点番号 / 負==根: 連結頂点数

    def find(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]

    def unite(self, x, y):
        x, y = self.find(x), self.find(y)
        if x == y:
            return False
        else:
            if self.size(x) < self.size(y):
                x, y = y, x
            self.parent[x] += self.parent[y]
            self.parent[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        x = self.find(x)
        return -self.parent[x]

    def is_root(self, x):
        return self.parent[x] < 0

N, M, *hashi = map(int, open(0).read().split()) #ターミナルだと答え出てこないので注意、最終手段(10**5行で100msほど早くなる)
uf = UnionFind(N)
lis = [0]*M
lis[M-1] = N*(N-1)//2

for i in range(M-2,-1,-1):
    x = hashi[i+1][0]-1
    y = hashi[i+1][1]-1
    if uf.same(x,y):
        lis[i] = tmp
    else:
        xs = uf.size(x)
        ys = uf.size(y)
        uf.unite(x,y)
        tmp = lis[i+1] - xs*ys
        lis[i] = tmp
        if not tmp:
            break 
for i in range(M):
    print(lis[i])


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.parent = [-1 for _ in range(n)]
        # 正==子: 根の頂点番号 / 負==根: 連結頂点数

    def find(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]

    def unite(self, x, y):
        x, y = self.find(x), self.find(y)
        if x == y:
            return False
        else:
            if self.size(x) < self.size(y):
                x, y = y, x
            self.parent[x] += self.parent[y]
            self.parent[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def size(self, x):
        x = self.find(x)
        return -self.parent[x]

    def is_root(self, x):
        return self.parent[x] < 0

N,M=map(int,input().split())
uf = UnionFind(N)
hashi = [list(map(int,input().split())) for _ in range(M)]
lis = [0]*M
lis[M-1] = N*(N-1)//2

for i in range(M-2,-1,-1):
    x = hashi[i+1][0]-1
    y = hashi[i+1][1]-1
    if uf.same(x,y):
        lis[i] = tmp
    else:
        xs = uf.size(x)
        ys = uf.size(y)
        uf.unite(x,y)
        tmp = lis[i+1] - xs*ys
        lis[i] = tmp
        if not tmp:
            break 
for i in range(M):
    print(lis[i])
import math

def solve():
    N = int(input())
    ABCDE = []
    for _ in range(5):
        ABCDE.append(int(input()))
        
    min_ = min(ABCDE)
    
    print(math.ceil(N/min_)+4)
    
solve()

### FIXED CODE ###

X = int(input())
p = X//100
q = X-p*100
ret = q <= p*5
print(int(ret))
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline
from numba import*
########################################
@njit('i8(i8)',cache=1)
def main():
	mxn =  10**7
	divs = [0]*(mxn + 11)
	for i in range(1,mxn+1):
		for j in range(0, mxn+1,i):
			divs[j]+=1

	n = int(input())
	ans = 0
	for i in range(1,n+1):
		ans+=i*divs[i]
	print(ans)


main()




### FIXED CODE ###

#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline
sys.setrecursionlimit(10**6)
########################################
mxn =  10**7
divs = [0]*(mxn + 11)
for i in range(1,mxn+1):
	for j in range(0, mxn+1,i):
		divs[j]+=1

n = int(input())
ans = 0
for i in range(1,n+1):
	ans+=i*divs[i]
print(ans)
N=int(input())
count=0
a=list(map(int,input().split()))
w=[]
s=[]
maxi=max(a)
mini=min(a)
num=[0]*150000000
maxi=max(a)
for i in range(N):
  w.append(1+i+a[i])
  s.append(1+i-a[i])
  num[1+i-a[i]+maxi]+=1
for i in range(N):
  count+=num[w[i]+maxi]
print(count)

### FIXED CODE ###

N=int(input())
count=0
a=list(map(int,input().split()))
w=[]
s=[]
num=[0]*N
maxi=max(a)
for i in range(N):
  s.append(1+i-a[i])
  if 1+i+a[i]<N:
    num[1+i+a[i]]+=1
for i in range(N):
  if s[i]>=0:
    count+=num[s[i]]
print(count)
def ProblemA(X):
    if X>=30:
        print('Yes')
    else;
        print('No')
X=int(input())
ProblemA(X)

### FIXED CODE ###

def ProblemA(X):
    if X>=30:
        print('Yes')
    else:
        print('No')
X=int(input())
ProblemA(X)
from math import gcd
a, b = [int(i) for i in input().split()]
c = gcd(a, b)

def d(x):
    i = 2
    e=[]
    while True:
        if x % i == 0:
            e.append(i)
            while x % i == 0:
                x //= i
        if i * i > x:
            break
        i+=1
    if x != 1:
        e.append(x)
    return e
print(len(d(c))+1)

### FIXED CODE ###

def gcd(x, y):
    if min(x, y) == 0:
        return max(x, y)
    else:
        return gcd(y,x%y)


a, b = [int(i) for i in input().split()]
c = gcd(a, b)

def d(x):
    i = 2
    e=[]
    while True:
        if x % i == 0:
            e.append(i)
            while x % i == 0:
                x //= i
        if i * i > x:
            break
        i+=1
    if x != 1:
        e.append(x)
    return e
print(len(d(c))+1)
H,W = map(int,input().split())
dic = {}
for h in range(H):
  s = list(input())
  for x in s:
    dic[x] = dic.get(x,0) + 1

c1 = 0
c2 = 0
for x in dic.values():
  if x%2 == 1:
    c1 += 1
    x -= 1
  if x%4 == 2:
    c2 += 1
if c1>(H%2)*(W%2):
  print("No")
  return
if c2>((W*(H%2))//2)+((H*(W%2))//2):
  print("No")
  return
print("Yes")

### FIXED CODE ###

H,W = map(int,input().split())
dic = {}
for h in range(H):
  s = list(input())
  for x in s:
    dic[x] = dic.get(x,0) + 1

c1 = 0
c2 = 0
for x in dic.values():
  if x%2 == 1:
    c1 += 1
    x -= 1
  if x%4 == 2:
    c2 += 1
if c1>(H%2)*(W%2):
  print("No")
elif c2>((W*(H%2))//2)+((H*(W%2))//2):
  print("No")
else:
  print("Yes")
N, M = map(int, input().split())
A_list = []
B_list = []

for _ in range(N):
    A_list.append(list(input()))
for _ in range(M):
    B_list.append(list(input()))
  
match_list =[]
for i in range(N-M+1):
    for j in range(N-M+1):
        if B_list[0] == A_list[i][j:(j+M)]:
            match_list.append([i, j])
        else:
            pass

flag =0
for k in match_list:
    flag =0
    for l in range(M):
        print(A_list[k[0]+l][k[1]:k[1]+M])
        print(B_list[k[0]+l])
        
        if A_list[k[0]+l][k[1]:k[1]+M] ==B_list[k[0]+l]:
            flag += 1
        else:
            break
    
    if flag == M:
        print("Yes")
        break

### FIXED CODE ###

N, M = map(int, input().split())
A_list = []
B_list = []
for _ in range(N):
    A_list.append(list(input()))
for _ in range(M):
    B_list.append(list(input()))
    

whole_flag = 0
for i in range(N-M+1):
    for j in range(N-M+1):
        flag = 0
        for k in range(M):
            if B_list[k] == A_list[i+k][j:j+M]:
                flag += 1
            else:
                pass
        if flag == M:
            whole_flag += 1
            
if whole_flag == 0:
    print("No")
else:
    print("Yes")
import sys
def main():
    input = sys.stdin.readline
    N = int(input())
    items = [tuple(map(int, input().split())) for _ in range(N)]
    Q = int(input())
    vL = [tuple(map(int, input().split())) for _ in range(Q)]

    H = min(N + 1, 1 << 9)
    Hb = H.bit_length()
    MX = 10**5
    dp1 = [[0] * (MX + 1) for _ in range(H)]
    for i in range(1, H):
        v, w = items[i - 1]
        for j in range(MX + 1):
            dp1[i][j] = dp1[i >> 1][j]
            if j >= w:
                dp1[i][j] = max(dp1[i][j], dp1[i >> 1][j - w] + v)
    for v, L in vL:
        if v < H:
            print(dp1[v][L])
            continue
        ans = 0
        for i in range(1 << (v.bit_length() - Hb)):
            node = v
            value = weight = 0
            while node >= H:
                if i & 1:
                    value += items[node][0]
                    weight += items[node][1]
                node >>= 1
                i >>= 1
            if weight > L:
                continue
            ans = max(ans, value + dp1[node][L - weight])
        print(ans)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
MX = 10**5
def main():
    data = map(int, sys.stdin.buffer.read().split())
    N = next(data)

    H = min(N + 1, 1 << 10)
    dp = [None] * H
    dp[0] = [0] * (MX + 1)
    IV, IW = [], []
    i = 1
    for v, w in zip(data, data):
        if i < H:
            dpi = dp[i >> 1][:]
            dp[i] = dpi
            for j in range(MX, w - 1, -1):
                dpi[j] = max(dpi[j], dpi[j - w] + v)
        else:
            IV.append(v)
            IW.append(w)
        i += 1
        if i > N:
            break

    Q = next(data)
    for v, L in zip(data, data):
        if v < H:
            print(dp[v][L])
            continue

        item_values = []
        item_weights = []
        while v >= H:
            item_values.append(IV[v - H])
            item_weights.append(IW[v - H])
            v >>= 1

        l = len(item_values)
        V = [0] * (1 << l)
        W = [0] * (1 << l)
        ans = dp[v][L]
        for i in range(1, 1 << l):
            msb = i & (-i)
            msbb = msb.bit_length() - 1
            wi = W[i - msb] + item_weights[msbb]
            W[i] = wi
            if wi <= L:
                vi = V[i - msb] + item_values[msbb]
                ans = max(ans, vi + dp[v][L - wi])
                V[i] = vi
        print(ans)

if __name__ == '__main__':
    main()
N = int(input())
S = list(input().strip())

r = S.count('R')
w = S.count('W')

ans = min(r, w)

ri = S.index('R')
r2 = S[:ri+1].count('W')

ans = min(ans, r2)
print(ans)



### FIXED CODE ###

N = int(input())
S = list(input().strip())

l = 0
r = N-1
ans = 0
while l < r:
    if S[l] == 'W' and S[r] == 'R':
        ans += 1
        l += 1
        r -= 1
    while l < N and S[l] != 'W':
        l += 1
    while r >= 0 and S[r] != 'R':
        r -= 1

print(ans)
a,b = input().strip().split()
if b * 2 >= a:
  print(0)
else:
  print(a - (b * 2))

### FIXED CODE ###

a,b = input().strip().split()
a = int(a)
b = int(b)
if b * 2 >= a:
  print(0)
else:
  print(a - (b * 2))
strings = ["dream","dreamer","erase","eraser"]

def isDaydream(startindex):
    if S[startindex:] == "":
        return True
    for string in strings:
        if S[startindex:].startswith(string):
            if(isDaydream(len(string)+startindex)):
                return True
    return False
S = input()
if(isDaydream(0)):
    print("YES")
else:
    print("NO")

### FIXED CODE ###

def isDaydream(s):
    while s != "":
        if s.endswith("dream"):
            s = s[:-5]
        elif s.endswith("dreamer"):
            s = s[:-7]
        elif s.endswith("erase"):
            s = s[:-5]
        elif s.endswith("eraser"):
            s = s[:-6]
        else :
            return False
    return True

if(isDaydream(input())):
    print("YES")
else:
    print("NO")
a1, a2, a3 = map(int, stdin.readline().split())
if a1+a2+a3>=22:
  print('bust')
  return
print('win')

### FIXED CODE ###

#!/usr/bin/env python3
import sys

a1, a2, a3 = map(int, sys.stdin.readline().split())
if a1+a2+a3>=22:
  print('bust')
else:
  print('win')
N,Q = map(int, input().split())

L = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    L[a-1].append(b-1)
    L[b-1].append(a-1)

question = [[int(q) for q in input().split()] for _ in range(Q)]

L = [[] for _ in range(N)]
for i in range(N-1):
    L[edge[i][0]-1].append(edge[i][1]-1)
    L[edge[i][1]-1].append(edge[i][0]-1)
    
qlist = [0]*N
for i in range(Q):
    qlist[question[i][0]-1] += question[i][1]
    
cnt = [-1]*N
q = [[0, qlist[0]]]
cnt[0] = qlist[0]
while q:
    temp = q.pop(0)
    v = temp[0]
    c = temp[1]
    for i in L[v]:
        if cnt[i] < 0:
            q.append([i, c+qlist[i]])
            cnt[i] = c+qlist[i]
            
for i in range(N):
    cnt[i] = str(cnt[i])
print(" ".join(cnt))

### FIXED CODE ###

N,Q = map(int, input().split())
L = [[] for _ in range(N)]
for _ in range(N-1):
    a, b = map(int, input().split())
    L[a-1].append(b-1)
    L[b-1].append(a-1)
cnt = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    cnt[p-1] += x

flag = [1]*N
q = [0]
while q:
    temp = q.pop()
    flag[temp] = 0
    for i in L[temp]:
        if flag[i]:
            q.append(i)
            cnt[i] += cnt[temp]
            
print(*cnt)
x = input()
print x

if x == 0:
 return

### FIXED CODE ###

i = 0
     
while 1:
   i += 1
   x = input()
   if x == 0:
      break
   else:
      print "Case %d: %d" %(i, x)