Harryxun/stf_run huggingface dataset:
import sys
n = int(input())
x = []
y = []
for i in range(n):
  xi, yi = map(int, input().split())
  x.append(xi)
  y.append(yi)
parity = None
for i in range(n):
  if i == 0:
    parity = (x[i] + y[i]) % 2
  elif (x[i] + y[i]) % 2 != parity:
    print(-1)
    sys.exit()
print(20 - parity)
print(*[1] * (20 - parity))
for i in range(n):
  s = ''
  if x[i] > 0:
    s += 'R' * x[i]
  else:
    s += 'L' * (-x[i])
  if y[i] > 0:
    s += 'U' * y[i]
  else:
    s += 'D' * (-y[i])
  s += (20 - parity - abs(x[i]) - abs(y[i])) // 2 * 'LR'
  print(s)

### FIXED CODE ###

import sys
import itertools
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]
c = ['R', 'U', 'L', 'D']
n = int(input())
x = []
y = []
for i in range(n):
  xi, yi = map(int, input().split())
  x.append(xi)
  y.append(yi)
parity = None
for i in range(n):
  if i == 0:
    parity = (x[i] + y[i]) % 2
  elif (x[i] + y[i]) % 2 != parity:
    print(-1)
    sys.exit()
print(40)
d = []
for i in range(20):
  d.append(3**i)
  d.append(3**i)
d[1] += parity
print(*d)
d = [1] * 40
d[1] += parity
for i in range(n):
  for m in range(20):
    for j, k in itertools.product(range(4), range(4)):
      xnew = x[i] - (d[2*m] * dx[j] + d[2*m+1] * dx[k])
      ynew = y[i] - (d[2*m] * dy[j] + d[2*m+1] * dy[k])
      if xnew % 3 == 0 and ynew % 3 == 0:
        x[i] = xnew // 3
        y[i] = ynew // 3
        print(c[j] + c[k], end='')
        break
  print('')
def main():
    n = input()
    if len(n) == 1:
        print(n)
    else:
        ans = (len(n) - 1) * 9
        t = 0
        for i in range(len(n)):
            t += int(n[i])
        ans = max(ans, t)
        k = int(n)
        for i in range(len(n)-1):
            nn = str(k)
            m = int(nn[len(n) - i - 1:]) + 1
            #print(m)
            k -= m
            t = 0
            for j in range(len(str(k))):
                t += int(str(k)[j])
            ans = max(ans, t)
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    n = input()
    if len(n) == 1:
        print(n)
        exit()
    else:
        ans = (len(n) - 1) * 9
        t = 0
        for i in range(len(n)):
            t += int(n[i])
        ans = max(ans, t)
        k = int(n)
        for i in range(len(n)-1):
            nn = str(k)
            m = int(nn[len(n) - i - 1:]) + 1
            k -= m
            t = 0
            for j in range(len(str(k))):
                t += int(str(k)[j])
            ans = max(ans, t)
    print(ans)


if __name__ == '__main__':
    main()
def getItemCount(L):
  if L == 0:
    return 1
  return 2*getItemCount(L-1) + 3
  
def getPatsCount(L, eaten):
  if eaten * 2 - 1 == getItemCount(L):
    return 2**(1+layer) + 1
  return 2**(1+layer)

def getAns(layer, eaten):
  items = getItemCount(layer)
  patsInLayer = getPatsCount(layer, eaten)
  if layer == 0 and eaten == 1:
    return 1
  if eaten == items:
    return patsInLayer
  elif eaten < items:
    return getAns(layer-1, eaten - 1)
  else:
    return patsInLayer + getAns(layer-1, eaten - 1)


layer, eaten = [int(x) for x in input().split()]
print(getAns(layer, eaten))

"""
tPats = 0
if layer != 0:
  while 1:
    items = getItemCount(layer)
    patsInLayer = getPatsCount(layer)

    if eaten == items:
      if layer != 0:
        tPats += patsInLayer
        eaten -= items
      break
    elif eaten < items:
      eaten -= 1
    elif eaten > items:
      tPats += patsInLayer + 1
      eaten -= items
    layer -= 1
    if layer < 0:
      break
else:
  if eaten == 1:
    print(1)
  else:
    print(0)
print(tPats)
"""

