Harryxun/stf_run huggingface dataset:
S = input()
T = input()
tmp = ''
res = ''

count = 0
for i in range(len(S) - len(T) + 1):
    for j in range(len(T)):
        start = i
        end = i + j
        if S[i+j] == T[j]:
            flag = 1
        elif S[i+j] == '?':
            flag = 0
        else:
            start = 0
            end = 0
            flag = -1
            break
    if flag == 1:
        break
            
if flag == -1:
    print('UNRESTORABLE')
    
else:
    j = 0
    for i in range(len(S)):
        if start <= i <= end:
            res += T[j]
            j += 1

        elif S[i] == '?':
            res += 'a'

        else:
            res += S[i]

    print(res)

### FIXED CODE ###

S = input()
T = input()


    
if True:
    tmp = -1
    for i in range(len(S) - len(T) + 1):
        start = -1
        for j in range(len(T)):
            if S[i+j] == T[j] or S[i+j] == '?':
                start = i
            else:
                start = -1
                break
                
        
        if start != -1:
                tmp = i
    if tmp == -1:
        print('UNRESTORABLE')
    else:
        res = ''
        count = 0
        for i in range(len(S)):
            if tmp <= i < tmp + len(T):
                res += T[count]
                count += 1
            elif S[i] == '?':
                res += 'a'
            else:
                res += S[i]

        print(res)
s = input()
g1 = set("abcdefghijklmnopqrstuvwxyz")
g2 = set(s)
a = g1 -g2
print(sorted(list(a))[0])

### FIXED CODE ###

s = input()
g1 = set("abcdefghijklmnopqrstuvwxyz")
g2 = set(s)
a = g1 -g2
if a == set():
    print('None')
    

else:
    print(sorted(list(a))[0])
import numpy as np

n = int(input())
array = np.array(list(map(int, input().strip().split())))

print(max([np.gcd.reduce(array[[i for i in range(n) if i != j]]) for j in range(n)]))


### FIXED CODE ###

from fractions import gcd

n = int(input())
list_ = list(map(int, input().strip().split()))

gcd_from_left = [0]
gcd_from_right = [0]
for i in range(n):
    gcd_from_left.append(gcd(gcd_from_left[i], list_[i]))
    gcd_from_right.append(gcd(gcd_from_right[i], list_[-(i + 1)]))

gcd_from_left.insert(0, 0)
gcd_from_right.insert(0, 0)
gcd_from_right.reverse()

print(max(gcd(gcd_from_left[i], gcd_from_right[i]) for i in range(n + 2)))
n = int(input())
P = list(map(int, input().split()))


count = 0
for i in range(n):
  for j in range(i):
    if p[i] > p[j]:
      break
  else:
    count+=1
    continue
print(count)

### FIXED CODE ###

n = int(input())
p = list(map(int, input().split()))
#n = 5
#p = [4,2,5,1,3]

count = 0
temp_min = p[0]
for i in range(n):
  if temp_min >= p[i]:
        count+=1
        temp_min = p[i]
print(count)
n,q=map(int,input().split())

l=[list() for i in range(n)]
s=[0]*n
c=[0]*n

def ladd(p,q):
  s[p]+=q
  for i in l[p]:
    ladd(i,q)

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

for i in range(q):
  p,q=map(int,input().split())
  c[p-1]+=q

for i in range(n):
  ladd(i,c[i])

for i in range(n):
  print(s[i],' ',end="")
print()


### FIXED CODE ###

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

n,q=map(int,input().split())
t=[[] for _ in range(n)]
c=[0 for _ in range(n)]

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

for i in range(q):
  p,x=map(int,input().split())
  c[p-1]+=x

def dsf(ci,pi):
  for i in t[ci]:
    if i != pi:
      c[i] += c[ci]
      dsf(i, ci)

dsf(0,-1)

print(*c)
N = int(input())
P = list(map(int, input().split()))

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


