Harryxun/stf_run huggingface dataset:
# coding: utf-8
# Here your code !

def calculate_minkowski_distances():
    _ = input()
    data = []
    for i in range(2):
        data.append([float(value) for value in input().rstrip().split()])
    for exponent in (1, 2, 3, float("inf")):
        print("{0:.6f}".format(minkowski_distance(*data, exponent)))

def minkowski_distance(vector_x, vector_y, exponent):
    abs_xy = [ abs(pair[0] - pair[1]) for pair in zip(vector_x, vector_y) ]

    m_dis = 0
    if exponent == float("inf") :
        m_dis = max(abs_xy)
    elif exponent == 0 :
        m_dis = nan
    else :
        m_dis = ( sum([ elem**exponent for elem in abs_xy ])**(1/exponent) )
    
    return m_dis

if __name__ == "__main__" :
    calculate_minkowski_distances()
    
    

### FIXED CODE ###

# coding: utf-8
# Here your code !

def calculate_minkowski_distances():
    _ = input()
    data = []
    for i in range(2):
        data.append([float(value) for value in input().rstrip().split()])

    for exponent in (1, 2, 3, float("inf")):
        print(minkowski_distance(data[0],data[1], exponent))
#        print("{0:.8f}".format(minkowski_distance(*data, exponent)))

def minkowski_distance(vector_x, vector_y, exponent):
#    abs_xy = [ abs(pair[0] - pair[1]) for pair in zip(vector_x, vector_y) ]
    abs_xy = [abs(vector_x[i] - vector_y[i]) for i in range(len(vector_x))]
    
    m_dis = 0
    if exponent == float("inf") :
        m_dis = max(abs_xy)
    elif exponent == 0 :
        m_dis = nan
    else :
        m_dis = sum([ elem**exponent for elem in abs_xy ])**(1/exponent)
    
    return m_dis

if __name__ == "__main__" :
    calculate_minkowski_distances()
A, B = map(float, input().split())
A = int(A)
B = int(B*100)
print(math.floor(A*B/100))

### FIXED CODE ###

A, B = input().split()
A = int(A)
B = int(B[:-3]+B[-2:])

if len(str(A*B)) >= 3:
    print(str(A*B)[:-2])
else:
    print(0)
N, K = map(int, input().split())
hs = [int(input()) for _ in range(N)]
hs_sort = sorted(hs)
diff_min = 1e5
for i in range(N-K+1):
    diff = hs_sort[i+2] - hs_sort[i]
    if diff < diff_min:
        diff_min = diff
    else:
        continue
print(diff_min)

### FIXED CODE ###

N, K = map(int, input().split())
hs = [int(input()) for _ in range(N)]
hs_sort = sorted(hs)
diff_min = 1e10
for i in range(N-K+1):
    diff = hs_sort[i+K-1] - hs_sort[i]
    if diff <= diff_min:
        diff_min = diff
    else:
        continue
print(diff_min)
asum = 1
1<N<100

for x in range(2,N):
    asum += x

print(asum)


### FIXED CODE ###

N = int(input())

print(int(N*(N+1)/2))
n = int(input())
if len(set(n)) <= 2:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = list(map(int, input()))
n.sort()
if n[0] == n[1] == n[2]:
    print("Yes")
else:
    print("No")
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

N, Q = map(int, input().split())
info = [[] for _ in range(N)]
sum = [0 for _ in range(N)]

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


def plus(n, val):
    sum[n] += val
    for i in info[n]:
        plus(i, val)


for _ in range(Q):
    p, x = map(int, input().split())
    plus(p-1, x)
for i in sum:
    print(i)


### FIXED CODE ###

import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
import bisect

sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

N, Q = map(int, input().split())
info = [[] for _ in range(N)]
ans = [0 for _ in range(N)]
check = [1 for _ in range(N)]

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


def plus(n, val):
    ans[n] += val
    check[n] = 0
    for i in info[n]:
        if check[i]:
            plus(i, val + Query[i])