### FIXED CODE ###

def getItems(layerCount):
	if layerCount == 0:
		return 1
	return 2*getItems(layerCount-1) + 3

def getPats(layerCount):
	return 2**(layerCount + 1) - 1

def patEaten(layer, toEat):
	pattyCount = 0

	if layer == 1:
		burger = "BPPPB"

		for x in range(toEat):
			if burger[x] == "P":
				pattyCount += 1
		return pattyCount
		
	elif layer == 0:
		if toEat == 1:
			return 1
		else:
			return 0
	
	else:
		items = getItems(layer)
		if toEat == items:
			pattyCount += getPats(layer)
			return pattyCount
		elif toEat < 2+getItems(layer-1):
			if items + 1 == 2* toEat:
				toEat-=2
				return 1 + patEaten(layer - 1, toEat)
			toEat -= 1
			return patEaten(layer - 1, toEat)
		else:
			toEat -= (1+1+getItems(layer-1))
			pattyCount += 1 + getPats(layer-1)
			
			return pattyCount + patEaten(layer-1, toEat)

i, j = [int(x) for x in input().split()]
#print(patEaten(2,13))
print(patEaten(i,j))
x = list(map(int, input().split()))
for i in range(0, len(x)):
  if x[i] == 0:
    print(i + 1)
    return


### FIXED CODE ###

x = list(map(int, input().split()))
for i in range(0, len(x)):
  if x[i] == 0:
    print(i + 1)
    break
n, m, v, p = map(int, input().split())
a = list(map(int, input().split()))
a.sort()