### FIXED CODE ###

N = int(input())
P = list(map(lambda a: int(a) - 1, input().split()))

ans = 0
for i in range(N):
    p = P[i]
    if p == i:
        if i < N - 1:
            P[i], P[i + 1] = P[i + 1], P[i]
        ans += 1

print(ans)
S, T = input().split()
A, B = map(int,input().split)
U = input()
 
if S == U:
    print(A-1 , B)
else:
    print(A , B-1)

### FIXED CODE ###

S, T = input().split()
A, B = map(int,input().split())
U = input()
 
if S == U:
    print(A-1 , B)
else:
    print(A , B-1)
import sys
N = int(input().strip())
grid = []
ref = 0
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
    if array[2]>0:
      ref = i
x = 0
y = 0
while y <= 100:
  x = 0
  while x <= 100:
    h0 = grid[ref][2]+abs(x-grid[ref][0])+abs(y-grid[ref][1])
    for arrays in grid:
      h = h0-abs(x-arrays[0])-abs(y-arrays[1])
      if h != arrays[2]:
        break
    print(x,y,h0)
      sys.exit()
    x += 1
  y += 1

### FIXED CODE ###

import sys
N = int(input().strip())
grid = []
ref = 0
for i in range(N):
    array = list(map(int, input().strip().split(' ')))
    grid.append(array)
    if array[2]>0:
      ref = i
x = 0
y = 0
while y <= 100:
  x = 0
  while x <= 100:
    flag = 0
    h0 = grid[ref][2]+abs(x-grid[ref][0])+abs(y-grid[ref][1])
    for arrays in grid:
      h = max(0,h0-abs(x-arrays[0])-abs(y-arrays[1]))
      if h != arrays[2]:
        flag = 1
    if flag == 0:
      print(x,y,h0)
      sys.exit()
    x += 1
  y += 1
n=raw_input()
A=map(int, raw_input().split())
q=raw_input()
m=map(int, raw_input().split())

def solve(c, m):
  if m == 0:
    return 1
  if c >= n or sum(A)<m:
    return 0
  res = solve(c + 1, m) or solve(c + 1, m - A[c])
  return res

for i range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"

### FIXED CODE ###

n=int(raw_input())
A=map(int, raw_input().split())
q=int(raw_input())
m=map(int, raw_input().split())

def solve(j, m):
  if m == 0:
    return 1
  if j >= n or m > sum(A):
    return 0
  res = solve(j + 1, m) or solve(j + 1, m - A[j])
  return res

for i in range(0,q):
  if solve(0,m[i]):
    print "yes"
  else:
    print "no"
from colloctions import Counter
from scipy import gcd
 
def sum_of_gcd(N):
  temp = [gcd(i, k) for i in range(1, N+1) for k in range(1, N+1)]
  counts = Counter(temp)
  return sum([gcd(i, c)*counts[c] for i in range(1, N+1) for c in counts.keys()])
 
print(sum_of_gcd(int(input())))

### FIXED CODE ###

from scipy import gcd
from collections import Counter

def sum_of_gcd(N):
    temp = [gcd(i, k) for i in range(1, N+1) for k in range(1, N+1)]
    counts = Counter(temp)

    return sum([gcd(c, i)*counts[c] for i in range(1, N+1) for c in counts.keys()])

print(sum_of_gcd(int(input())))
class Node:
    def __init__(self, parent, left, right):
        self.parent = parent
        self.left = left
        self.right = right

    def get_type(self):
        if self.parent == -1: return "root"
        elif self.left == -1: return "leaf"
        else: return "internal node"

def set_depth(u,d):
    global D
    global tree
    D[u] = d
    while not tree[u].right == -1:
        u = tree[u].right
        D[u] = d
    if not tree[u].left == -1:
        set_depth(tree[u].left, d+1)