Query = [0 for _ in range(N)]
for _ in range(Q):
    p, x = map(int, input().split())
    Query[p - 1] += x
plus(0, Query[0])
ans = list(map(str, ans))
print(" ".join(ans))
x = input()
    a = x.split(' ')[0]
    b = x.split(' ')[1]

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


### FIXED CODE ###

line = int(input())

h = int(line / 3600)

m = int(line % 3600 / 60)

s = int(line % 3600 % 60)

print(str(h) + ':' + str(m) + ':' + str(s))
a = input()
third = a % 100
second = a % 10 - thrid * 10
first = a - (third *100 +second*10)
if(third == 7 or second == 7 or first == 7):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = int(input())
third = a // 100
second = a // 10 - third * 10
first = a - (third *100 +second*10)
if(third == 7 or second == 7 or first == 7):
  print("Yes")
else:
  print("No")
import math
from sympy import primerange
import sys
sys.setrecursionlimit(10**6) 
inn = n = int(input())
num = int(math.sqrt(n)) + 1
primlist = list(primerange(2,num)) 

for i in primlist:
    if inn % i == 0:
        while inn % num != 0:
            num -= 1
        else:
            print(num+ inn//num -2)
            break
        
else:
    print(inn-1)

### FIXED CODE ###

n = int(input())
ans = 0
t = int(n**(1/2)+1)


for i in range(t, 0, -1):
    if n%i == 0:
        ans += i
        ans += n//i
        break

print(ans-2)
n, k = map(int, input().split())
p = list(map(int, input().split()))
px = [(1 + p[i])/2 for i in range(n)]

ans = sum(px[i: i + k])
bef = sum(px[i: i + k])
for i in range(i, n - k + 1):
    bef = bef-px[i-1]+px[i+k-1]
    ans = max(ans, bef)
print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
p = list(map(int, input().split()))
px = [(1 + p[i])/2 for i in range(n)]

ans = sum(px[0: 0 + k])
bef = sum(px[0: 0 + k])
for i in range(1, n - k + 1):
    bef = bef-px[i-1]+px[i+k-1]
    ans = max(ans, bef)
print(ans)
#C-Next Letter
str = input()
K = int(input())
tempK = K
result = ""
for i in range(len(str)):
	changeNum = 122-ord(str[i])+1
	if (changeNum <= tempK):
		result += "a"
		tempK -= changeNum
	else:
		result += str[i]
if (tempK != 0):
	tempK %= 26
	result = result[:-1] + chr(ord(str[-1]) + tempK)
print(result)


### FIXED CODE ###

#A-Codefestival 2016
str=input()
str1=str[:4]+" "+str[4:]
print(str1)
A=input()
S=[int(A[i:i+2]) for i in range(0,len(A),2)]
if 0<=A[0] and A[0]<=12:
    if 0<=A[1] and A[1]<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 0<=A[1] and A[1]<=12:
        print('MMYY')
    else:
        print('NA')

### FIXED CODE ###

A=input()
S=[int(A[i:i+2]) for i in range(0,len(A),2)]
if 1<=S[0] and S[0]<=12:
    if 1<=S[1] and S[1]<=12:
        print('AMBIGUOUS')
    else:
        print('MMYY')
else:
    if 1<=S[1] and S[1]<=12:
        print('YYMM')
    else:
        print('NA')
n, a, b = map(int, intput().split())
a = n*a
print(min(a, b))

### FIXED CODE ###

n, a, b = map(int, input().split())
a = n*a
print(min(a, b))
# -*- coding: utf-8 -*-

import math
import functools

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

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

max_under_lcm = functools.reduce(lambda x, y: int((x * y) / gcd(x,y)), numbers) - 1
answer = sum([ max_under_lcm % n for n in numbers])

print(answer)

### FIXED CODE ###

import functools
import fractions

N = int(input())
numbers = list(map(int, input().split()))
answer = sum([n - 1 for n in numbers])

print(answer)
S,T = str(open(0))
Snum = len(S)

if S = T[:Snum]:
  print("Yes")
  
else:
  primt("No")


### FIXED CODE ###

S = str(input())
T = str(input())

if T.startswith(S):
  print("Yes")
else:
  print("No")
n = input()
a = input()

print(n*n-a)

### FIXED CODE ###

n = int(input())
a = int(input())

print(n*n-a)
from itertools import product

A,B,C,D,E,F = map(int, input().split())
num_a = F // (100 * A)
num_b = F // (100 * B) 
num_c = int((F * E / (E + 100)) // C)
num_d = int((F * E / (E + 100)) // D)

def check_w(w_mizu, w_sato, F):
  return w_mizu + w_sato <= F

def check_tokeru(w_mizu, w_sato, E):
  return 100 * w_sato / (w_mizu + w_sato) <= 100 * E / (100 + E)

def culc_density(w_mizu, w_sato):
  return 100 * w_sato / (w_mizu + w_sato)

max = [0, 0, 0]  # total, sato, density
for _a, _b,  in product(range(num_a + 1), range(num_b + 1)): 
  w_mizu = (A * _a + B * _b) * 100
  if w_mizu == 0 or w_mizu >= F:
    continue
    
  for _c, _d in product(range(num_c + 1), range(num_d + 1)):
    w_sato = (C * _c + D * _d)
    if w_sato == 0 or w_sato >= F or (w_mizu + w_sato) > F:
      continue
    
    density = culc_density(w_mizu, w_sato)
  
    if check_w(w_mizu, w_sato, F) and check_tokeru(w_mizu, w_sato, E):
      if max[2] < density:
        max[0] = w_mizu + w_sato
        max[1] = w_sato
        max[2] = density

if max[0]:
  print(max[0], max[1])
else:
  print(100*a, 0)


### FIXED CODE ###

from itertools import product

A,B,C,D,E,F = map(int, input().split())
num_a = F // (100 * A)
num_b = F // (100 * B) 
num_c = int((F * E / (E + 100)) // C)
num_d = int((F * E / (E + 100)) // D)

def check_w(w_mizu, w_sato, F):
  return w_mizu + w_sato <= F

def check_tokeru(w_mizu, w_sato, E):
  return 100 * w_sato / (w_mizu + w_sato) <= 100 * E / (100 + E)

def culc_density(w_mizu, w_sato):
  return 100 * w_sato / (w_mizu + w_sato)

max = [100 * A, 0, 0]  # total, sato, density
for _a, _b,  in product(range(num_a + 1), range(num_b + 1)): 
  w_mizu = (A * _a + B * _b) * 100
  if w_mizu == 0 or w_mizu >= F:
    continue
    
  for _c, _d in product(range(num_c + 1), range(num_d + 1)):
    w_sato = (C * _c + D * _d)
    if w_sato == 0 or w_sato >= F or (w_mizu + w_sato) > F:
      continue
    
    density = culc_density(w_mizu, w_sato)
  
    if check_w(w_mizu, w_sato, F) and check_tokeru(w_mizu, w_sato, E):
      if max[2] < density:
        max[0] = w_mizu + w_sato
        max[1] = w_sato
        max[2] = density

if max[0]:
  print(max[0], max[1])
# C - Bridge
# https://atcoder.jp/contests/abc075/tasks/abc075_c

from collections import deque

def dfs(i):
  visited = [False] * n
  stack = deque()
  stack.append(i)
  while stack:
    q = stack.popleft()
    nxts = graph[q]
    for nxt in nxts:
      if not visited[nxt]:
        visited[nxt] = True
        stack.append(nxt)
  return visited

n, m = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(m)]

ans = 0
for i in range(m):
  graph = [[] for _ in range(n)]
  for itr, (a, b) in enumerate(edge):
    if itr != i:
      graph[a - 1].append(b - 1)
      graph[b - 1].append(a - 1)

  if not all(dfs(i)):
    ans += 1

print(ans)


### FIXED CODE ###

from scipy.sparse.csgraph import dijkstra
N, M = map(int, input().split())
edge = [list(map(int, input().split())) for _ in range(M)]

graph = [[0] * (N + 1) for _ in range(N + 1)]
for a, b in edge:
  graph[a][b] = 1

answer = 0
INF = 10 ** 9
for a, b in edge:
  # a-bのedgeを取り除いた場合にa-bの距離を測る
  graph[a][b] = INF
  dist = dijkstra(graph, indices = a, directed = False)
  if dist[b] >= INF:
    answer += 1
  # a-bのedgeを戻す
  graph[a][b] = 1

print(answer)
N = int(input())
S = [input() for _ in range(N)]

import sys
import queue
import random

ans = 0
adj_list = [[]for _ in range(N)]
for i in range(N):
    for j in range(i+1,N):
        if int(S[i][j]):
            adj_list[i].append(j)
            adj_list[j].append(i)


for kk in range(N):
    q = []
    visited = [False] * N
    cnt = 1
    visited[kk] = True
    q.append(kk)
    VC = 1
    while VC < N:
        nextv = q.copy()
        q = []
        nextv = list(set(nextv))
        #子の要素同士の連結チェック
        L = len(nextv)
        for i in range(L):
            if not(visited[nextv[i]]):
                visited[nextv[i]] = True
                VC += 1
            for j in range(i+1,L):
                if (int(S[nextv[i]][nextv[j]])):
                    print(-1)
                    sys.exit()
        
        for nv in nextv:
            for v in adj_list[nv]:
                if not(visited[v]):
                    q.append(v)
    
        cnt += 1
    
    ans = max(ans,cnt-1)
        
#
print(ans)


### FIXED CODE ###


N = int(input())
S = [input() for _ in range(N)]

import sys
import copy

ans = 0
adj_list = [[]for _ in range(N)]
for i in range(N):
    for j in range(i+1,N):
        if int(S[i][j]):
            adj_list[i].append(j)
            adj_list[j].append(i)


for kk in range(N):
    q = []
    visited = [False] * N
    cnt = 1
    visited[kk] = True
    q.append(kk)
    VC = 1
    while VC < N:
        nextv = copy.copy(q)
        q = []
        nextv = list(set(nextv))
        #子の要素同士の連結チェック
        L = len(nextv)
        for i in range(L):
            if not(visited[nextv[i]]):
                visited[nextv[i]] = True
                VC += 1
            for j in range(i+1,L):
                if (int(S[nextv[i]][nextv[j]])):
                    print(-1)
                    sys.exit()
        
        for nv in nextv:
            for v in adj_list[nv]:
                if not(visited[v]):
                    q.append(v)
    
        cnt += 1
    
    ans = max(ans,cnt-1)
        
#
print(ans)
N = int(input())
A = list(map(int, input().split()))

x = sum(A)
y = sum([A[i] ** 2 for i in range(n)])

print(((x ** 2 - y) / 2) % (10 ** 9 + 7))

### FIXED CODE ###

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

x = sum(A)
y = sum([A[i] ** 2 for i in range(N)])

print(((x ** 2 - y) // 2) % (10 ** 9 + 7))
x = input()
print(x * x * x)

### FIXED CODE ###

x = int(input())
print(x ** 3)
N =int(input())
dic = {}
j=1
for i in map(int, input().split()):
    dic[i]=j
    j+=1
for n in range(N):
    print(dic[n])

### FIXED CODE ###

N =int(input())
dic = {}
j=1
for i in map(int, input().split()):
    dic[i]=j
    j+=1
for n in range(1, N+1):
    print(dic.get(n))
s=input()
SUM=0
p=0;q=0
b=0

j=0
while s[j]==">":
    j+=1
SUM+=(1+j)*j//2
h=s[j]
for i in range(j,len(s)):
    if s[i]==h and b==0:
        p+=1
    if s[i]!=h:
        q+=1
        b=1
    if (s[i]==h and b==1) or (i==len(s)-1):
        w1=max(p,q)
        w2=min(p,q)
        SUM+=(1+w1)*w1//2+w2*(w2-1)//2
        if (s[i]==h and b==1) and (i==len(s)-1):
            SUM+=1
        b=0
        p=1;q=0
        
print(SUM)

### FIXED CODE ###

s=input()
SUM=0
p=0;q=0
b=0

j=0
while s[j]==">":
    j+=1
    if j==len(s):
        break
SUM+=(1+j)*j//2
if j!=len(s):
    h=s[j]
    for i in range(j,len(s)):
        if s[i]==h and b==0:
            p+=1
        if s[i]!=h:
            q+=1
            b=1
        if (s[i]==h and b==1) or (i==len(s)-1):
            w1=max(p,q)
            w2=min(p,q)
            SUM+=(1+w1)*w1//2+w2*(w2-1)//2
            if (s[i]==h and b==1) and (i==len(s)-1):
                SUM+=1
            b=0
            p=1;q=0
        
print(SUM)
a,b=map(int,input().split())
s=input()
if s[:a].isdigit() and s[a:b]=='-' and s[b:].isdigit():
    print("True")
else:
    print("No")

### FIXED CODE ###

print(48-int(input()))
N = int(input()) 
name='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26)
    N = N // 26
print(name[::-1])

### FIXED CODE ###

N=int(input())
l = int(N**(1/26))
name = ''
while N >0:
    N -= 1
    r = N%26
    N = N//26
    name += chr(ord('a')+r)
print(name[::-1])
inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

if 0=< former <=12 and 0=< latter <=12:
	print("AMBIGUOUS")
elif 0=< former <=12 and 12< latter:
	print("MMYY")
elif 0=< latter <=12 and 12< former:
	print("YYMM")

else:
	print("NA")

### FIXED CODE ###

inp=input()
former=int(inp[0]+inp[1])
latter=int(inp[2]+inp[3])

if 0< former <=12 and 0< latter <=12:
	print("AMBIGUOUS")
elif 0< former <=12 :
	print("MMYY")
elif 0< latter <=12 :
	print("YYMM")
else:
	print("NA")
n,k = list(map(int, input().split()))
hoge = [1] * n

for i in range(k * 2):
  if i % 2 == 0:
    a = list(map(int, input().split()))
  	for j in a:
      hoge[j - 1] = 0
      
print(sum(hoge))


### FIXED CODE ###

n,k = list(map(int, input().split()))
hoge = [1] * n

for i in range(k * 2):
  a = list(map(int, input().split()))
  if i % 2 != 0:
    for j in a:
      hoge[j - 1] = 0
      
print(sum(hoge))
# -*- coding: utf-8 -*-

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


truelist = [1,2,3]

truelist.pop(a)
truelist.pop(b)

print(truelist[0])


### FIXED CODE ###

a = int(input())
b = int(input())

list = [1,2,3]

list.remove(a)
list.remove(b)

print(list[0])
n,m = [int(x) for x in input().split()]
py = []
for i in range(m):
    p,y = [int(x) for x in input().split()]
    py.append([p,y,i+1])

def zero(num):
    return str(num).zfill(6)


year_py = sorted(py, key=lambda x: x[1])
dic = {x: 1 for x in range(1,m+1)}

for i in range(m):
    year_py[i].append(dic[year_py[i][0]])
    dic[year_py[i][0]] += 1

yb_py = sorted(year_py, key=lambda x: x[2])

for i in range(m):
    print(zero(yb_py[i][0]) + zero(yb_py[i][3]))

### FIXED CODE ###

n,m = [int(x) for x in input().split()]
py = []
for i in range(m):
    p,y = [int(x) for x in input().split()]
    py.append([p,y,i+1])

def zero(num):
    return str(num).zfill(6)


if m == 1:
    print(zero(py[0][0])+zero(1))
else:
    year_py = sorted(py, key=lambda x: x[1])
    dic = {str(x): 0 for x in range(1,n+1)}

    for i in range(m):
        dic[str(year_py[i][0])] += 1
        year_py[i].append(dic[str(year_py[i][0])])
    yb_py = sorted(year_py, key=lambda x: x[2])

    for i in range(m):
        print(zero(yb_py[i][0]) + zero(yb_py[i][3]))
times=10**100
S=input()

start=-1
cycle=-1

clist=[1]*len(S)
dic_list={}
for i in range(1,10):  
  new_clist=[0]*len(S)
  for j,s in enumerate(S):
    if s=="L":
      new_clist[j-1]+=clist[j]
    elif s=="R":
      new_clist[j+1]+=clist[j]

  clist=new_clist
  #print(clist)
  
  if str(clist) in dic_list:
    #print(i,i-dic_list[str(clist)],str(clist))
    ans_list=clist
    start=i
    cycle=i-dic_list[str(clist)]
    break
  else:
    dic_list[str(clist)]=i
    
ans_list_str = map(str,ans_list)
print(" ".join(ans_list_str))

### FIXED CODE ###

S=input()
ans_list=[0]*len(S)

rmode=True
cnt_R=0
cnt_L=0
border_R=0
border_L=0
for i in range(len(S)):
  if rmode:
    if S[i]=="R":
      cnt_R+=1
    else:
      border_R=i-1
      border_L=i      
      rmode=False
      cnt_L=1
  else:
    if S[i]=="L":
      cnt_L+=1
    else:
      ans_list[border_R]+=(cnt_R+1)//2
      ans_list[border_L]+=cnt_R//2
      ans_list[border_R]+=cnt_L//2
      ans_list[border_L]+=(cnt_L+1)//2
      rmode=True
      cnt_R=1
      cnt_L=0
else:
  ans_list[border_R]+=(cnt_R+1)//2
  ans_list[border_L]+=cnt_R//2
  ans_list[border_R]+=cnt_L//2
  ans_list[border_L]+=(cnt_L+1)//2
  
      
ans_list_str=map(str,ans_list)
print(" ".join(ans_list_str))
N, K = list(map(int, input().split()))
links = [list(map(int, input().split())) for _ in range(N-1)]
start = links[0][0]

def perm(a, b):
    s = 1
    for i in range(a-b+1, a+1):
        s *= i
    return s

if N == 1:
    print(K)
else:
    mod = 1000000007
    d = {}
    for a, b in links:
        if a in d:
            d[a].append(b)
        else:
            d[a] = [b]
    b = len(d[start])
    if K - 1 < b:
        print(0)
    else:
        ans = K * perm(K - 1, b)
        root = d[start]
        a = K - 2
        while True:
            children = []
            for i in root:
                if i in d:
                    b = len(d[i])
                    if a < b:
                        print(0)
                        break
                    ans *= perm(a, b)
                    children.extend(d[i])
            else:
                if children == []:
                    print(ans % mod)
                    break
                root = children
                continue
            break

### FIXED CODE ###

N, K = list(map(int, input().split()))
l = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = list(map(int, input().split()))
    l[a].append(b)
    l[b].append(a)

deg1 = [0] * (N + 1)
deg2 = [0] * (N + 1)
history = [True] * (N + 1)
stack = [1]
ans = 1

while stack:
    node = stack.pop()
    ans *= K - deg1[node] - deg2[node]
    ans %= 1000000007
    history[node] = False
    for child in l[node]:
        if history[child]:
            deg1[child] += 1
            deg2[child] += deg1[node]
            deg1[node] += 1
            stack.append(child)
            
print(ans)
# -*- coding:utf-8 -*-
import sys

def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if nx>=0 and nx<N and ny>=0 and ny<M and tile[nx][ny]==sym:
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			if tile[i][j] != ".":
				if tile[i][j] == "@":
					dfs(i, j, "@")
					res += 1
				elif tile[i][j] == "#":
					dfs(i, j, "#")
					res += 1
				elif tile[i][j] == "*":
					dfs(i, j, "*")
					res += 1
	print(res)

counter=0
DX = [-1, 0, 1, 0]
DY = [0, -1, 0, 1]
sys.setrecursionlimit(1000000)

while True:
	counter+=1
	line = input()
	if ' ' in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(N)] for j in range(M)]
	if N==0 and M==0:
		break
	else:
		tile[counter-2] = list(line)
	if (counter-1)==M:
		solve()
		counter = 0

### FIXED CODE ###

# -*- coding:utf-8 -*-
import sys
def dfs(x, y, sym):
	tile[x][y] = "."
	for i in range(len(DX)):
		nx = x + DX[i]
		ny = y + DY[i]
		if (0<=nx and nx<N and 0<=ny and ny<M and tile[nx][ny] is sym):
			dfs(nx, ny, sym)

def solve():
	res = 0
	for i in range(N):
		for j in range(M):
			sym = tile[i][j]
			if tile[i][j] != ".":
				if tile[i][j] is sym:
					dfs(i, j, sym)
					res += 1
	print(res)

counter=0
DX = [-1,0,1,0]
DY = [0,-1,0,1]
sys.setrecursionlimit(10**7)
while True:
	line = input()
	if " " in line:
		nums = line.split(" ")
		N = int(nums[0])
		M = int(nums[1])
		tile = [[0 for i in range(M)] for j in range(N)]
	else:
		tile[counter-1] = list(line)
	if N is 0 and M is 0:
		break
	counter += 1
	if counter-1 is N:
		solve()
		counter = 0
N = int(input())
S, T = input().split()
ans = str()
for i in range(N):
    ans += (S[i])
    ans += (T[i])
print(ans)

### FIXED CODE ###

S = input()
ans = int()
for i in range(len(S)//2):
    if S[i] != S[-(i + 1)]:
        ans += 1
print(ans)
N=input()
M=input()
if N==M:
  print 'Yes'
else:
  print 'No'

### FIXED CODE ###

a=raw_input()
m=a.split()
N,M=map(int,m)
if N==M:
  print 'Yes'
else:
  print 'No'
n,m = map(int,input().split())
def div(x,y):
    if x%y!=0:
        return 0
    else:
        return 1+div(int(x/y),y)

p=[]

def fact(s):
    if len(p)!=0:
        k=p[-1]
    else:
        k=2
    for i in range(2,max(int(s**0.5) +2,2)):
        a=div(s,i)
        if a==0:
            0
        else:
            p.append(a)
            s=int(s/i**a)
            
fact(m)
#print(p)
mo=10**9+7
from scipy.special import comb
ans=1
if len(p)==0:
    ans=1
else:
    for i in p:
        ans=ans*comb(i+n-1, i, exact=True) % mo
        #print(ans,comb(i+n-1, i, exact=True))
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
def div(x,y):
    if x%y!=0:
        return 0
    else:
        return 1+div(int(x/y),y)

p=[]
q=[]

def fact(s):
    if len(p)!=0:
        k=p[-1]
    else:
        k=2
    for i in range(2,max(int(s**0.5) +2,2)):
        a=div(s,i)
        if a==0:
            0
        else:
            p.append(a)
            q.append(i)
            s=int(s/i**a)
    if s!=1:
        p.append(1)
            
fact(m)
def comb(nn,rr):
    rr=min(rr,nn-rr)
    rt=1
    for i in range(rr):
        #rt=rt*(nn-i)/(rr-i)
        rt*=(nn-i)
    for i in range(rr):
        rt//=(rr-i)
    return int(rt)
#print(p,q,m)
mo=10**9 +7
ans=1
if len(p)==0:
    ans=1
else:
    for i in p:
        ans*=comb(i+n-1, i) % mo
print(ans % mo)
N = int(input())
A = list(map(int, input().split()))

ret = 0
flag = True
while(flag):
  for i in range(3):
    if(A[i] % 2 != 0):
      flag = False
    else:
      A[i] /= 2
  if(flag):
    ret += 1  
print(ret)

### FIXED CODE ###

s1, s2, s3 = map(int, list(input()))
print(s1 + s2 + s3)