def check(x):
    if x > n - p:
        return True

    for i in range(x + 1, n - p + 1):
        if a[x] + m < a[i]:
            return False

    if v - x - p > 0:
        cnt = 0
        for i in range(x + 1, n - p + 1):
            cnt += min((a[x] + m) - a[i], m)

        if (cnt // (v - x - p)) >= m:
            return True
        else:
            return False
    else:
        return True


lb = -1  # False
ub = n - 1  # True
while ub - lb > 1:
    mid = (ub + lb) // 2
    if check(mid):
        ub = mid
    else:
        lb = mid

# print(a)
# print(lb, ub)
ans = n - ub
print(ans)


### FIXED CODE ###

n = int(input())


def make3board(x):
    # 3x3のクォリティー2の敷き詰め方
    # aab
    # d.b
    # dcc
    m = x // 3
    base = ["aab", "d.b", "dcc"]
    board = []
    for i in range(m):
        sl = "..." * i
        sr = "..." * (m - 1 - i)
        for bj in base:
            board.append(sl + bj + sr)
    return board


def make4board(x):
    # 4x4のクォリティー3の敷き詰め方
    # aagh
    # bbgh
    # cdee
    # cdff
    m = x // 4
    base = ["aagh", "bbgh", "cdee", "cdff"]
    board = []
    for i in range(m):
        sl = "...." * i
        sr = "...." * (m - 1 - i)
        for bj in base:
            board.append(sl + bj + sr)
    return board


def make5board(x):
    # 5x5のクォリティー3の敷き詰め方
    # aadde
    # bbg.e
    # ccgff
    # ..abc
    # ..abc
    m = x // 5
    base = ["aadde", "bbg.e", "ccgff", "..abc", "..abc"]
    board = []
    for i in range(m):
        sl = "....." * i
        sr = "....." * (m - 1 - i)
        for bj in base:
            board.append(sl + bj + sr)
    return board


def make7board(x):
    # 7x7のクォリティー3の敷き詰め方
    # aabbcc.
    # dd.dd.c
    # ..d..dc
    # ..d..db
    # dd.dd.b
    # ..d..da
    # ..d..da
    m = x // 7
    base = [
        "aabbcc.", "dd.dd.c", "..d..dc", "..d..db", "dd.dd.b", "..d..da",
        "..d..da"
    ]
    return board


def concat_board(board1, board2):
    # クォリティーが同じ２つのboardを対角線上に配置して繋ぐ
    # A..
    # .BB
    # .BB
    x, y = len(board1), len(board2)
    board = []
    sr = '.' * y
    board += [board1[i] + sr for i in range(x)]
    sl = '.' * x
    board += [sl + board2[i] for i in range(y)]
    return board


board = []
if n % 3 == 0:
    board = make3board(n)
elif n % 4 == 0:
    board = make4board(n)
elif n % 5 == 0:
    board = make5board(n)
elif n == 7 or n == 11:
    board7 = [
        "aabbcc.", "dd.dd.c", "..d..dc", "..d..db", "dd.dd.b", "..d..da",
        "..d..da"
    ]
    board = concat_board(board7, make4board(n - 7))
else:
    for x in range(4, n, 4):
        y = n - x
        if y % 5 == 0:
            board = concat_board(make4board(x), make5board(y))
            break

if len(board) != 0:
    print(*board, sep='\n')
else:
    print(-1)
h,w=map(int,input().split())
s=[input() for _ in range(h)]
dy=[0,0,1,-1]
dx=[1,-1,0,0]
def dfs(y,x):
    global check
    global was
    was[y][x]=1
    if s[y][x]=="#":
        check[0]+=1
    else:
        check[1]+=1
    for k in range(4):
        nx=x+dx[k]
        ny=y+dy[k]
        if nx >= 0 and ny >= 0 and nx < w and ny < h and s[ny][nx] != s[y][x] and not was[ny][nx]:
            dfs(ny,nx) 
ans=0
was=[[0 for _ in range(w)] for _ in range(h)]
for i in range(w):
    for j in range(h):
        if not was[j][i]:
            check=[0,0]
            dfs(j,i)
            ans+=check[0]*check[1]
print(ans)

### FIXED CODE ###

H,W=map(int,input().split())
S=[input() for i in range(H)]
visit=[[False]*W for i in range(H)]
par=[[None]*W for i in range(H)]
dd={}
X=[-1,0,1,0]
Y=[0,-1,0,1]
for j in range(H):
    for i in range(W):
        if visit[j][i]:
            continue
        if S[j][i]=='.':
            continue
        lH=[]
        lH.append((j,i,0))#0が黒
        par[j][i]=(i,j)
        num=0
        while lH:
            y,x,t=lH.pop()
            visit[y][x]=True
            for k in range(4):
                nx=x+X[k]
                ny=y+Y[k]
                if 0<=nx<W and 0<=ny<H:
                    if visit[ny][nx]:
                        continue
                    if t==0 and S[ny][nx]=='.':
                        visit[ny][nx]=True
                        num+=1
                        lH.append((ny,nx,1))
                    elif t==1 and S[ny][nx]=='#':
                        visit[ny][nx] = True
                        par[ny][nx]=(i,j)
                        lH.append((ny,nx,0))
        dd[(i,j)]=num
ans=0
for j in range(H):
    for i in range(W):
        if S[j][i]=='#':
            x,y=par[j][i]
            ans+=dd[(x,y)]
print(ans)
n=input()
s=0
for i in n:
  s+=int(i)
print("Yes" if s%9==0 else "No")

### FIXED CODE ###

MOD = 1000000007
from collections import defaultdict as dd,Counter,deque

def si(): return input()
def ii(): return int(input())
def li(): return list(map(int,input().split()))
def mi(): return map(int,input().split())
def out(v): print(v)
def spout(): print(v,end=" ")
def d2b(n): return bin(n).replace("0b","")
def twod(n,m,num):return [[num for x in range(m)] for y in range(n)]
def vow(): return ['a','e','i','o','u']
def let(): return [chr(i) for i in range(97,123)]
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x
def ispow2(x):
    return (x and (not(x & (x - 1))))
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i: i+=1
        else:
            n //= i
            factors.append(i)
    if n > 1: factors.append(n)
    return (list(factors))
    
    
n,k,t=mi()
print(t*(n//k if n%k==0 else n//k+1))
n, m, x = map(int, input().split())
a = list(map(int, input().split()))

# xは最初の位置
# nは目的地
# aは料金所（コスト1）

cost = 0
cost2 = 0

for i in range(len(a)):
  if a[i] > x and a[i] < n:
    cost += 1
for j in range(x):
  if a[j] > 0 and a[j] < x :
    cost2 += 1
    
if cost < cost2:
  print(cost)
else:
  print(cost2)

### FIXED CODE ###

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

# xは最初の位置
# nは目的地
# aは料金所（コスト1）

cost = 0
cost2 = 0

for i in a:
  if i > x:
    cost += 1
  else:
    cost2 += 1
    
if cost < cost2:
  print(cost)
else:
  print(cost2)
S = input()
C = {"a": 0, "b": 0, "c": 0}
for s in S:
    C["s"] += 1
if abs(C["a"] - C["b"]) <= 1 and abs(C["a"] - C["b"]) <= 1 and abs(C["a"] - C["b"]) <= 1:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

S = input()
C = {"a": 0, "b": 0, "c": 0}
for s in S:
    C[s] += 1
if abs(C["a"] - C["b"]) <= 1 and abs(C["b"] - C["c"]) <= 1 and abs(C["c"] - C["a"]) <= 1:
    print("YES")
else:
    print("NO")
N = map(int, input())
if N % 2 == 0:
  print(N / 2 /N)
else:
  print((N / 2 + 1) / N)

### FIXED CODE ###

N = int(input())
if N % 2 == 1:
    print((N // 2 + 1) / N)
else:
    print((N // 2) / N)
MOD = 1000000007

N, K = map(int, input().split())
uv = {}
for i in range(N-1):
    a, b = map(int, input().split())
    if a in uv:
        uv[a].append(b)
    else:
        uv[a] = [b]

    if b in uv:
        uv[b].append(a)
    else:
        uv[b] = [a]

f = None
for u in uv:
    if len(uv[u]) == 1:
        f = u
        break
#print(uv)

ans = 1
b = [False] * (N+1)
ulist = [[f, 0]]
while ulist:
    u, pNum = ulist[-1]
    ulist.pop()
    b[u] = True

    uPtn = K - pNum
    ans = ans*uPtn % MOD

    #print(u)
    cnt = 1
    if pNum == 0:
        cnt = 0
    for v in uv[u]:
        if b[v]:
            continue
        ulist.append([v, 1 + cnt])
        cnt += 1

print(ans)


### FIXED CODE ###

MOD = 1000000007

N, K = map(int, input().split())
uv = {}
for i in range(N-1):
    a, b = map(int, input().split())
    if a in uv:
        uv[a].append(b)
    else:
        uv[a] = [b]

    if b in uv:
        uv[b].append(a)
    else:
        uv[b] = [a]

f = 1
for u in uv:
    if len(uv[u]) == 1:
        f = u
        break
#print(uv)

ans = 1
b = [False] * (N+1)
ulist = [[f, 0]]
while ulist:
    u, pNum = ulist[-1]
    ulist.pop()
    b[u] = True

    uPtn = K - pNum
    ans = ans*uPtn % MOD

    #print(u)
    cnt = 1
    if pNum == 0:
        cnt = 0
    if u in uv:
        for v in uv[u]:
            if b[v]:
                continue
            ulist.append([v, 1 + cnt])
            cnt += 1

print(ans)
X, Y = map(int, input().split())

if (2*X-Y)%3==0 and (2*Y-X)%3==0:
    a = (2*X-Y)//3
    b = X-2*a
    MOD = 10**9+7
    n = a+b+1
    fac = [1]*(n+1)
    rev = [1]*(n+1)
    
    for i in range(1,n+1):
        fac[i] = i*fac[i-1]%MOD
        rev[i] = pow(fac[i], MOD-2, MOD)
    comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%MOD

    print(comb(a+b, a))
else:
    print(0)


### FIXED CODE ###

X, Y = map(int, input().split())

mod = 10**9+7
N = 1333334
fac = [1]*(N+1)
rev = [1]*(N+1)
 
for i in range(1,N+1):
  fac[i] = i*fac[i-1]%mod
  rev[i] = pow(fac[i], mod-2, mod)
 
comb = lambda a,b:(fac[a]*rev[a-b]*rev[b])%mod

a, b = (2*X-Y)//3, (2*Y-X)//3
if a<0 or b<0 or (2*X-Y)%3 or (2*Y-X)%3:
    print(0)
else:
    print(comb(a+b, a))
import math

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

if k % 2 != 1:
    print(a - b if abs(math.log10(a-b)) <= 18 else "Unfair")
else:
    print(b - a if abs(math.log10(a-b)) <= 18 else "Unfair")


### FIXED CODE ###

import math

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

if k % 2 != 1:
    if a-b == 0:
        print(0)
    else:
        print(a - b if abs(math.log10(abs(a-b))) <= 18 else "Unfair")
else:
    if a-b == 0:
        print(0)
    else:
        print(b - a if abs(math.log10(abs(a-b))) <= 18 else "Unfair")
import math
a, b = map(int, input().split())
print(int(a * b / (math.gcd(a, b))))

### FIXED CODE ###

import fractions
a, b = map(int, input().split())
print(int(a * b / (fractions.gcd(a, b))))
def ans():
    global cnt, s, l
    if s.count("BW") == 0:
        return None
    for i in range(s.count("BW")):
        print(s)
        cnt += 1
        l.pop(s.index("BW") + 1)
        l[s.index("BW"):s.index("BW") + 1] = ["W", "B"]
        s = "".join(l)
    ans()
s = input()
l = list(s)
cnt = 0
ans()
print(cnt)

### FIXED CODE ###

s=input()
b=0
cnt=0
for i in range(len(s)):
  if s[i]=="B":
    b+=1
    cnt+=i
print(int((len(s)*2-b-1)*b*(1/2)-cnt))
N = input()
A = input()

if(N / 500 < A)
	print("Yes)
else
    print("No")

### FIXED CODE ###

N = int(input())
A = int(input())
 
if(N % 500 <= A):
  print("Yes")
else:
  print("No")
from math import isclose


w, h, x, y = map(float, input().split())

if isclose(x, w / 2) and isclose(y, h / 2):
    print((w * h) / 2, 1)
else:
    print((w * h) / 2, 0)

### FIXED CODE ###

w, h, x, y = map(int, input().split())
print(w * h / 2, end=' ')
if (x == w / 2 and y == h / 2):
	print(1)
else:
	print(0)
A,B = [int(c) for c in input().strip().split('')]
if 2*B>A:
  print(0)
else:
  print(A-2*B)

### FIXED CODE ###

A,B = [int(c) for c in input().strip().split(' ')]
if A>2*B:
    print(A-2*B)
else:
    print(0)
n = int(input())
li = []
c = 0
for i in range(n):
    w = input()
    if w in li:
        print("No")
        break
    else:
        li.append(w)
for i in range(n-1):
    if li[i][-1] == li[i + 1][0]:
        c = 1
    else:
        c = 0
        break
if c == 0:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

n = int(input())
li = []
c = 1
for i in range(n):
    w = input()
    if w in li:
        c = 0
        
    else:
        li.append(w)

if c == 1:
    for i in range(1,n):
        if li[i - 1][-1] != li[i][0]:
            c = 0
            break
        else:
            c = 1
        
if c == 0:
    print("No")
else:
    print("Yes")
import sys
input = sys.stdin.readline
N = int(input())


node = [0 for i in range(N)]
neigh = [[] for j in range(N)]
ans = [0 for i in range(N)]
visited = [0 for i in range(N)]
k = 1

for i in range(N-1):
    ai,bi = map(int,input().split())
    node[ai-1] += 1
    node[bi-1] += 1
    neigh[ai-1].append(bi-1)
    neigh[bi-1].append(ai-1)
c = list(map(int,input().split()))
c.sort(reverse=True)

def dfs(neighbor,start,visited):
    global k
    global c
    if sum(visited) == N:
        return 0
    for i in neighbor[start]:
        if visited[i] == 0:
            ans[i] = c[k]
            k += 1
            visited[i] = 1
            dfs(neighbor,i,visited)
        else:
            continue

m = max(node)
nn = node.index(m)
#nn = [node[i] for i in range(N) if node[i] == m][0]
visited[nn] = 1
ans[nn] = max(c)

dfs(neigh,nn,visited)
print(100)
print(' '.join([str(i) for i in range(N)]))
exit()
ans2 = ' '.join([str(ans[i]) for i in range(N)])


print(sum(c)-max(c))
print(ans2)


### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
N = int(input())


node = [0 for i in range(N)]
neigh = [[] for j in range(N)]
ans = [0 for i in range(N)]
visited = [0 for i in range(N)]
k = 1

for i in range(N-1):
    ai,bi = map(int,input().split())
    node[ai-1] += 1
    node[bi-1] += 1
    neigh[ai-1].append(bi-1)
    neigh[bi-1].append(ai-1)
c = list(map(int,input().split()))
c.sort(reverse=True)
flag = False
def dfs(neighbor,start):
    global flag
    global k
    if sum(visited) == N:
        return 0

    for i in neighbor[start]:
        
        if visited[i] == 0:
            ans[i] = c[k]
            k += 1
            visited[i] = 1
            try:
                dfs(neighbor,i)
            except RuntimeError:
                flag = True
                return 0




m = max(node)
nn = node.index(m)
#nn = [node[i] for i in range(N) if node[i] == m][0]
visited[nn] = 1
ans[nn] = max(c)

dfs(neigh,nn)
"""
if flag:
    print(100)
    print(' '.join([str(i) for i in range(N)]))
    exit()
"""
ans2 = ' '.join([str(ans[i]) for i in range(N)])


print(sum(c)-max(c))
print(ans2)
N=input()
a=0
for i in N:
  a+=int(i)
print("Yes") if N%a==0 else print("No")

### FIXED CODE ###

N=input()
a=0
for i in N:
  a+=int(i)
print("Yes") if int(N)%a==0 else print("No")
prin

### FIXED CODE ###

a = list(map(int, input().split()))
print(max(a) * 9 + sum(a))
from decimal import Decimal
a,b,c = list(map(int,input().split()))
a = Decimal(a)
b = Decimal(b)
c = Decimal(c)
A = a**0.5
B = b**0.5
C = c**0.5
if AB < C:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a,b,c = list(map(int,input().split()))
X = c-a-b
if X > 0 and X*X > 4*a*b:
    print("Yes")
else:
    print("No")
t = 0
lis = list()
for i in A:
    lis.append(B[i-1])
    #print(i,t)
    if i == t + 1:
        lis.append(C[i-2])
    t = i

print(sum(lis))

### FIXED CODE ###

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

t = 1000000000
lis = list()
for i in A:
    lis.append(B[i-1])
    #print(i,t)
    if i == t + 1:
        lis.append(C[i-2])
    t = i

print(sum(lis))
def mrinfinit(a):
    if len(a) > 1:
        if '1' in a:
            a = a.replace('1', '')
            return a[0]
        else:
            return a[0]
    return a[0]


if __name__ == '__main__':
    la = input()
    lb = int(input())
    print(mrinfinit(la))


### FIXED CODE ###

def mrinfinit(a, b):
    bf = list(set(a))
    rr = a[:b]
    sf = list(set(rr))

    if len(bf) == 1 and bf[0] == '1':
        return a[0]
    elif len(sf) == 1 and sf[0] == '1':
        return a[0]
    elif len(a) > 1:
        if '1' in a:
            a = a.replace('1', '')
            return a[0]
        else:
            return a[0]
    else:
        return a[0]


if __name__ == '__main__':
    la = input()
    lb = int(input())
    print(mrinfinit(la, lb))
a=[input()]
b=a(0)
c=a(1)
d=a(2)
e=c/b
if e>>d:
  print(d)
elif d>>e:
  print(e)


### FIXED CODE ###

a=list(input().split())
b=int(a[0])
c=int(a[1])
d=int(a[2])
e=int(c/b)
if e>=d:
  print(d)
elif d>e:
  print(e)
x = list(range(1, int(input())+1)
x_odds = list(filter(lambda xx: xx % 2 == 1, x))
print(float(len(x_odds) / len(x))

### FIXED CODE ###

x = int(input())
x_all = list(range(1, x+1))
x_odds = list(filter(lambda xx: xx % 2 == 1, x_all))
print(float(len(x_odds)) / len(x_all))
A = input()
ans = 1
for i in range(len(A)):
  for j in range(len(j,A)):
    if A[i] != A[j]:
      ans += 1
      
print(ans)

### FIXED CODE ###

A = input()

Alphabet = list("abcdefghijklmnopqrstuvwxyz")

N = len(A)
ans = N*(N-1)/2 + 1

for i in Alphabet:
  z = 0
  for j in range(len(A)):
    if i == A[j]:
      z+=1
  if z>1:
    ans -= z*(z-1)/2
    
print(int(ans))
N = int(input())
lst = list(map(int, input().split()))

dic1, dic2 = dict(), dict()
for i, x in enumerate(lst):
    dic = dic1 if  i%2 == 0 else dic2
    if x not in dic.keys():
        dic[x] = 1
    else:
        dic[x] += 1
#print (type(dic1))
dic1 =sorted(dic1.items(), key = lambda x:x[1])[::-1]
dic2 =sorted(dic2.items(), key = lambda x:x[1])[::-1]

#print (type(dic2))
#print (dic1)
#print (dic2)

if dic1[0][0] != dic2[0][0]:
    print (N-dic1[0][1]-dic2[0][1])
elif len(dic1) == 1 and len(dic2) == 1:
    print (n//2)
elif len(dic1) == 1:
    print (N-dic1[0][1]-dic2[1][1])
elif len(dic2) == 1:
    print (N-dic1[1][1]-dic2[0][1])
else:
    print (max(N-dic1[0][1]-dic2[1][1], N-dic1[1][1]-dic2[0][1]))


### FIXED CODE ###

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

dic1, dic2 = dict(), dict()
#dic1[0] = 0
#dic2[0] = 0
for i, x in enumerate(lst):
    dic = dic1 if  i%2 == 0 else dic2
    if x not in dic.keys():
        dic[x] = 1
    else:
        dic[x] += 1
#print (type(dic1))
dic1 =sorted(dic1.items(), key = lambda x:x[1])[::-1]
dic2 =sorted(dic2.items(), key = lambda x:x[1])[::-1]

#print (type(dic2))
#print (dic1)
#print (dic2)

if dic1[0][0] != dic2[0][0]:
    print (N-dic1[0][1]-dic2[0][1])
elif len(dic1) == 1 and len(dic2) == 1:
    print (N//2)
elif len(dic1) == 1:
    print (N-dic1[0][1]-dic2[1][1])
elif len(dic2) == 1:
    print (N-dic1[1][1]-dic2[0][1])
else:
    print (min(N-dic1[0][1]-dic2[1][1], N-dic1[1][1]-dic2[0][1]))
N = int(input())
p = list(map(int,input().split()))

ans = 0

for i in range(N):
    if i+1 == p[i]:
        p[i],p[i+1] = p[i+1],p[i]
        ans += 1
        
print(ans)

### FIXED CODE ###

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

ans = 0

for i in range(N):
    if i+1 == p[i] and i != N-1:
        p[i],p[i+1] = p[i+1],p[i]
        ans += 1
    elif i == N-1:
        if i+1 == p[i]:
            p[i],p[0] = p[0],p[i]
            ans += 1
        
print(ans)
A_count = int(input());
A = [int(n) for n in input().split()];
M_count = int(input());
M = [int(n) for n in input().split()];

memo = [[None for i in range(2000)] for j in range(A_count)];

def solve(start, target):
    if memo[start][target] is not None:
        return memo[start][target];
    if target == 0:
        return True;
    elif start >= A_count:
        return False;
    else:
        result = solve(start + 1, target) or solve(start + 1, target - A[start]);
        if result:
            memo[start][target] = True;
            return True;
        else:
            memo[start][target] = False;
            return False;

for m in M:
    if solve(0, m):
        print("yes");
    else:
        print("no");


### FIXED CODE ###

A_count = int(input());
A = [int(n) for n in input().split()];
M_count = int(input());
M = [int(n) for n in input().split()];

memo = [[None for i in range(2000)] for j in range(A_count + 1)];

def solve(start, target):
    if memo[start][target] is not None:
        return memo[start][target];
    if target == 0:
        return True;
    elif start >= A_count:
        return False;
    else:
        result = solve(start + 1, target) or solve(start + 1, target - A[start]);
        if result:
            memo[start][target] = True;
            return True;
        else:
            memo[start][target] = False;
            return False;

for m in M:
    if solve(0, m):
        print("yes");
    else:
        print("no");