def print_tree(t,D):
    for i in range(len(t)):
        children = []
        c = t[i].left
        if not c == -1:
            while True:
                children.append(c)
                c = t[c].right
                if c == -1: break
        print "node %s: parent = %s, depth = %s, %s, [%s]" % (i, t[i].parent, D[i], t[i].get_type(), ", ".join(map(str, children)))

n = int(raw_input().strip())

tree = {}
for i in range(n):
    tree[i] = Node(-1, -1, -1)
for _ in range(n):
    entry = map(int, raw_input().strip().split(' '))
    nid = entry[0]
    n_child = entry[1]
    for i in range(n_child):
        if i == 0: tree[nid].left = entry[i+2]
        else: tree[entry[i+1]].right = entry[i+2]
        tree[entry[i+2]].parent = nid

r = -1
for i in range(n):
    if tree[i].parent == -1: r = i

D = {}
set_depth(r, 0)

print_tree(tree, D)

### FIXED CODE ###

class Node:
    def __init__(self, parent, left, right):
        self.parent = parent
        self.left = left
        self.right = right

    def get_type(self):
        if self.parent == -1: return "root"
        elif self.left == -1: return "leaf"
        else: return "internal node"

def set_depth(u,d):
    global D
    global tree
    D[u] = d
    v = tree[u].right
    while not v == -1:
        D[v] = d
        if not tree[v].left == -1:
            set_depth(tree[v].left, d+1)
        v = tree[v].right
    if not tree[u].left == -1:
        set_depth(tree[u].left, d+1)

def print_tree(t,D):
    for i in range(len(t)):
        children = []
        c = t[i].left
        if not c == -1:
            while True:
                children.append(c)
                c = t[c].right
                if c == -1: break
        print "node %s: parent = %s, depth = %s, %s, [%s]" % (i, t[i].parent, D[i], t[i].get_type(), ", ".join(map(str, children)))

n = int(raw_input().strip())

tree = {}
for i in range(n):
    tree[i] = Node(-1, -1, -1)
for _ in range(n):
    entry = map(int, raw_input().strip().split(' '))
    nid = entry[0]
    n_child = entry[1]
    for i in range(n_child):
        if i == 0: tree[nid].left = entry[i+2]
        else: tree[entry[i+1]].right = entry[i+2]
        tree[entry[i+2]].parent = nid

r = -1
for i in range(n):
    if tree[i].parent == -1: r = i

D = {}
set_depth(r, 0)

print_tree(tree, D)
a = input()
b = input()
#a,b=1,2
all = [1,2,3]
#result = next(filter(lambda x: x in [a,b], all))
result = filter(lambda x: not x in [a,b], all)
print(result[0])


### FIXED CODE ###

a, b = input(), input()
#a,b=2,3
a,b= [int(i) for i in [a,b]]
all = [1,2,3]
result = list(filter(lambda x: not x in [a,b], all))
print(result[0])
s = list(input())
al = "abcdefghijklmnopqrstuvwxyz"
al = list(al)
li = []
for i in range(len(al)):
    if (al[i] not in s):
        li.append(al[i])
        
li.sort()
print(li[0])

### FIXED CODE ###

s = list(set(list(input())))
a = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
li = []
for i in range(len(a)):
  if a[i] not in s:
    li.append(a[i])
if len(li) == 0:
    print("None")
else:
    print(min(li))
import numpy as np
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  print(0)
prod = 1
for i in range(n):
  prod *= a[i]
  if prod >= 10 ** 18:
    print(-1)
  	exit()
print(prod)

### FIXED CODE ###

import numpy as np
n = int(input())
a = list(map(int, input().split()))
if 0 in a:
  print(0)
  exit()
prod = 1
for i in range(n):
  prod *= a[i]
  if prod > 10 ** 18:
    print(-1)
    exit()
print(prod)
n = input()
j = 0
for i in range(n):
  j = j + i
  
print(j)

### FIXED CODE ###

n = int(input())
j = 0
for i in range(n+1):
  j = j + i
  
print(j)
x = input()
y = input()
print("YES" if x=y[::-1] else "NO")

### FIXED CODE ###

c1 = list(input())
c2 = list(input())

if c1==c2[::-1]:
  print("YES")
else:
  print("NO")
a=input()
if a="ABC":
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

a=input()
if a=="ABC":
  print("ARC")
else:
  print("ABC")
import sys
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())

n = ni()

a = [ni() for _ in range(n)]
count = 0
nexti = 0
for i in range(n):
    if nexti == 1:
        print(count)
        exit()
    else:
        nexti = a[a[nexti] - 1]
        count += 1
print(-1)

### FIXED CODE ###

import sys
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())

n = ni()

a = [ni() for _ in range(n)]
count = 0
nexti = 0
for i in range(n):
    if nexti == 1:
        print(count)
        exit()
    else:
        nexti = a[nexti] - 1
        count += 1
print(-1)
N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  x = sum(list(map(int, str(i))))
  if A <= X <= B:
    ans += i
print(ans)

### FIXED CODE ###

N, A, B = map(int, input().split())
ans = 0
for i in range(1, N+1):
  x = sum(list(map(int, str(i))))
  if A <= x <= B:
    ans += i
print(ans)
k, x = map(int, input().split())
print("Yes") if 500*k >= x, else print("No")

### FIXED CODE ###

k, x = map(int, input().split())
print("Yes") if 500*k >= x else print("No")
N = int(input())
v = list(map(int,input().split()))

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(n-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)


### FIXED CODE ###

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

v.sort(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)
n = input('')
i == ''

if i == 1:
  i = 9
elsif i == 9:
  i = 1
  
print(n)

### FIXED CODE ###

s = input()

r = ""
for i in s:
  if i =='1':
    r += '9'
  else:
    r += '1'
print(r)
K = input()
S = input()
count = 0

for x in range(K):
  for y in range(K):
    z = S - x - y
    if 0=< z and z =< K:
      count += 1
      
print(count)
      

### FIXED CODE ###

K, S = map(int, input().split())
count = 0
 
for x in range(K+1):
  for y in range(K+1):
    z = S - x - y
    if 0 <= z and z <= K:
    	count += 1
print(count)
ans = [int(input()) for _ range(6)]
print(':(' if abs(ans[0]-ans[4]) <= ans[-1] else 'Yay!')

### FIXED CODE ###

ans = [int(input()) for _ in range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')
n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 10001
for i in a:
    e[i] += 1
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
q = int(input())
bc = [list(map(int, input().split())) for _ in range(q)]
s = 0
for g in range(len(a)):
    s += a[g]
e = [0] * 100001
for i in a:
    e[i] += 1
for j in range(q):
    s += (bc[j][1] - bc[j][0]) * e[bc[j][0]]
    e[bc[j][1]] += e[bc[j][0]]
    e[bc[j][0]] = 0
    print(s)
xyzk_, a_, b_, c_ = [input() for _ in range(4)]

x, y, z, k = [int(w) for w in xyzk_.split()]
a_nums = [int(n) for n in a_.split()]
b_nums = [int(n) for n in b_.split()]
c_nums = [int(n) for n in c_.split()]

a_nums.sort(reverse=True)
b_nums.sort(reverse=True)
c_nums.sort(reverse=True)

p, q, r = 0, 0, 0
now = a_nums[p] + b_nums[q] + c_nums[r]

while (p+1) * (q+1) * (r+1) < k:
    if a_nums[p+1] >= max(b_nums[q+1], c_nums[r+1]):
        p += 1
    elif b_nums[q + 1] >= c_nums[r + 1]:
        q += 1
    else:
        r += 1

a_nums = a_nums[:p]
b_nums = b_nums[:q]
c_nums = c_nums[:r]

sums.sort(reverse=True)

sums = []
for a in a_nums:
    for b in b_nums:
        for c in c_nums:
            sums.append(a + b + c)

for n in sums[:k]:
    print(n)


### FIXED CODE ###

xyzk_, *nums_ = [input() for _ in range(4)]

*le, k = [int(w) for w in xyzk_.split()]
abc = [sorted((int(n) for n in w.split()), reverse=True) for w in nums_]

p = [0, 0, 0]
pool = [0, sum(abc[i][p[0]] for i in range(3))]
for _ in range(k):
    max_pool = max(pool)
    max_t = 0
    for i in range(3):
        if p[i] + 1 == le[i]:
            continue
        t = abc[i][p[i] + 1] + abc[(i + 1) % 3][0] + abc[(i + 2) % 3][0]
        if t > max_t:
            max_t = t
            max_3 = i
    if max_pool < max_t:
        p[max_3] = min(p[max_3] + 1, le[max_3] - 1)
        j, k = (max_3 + 1) % 3, (max_3 + 2) % 3
        for n1 in abc[j][:p[j] + 1]:
            for n2 in abc[k][:p[k] + 1]:
                pool.append(n1 + n2 + abc[max_3][p[max_3]])
    print(pool.pop(pool.index(max(pool))))
#D問題
N,C = map(int,input().split())
D = [list(map(int,input().split())) for i in range(C)]
c = [list(map(int,input().split())) for i in range(N)]
for i in range(N):
    for j in range(N):
        c[i][j]-=1
    

mod3 = [[0 for i in range(C)] for j in range(3)]
for i in range(N):
    for j in range(N):
        mod3[(i+j)%3][c[i][j]]+=1
        
c3 = [[0 for i in range(3)] for j in range(3)]
for i in range(3):
    for j in range(C):
        kari = 0
        for k in range(C):#kからjへ
            kari+=mod3[i][k]*D[k][j]
        c3[i][j] = kari
        
inf = float("inf")
MIN = inf
for i in range(C):
    C1 = c3[0][i]
    for j in range(C):
        if j != i:
            C2 = c3[1][j]
            for k in range(C):
                if k != i and k != j:
                    C3 = c3[2][k]
                    MIN = min(MIN,C1+C2+C3)
                    #print(C1,C2,C3)

print(MIN)


### FIXED CODE ###

#D問題
N,C = map(int,input().split())
D = [list(map(int,input().split())) for i in range(C)]
c = [list(map(int,input().split())) for i in range(N)]
for i in range(N):
    for j in range(N):
        c[i][j]-=1
    

mod3 = [[0 for i in range(C)] for j in range(3)]
for i in range(N):
    for j in range(N):
        mod3[(i+j)%3][c[i][j]]+=1
        
c3 = [[0 for i in range(C)] for j in range(3)]
for i in range(3):
    for j in range(C):
        kari = 0
        for k in range(C):#kからjへ
            kari+=mod3[i][k]*D[k][j]
        c3[i][j] = kari
        
inf = float("inf")
MIN = inf

for i in range(C):
    C1 = c3[0][i]
    for j in range(C):
        if j != i:
            C2 = c3[1][j]
            for k in range(C):
                if k != i and k != j:
                    C3 = c3[2][k]
                    MIN = min(MIN,C1+C2+C3)
                    #print(C1,C2,C3)
                
if MIN != inf:
    print(MIN)
else:
    print(0)
[n], *e = [[*map(int, t.split())] for t in open(0)]
ans = 0
mod = 10 ** 9 + 7
slope_dict = {}
for x, y in e:
    a = 2**slope_dict.get(x/y, 0)
    b = 2**slope_dict.get(-y/x, 0)
    ans = ((ans * (2 * a + b - 1) + a)/(a + b - 1)) % mod
    slope_dict[x/y] = slope_dict.get(x/y, 0) + 1

print(int(ans))

### FIXED CODE ###

from math import gcd
from collections import defaultdict
mod = 10**9+7
_, *S = open(0)
mp = defaultdict(lambda: [0, 0])
O = 0
for s in S:
    a, b = map(int, s.split())
    if a == b == 0:
        O += 1
    else:
        g = gcd(a, b)
        a //= g
        b //= g
        if a < 0 or a == 0 < b:
            a, b = -a, -b
        f = 0
        if b < 0:
            a, b, f = -b, a, 1
        mp[(a, b)][f] += 1
ans = 1
for k in mp:
    x, y = mp[k]
    ans = ans*(pow(2, x, mod)+pow(2, y, mod)-1) % mod
print((ans+O-1) % mod)
N, A, B = (int(x) for x in input().split)
if(N * A > B):
  print(N * A)
else:
  print(B)

### FIXED CODE ###

N, A, B = (int(x) for x in input().split())
if(N * A < B):
  print(N * A)
else:
  print(B)
pronunciation = {0: 'pon', 1: 'pon', 2: 'hon', 3: 'bon', 4: 'hon', 5: 'hon', 6: 'pon', 7: 'hon', 8: 'pon', 9: 'hon'}
input = input()
if len(input) > 1:
  input = int(input[-1])
print(pronunciation[input])


### FIXED CODE ###

pronunciation = {0: 'pon', 1: 'pon', 2: 'hon', 3: 'bon', 4: 'hon', 5: 'hon', 6: 'pon', 7: 'hon', 8: 'pon', 9: 'hon'}
input = input()
if len(input) > 1:
  input = int(input[-1])
if type(input) != int:
    input = int(input)
print(pronunciation[input])
S=input()
T=input()

if S.sort()==T.sort():
	print("Yes")
else:
	print("No")

### FIXED CODE ###

S=input()
T=input()
for i in range(len(S)):
	S=S[-1]+S[0:-1]
	if S==T:
		print("Yes")
		exit()
print("No")
import sys
import math
import time
sys.setrecursionlimit(int(1e6))
if False:
    dprint = print
else:
    def dprint(*args):
        pass

n, q = list(map(int, input().split()))
c = list(map(int, input().split()))

c_d = [0] * n
col_i = [-1] * n
for i in range(q):
    col = c[i] - 1
    c_d[i] = col_i[col]
    col_i[col] = i

for i in range(q):
    l, r = list(map(int, input().split()))
    l -= 1
    r -= 1
    dup = 0
    for j in range(l, r+1):
        if (l <= c_d[j]) and (c_d[j] <= r):
            dup += 1
    ans = r - l + 1 - dup
    print(ans)


### FIXED CODE ###


import sys
import math
import time
sys.setrecursionlimit(int(1e6))
if False:
    dprint = print
else:
    def dprint(*args):
        pass

class BIT:
    def __init__(self, n=0):
        self.n = n
        self.d = [0] * (n+1)
    
    def add(self, i, x=1):
        i = int(i+1) # index begin 1
        while i <= self.n:
            self.d[i] += x
            i += i&-i # add LSB
    
    def sum(self, i=None):
        x = 0
        i = int( i+1 if not (i is None) else self.n )
        while i > 0:
            x += self.d[i]
            i -= i&-i # sub LSB
        return x

n, q = list(map(int, input().split()))
c = list(map(int, input().split()))
dprint("n, q =", n, q)
dprint("c =", c)

# check colors pair index (s,t)
st = [0] * (n+1)
col_last = [0] * (n+1)
for i in range(n):
    t = i + 1
    col = c[i]
    s = col_last[col]
    if s > 0:
        st[s] = t
    col_last[col] = t
dprint("st =", st)

# input querys (l,r)
lr = [None] * n
qs = list()
sorted_qs = list()
for i in range(q):
    l, r = list(map(int, input().split()))
    qs.append((i,l,r)) 
sorted_qs = sorted(qs, key=lambda q: q[1], reverse=True)
dprint("qs =", qs)
dprint("sorted_qs =", sorted_qs)

i_qs = 0
x = n
d = BIT(n+1)
qs_ans = [0] * len(qs)
for i_qs in range(len(sorted_qs)):
    i, l, r = sorted_qs[i_qs]
    dprint("i, l, r", i, l, r)
    while (x >= l):
        if st[x] > 0:
            d.add(st[x])
            dprint("add x(s), t =", x, st[x])
        x -= 1
    qs_ans[i] = (r-l+1)-d.sum(r)

for ans in qs_ans:
    print(ans)
# -*- coding: utf-8 -*-
s = input()

for i in range(0,len(s)):
  if (i%2==1)and(s[i]=="L"):
    print("No")
    exit()
  elif (i%2==0)s[i]=="R":
    print("No")
    exit()
print("Yes")

### FIXED CODE ###

# -*- coding: utf-8 -*-
s = input()

for i in range(0,len(s)):
  if (i%2==0)and(s[i]=="L"):
    print("No")
    exit()
  elif (i%2==1)and(s[i]=="R"):
    print("No")
    exit()
print("Yes")
str = input()

if (str == 'A'):
  print('T')
else if (str == 'T'):
  print('A')
else if (str == 'C'):
  print('G')
else:
  print('C')

  


### FIXED CODE ###

str = input()
 
if str == 'A':
  print('T')
elif str == 'T':
  print('A')
elif str == 'C':
  print('G')
else:
  print('C')
nums = map(int, raw_input().split(""))
print sum(nums)

### FIXED CODE ###

nums = map(int, raw_input().split())
a = max(nums)
b = min(nums)
ans = a + max(a - 1, b)
print ans
if k==1:
    return 0
else:
    return n-k

### FIXED CODE ###

n,k= [int(i) for i in input().split()]
if k==1:
    print (0)
else:
    print (n-k)
A1=int(input())
A2= int(input())
A3= int(input())
if(A1+A2+A3>=22):
    print("bust")
else:
    print("win")

### FIXED CODE ###

a = [int(x) for x in input().split(" ")]
print("bust") if sum(a) >= 22 else print("win")
N=input()
S=input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'

for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
print(hoge)      

### FIXED CODE ###

N = int(input())
S = input()
hoge=[]
Alphas='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
 
for a in S:
  for i, Alpha in enumerate(Alphas):
    if Alpha == a:
      hoge.append(Alphas[(i+N)%26])
      break
mojiretsu=''
for x in hoge:
    mojiretsu += x
print(mojiretsu)
n = int(input())
a = [input() for i in range(n)]
m = int(input())
b = [input() for i in range(m)]
min = 0
for i in range(n+1):
    max = a.count(a[i])-b.count(a[i])
    if max >= min:
        min = max
    else:
        pass
print(max)

### FIXED CODE ###

n = int(input())
a = [input() for i in range(n)]
m = int(input())
b = [input() for i in range(m)]
min = 0
for i in range(n):
    max = a.count(a[i])-b.count(a[i])
    if max >= min:
        min = max
    else:
        pass
print(min)
N = int(input())
A = [int(a) for a in input().split()]
cnt = {}
total = 0

for a in A:
    if a not in cnt:
        cnt[a] = 0
    cnt[a] += 1

for i in cnt.values():
    total += i * (i - 1) // 2

for i in range(N):
    print(total - (cnt[i] - 1))


### FIXED CODE ###

N = int(input())
A = [int(a) for a in input().split()]
cnt = {}
total = 0

for a in A:
    if a not in cnt:
        cnt[a] = 0
    cnt[a] += 1

for i in cnt.values():
    total += i * (i - 1) // 2

for a in A:
    print(total - (cnt[a] - 1))
import math
A = int(input())
a = a * 2 * math.pi
print(a)

### FIXED CODE ###

import math
A = int(input())
a = A * 2 * math.pi
print(a)