Harryxun/stf_run huggingface dataset:
S = input()
t = input()

tmp1 = 0
tmp2 = 0
res = ''
flag = False
for i in range(len(S) - len(t)+1):
    h = True
    for j in range(len(t)):
        if S[i+j] != t[j]:
            h = False
    if h == True:
        flag = True
        break
        
if h != True:
            
    while True:
        if S[-tmp1 - 1] == t[-tmp2 - 1]  or S[-tmp1 - 1] == '?':
            res = t[-tmp2 - 1] + res
            tmp1 += 1
            tmp2 += 1
        else:
            #tmp1 += 1
            tmp2 = 0
            res = ''


        if tmp2 == len(t):
            flag = True
            break

        if tmp1 == len(S):
            break
      
tmp3 = ''
k = 0
for i in range(len(S)):
    if len(S) - tmp1 <= i < len(S) - tmp1 + len(t):
        tmp3 += t[k]
        k += 1
    elif S[i] == '?':
        tmp3 += 'a'
    else:
        tmp3 += S[i]
        
res = tmp3 
 
if flag:
    print(res)
else:
    print('UNRESTORABLE')


### 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)
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if i % 2 == n & 2:
		b.insert(0, a[i])
	else:
		b.append(a[i])

for x in b:
	print(x, end=' ')
print()

### FIXED CODE ###

from collections import deque
d = deque()
n = int(input())
a = input().split()

for i in range(n):
	if i % 2 == n % 2:
		d.append(a[i])
	else:
		d.appendleft(a[i])

print(' '.join(d))
(A, B, C) = int(input().split())

if A + B + C >= 22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

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

if A + B + C >= 22:
  print("bust")
else:
  print("win")
s = raw_input()
if(s == 'AAA' or s == 'BBB'):
    print("No")
else:
    print("Yes")    


### FIXED CODE ###

s = input()
if(s == 'AAA' or s == 'BBB'):
    print("No")
else:
    print("Yes")
X, Y = map(int, input())

print(X + int(Y / 2))

### FIXED CODE ###

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

print(X + int(Y / 2))
a=raw_input()
for k in range(len(a)//3,0,-1):
	joi="J"*k+"O"*k+"I"*k
	if joi in a:
		print k
		break
else:
	print 0

### FIXED CODE ###

a=raw_input()
l=len(a)
i=ans=0
while i<l:
	lenj=leno=leni=0
	while i<l and a[i]=="J":
		lenj+=1
		i+=1
	while i<l and a[i]=="O":
		leno+=1
		i+=1
	while i<l and a[i]=="I":
		leni+=1
		i+=1
	if lenj>=leno and leni>=leno:
		ans=max(ans,leno)
print ans
input_n = input()
n = str(input_n)

listN = list(n)
#listN = n.split(' ')

if listN[len(listN)] = "s":
    listN.append("e")
    listN.append("s")
else:
    listN.append("s")

for i in range(len(listN)):
    print(listN[i], end = "")


### FIXED CODE ###

input_n = input()
n = str(input_n)

listN = list(n)
#listN = n.split(' ')

if listN[len(listN) - 1] == "s":
    listN.append("e")
    listN.append("s")
else:
    listN.append("s")

for i in range(len(listN)):
    print(listN[i], end = "")
A,B=input().split()
print(int(A)*int(B.replace(".", ""))//100)

### FIXED CODE ###

from sys import stdin
N = stdin.readline().rstrip()
An = [int(x) for x in stdin.readline().rstrip().split()]
W = 1
if any([A == 0 for A in An]):
    print(0)
    exit()
for A in An:
    W = W * A
    if 1000000000000000000 < W:
        print(-1)
        exit()
print(W)
a,b,c=map(int,input().split());lis=[a,b]
for i in range(c):
    if lis[i%2]%2==1:lis[i%2]-=1
    lis[(i+1)%2]+=lis[i%2]/2;lis[i%2]/=2
print(int(lis[0]),int(lis[1]))

### FIXED CODE ###

a = input();print("".join(reversed(a)) if len(a) == 3 else a)
#ABC147 C
    si = lambda: input()
    ni = lambda: int(input())
    nm = lambda: map(int, input().split())
    nl = lambda: list(map(int, input().split()))
    n=int(input())
    shogen=[]
    for _ in range(n):
    a=int(input())
    t=[]
    for __ in range(a):
        s=list(map(int,input().split()))
        t.append(s)
    shogen.append(t)

    ans=0

    for i in range(2**n):
    flag=True
    for j in range(n):
        if not flag:
        break
        if ((i>>j) & 1):
        for s in shogen[j]:
            if ((i>>s[0]-1)&1) !=s[1]:
            flag=False
    if flag:
        mnt = bin(i).count("1")
        ans=max(ans,mnt)
    print(ans)



### FIXED CODE ###

#ABC147 C
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))
n=int(input())
shogen=[]
for _ in range(n):
    a=int(input())
    t=[]
    for __ in range(a):
        s=list(map(int,input().split()))
        t.append(s)
    shogen.append(t)

ans=0

for i in range(2**n):
    flag=True
    for j in range(n):
        if not flag:
            break
        if ((i>>j) & 1):
            for s in shogen[j]:
                if ((i>>s[0]-1)&1) !=s[1]:
                    flag=False
    if flag:
        mnt = bin(i).count("1")
        ans=max(ans,mnt)
print(ans)
import math

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

def andiv(A,N): #N以下でAで割り切れないものの数
    return((N//A)*(A-1)+N%A)

def lcm(a,b): #最小公倍数
    return(int((a*b / math.gcd(a,b))))

E = andiv(C,B) + andiv(D,B) - andiv(lcm(C,D),B)
F = andiv(C,A-1) + andiv(D,A-1) - andiv(lcm(C,D),A-1)

print(E-F)

### FIXED CODE ###

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

def andiv(M,N):
    return((N//M) * (M-1) + N%M)

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

def lcm(a,b):
    return(a*b // gcd(a,b))

E = andiv(C,B) + andiv(D,B) - andiv(lcm(C,D),B)
F = andiv(C,A-1) + andiv(D,A-1) - andiv(lcm(C,D),A-1)

print(int(E-F))
]
print("ABC")if s=="R" else print("ARC")

### FIXED CODE ###

s=input()[1]
print("ABC")if s=="R" else print("ARC")
strS = input()
strT = input()

maxRange = 0
l = 0
while l <= (len(strS)-len(strT)):
    m = 0
    count = 0
    while m < (len(strT)):
        if strS[l+m] != strT[m]:
            count += 1
        m += 1
    if maxRange > count:
        maxRange = count
    l += 1

print(maxRange)





### FIXED CODE ###

dts = input().split()
D = int(dts[0])
T = int(dts[1])
S = int(dts[2])

if T*S >= D:
    print("Yes")
else:
    print("No")
a,b=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

count=1
for i in range(i,a):
  for j in range(i+1,a):
    t=0
    for k in range(b):
      t += (x[i][k]-x[j][k])**2
    t = t**(1/2)
    if t.is_integer():
      count += 1
print(count)
    

### FIXED CODE ###

n,b=map(int,input().split())
x=[list(map(int,input().split())) for i in range(n)]

count=0
for i in range(n):
  for j in range(i+1,n):
    t=0
    for k in range(b):
      t += (x[i][k]-x[j][k])**2
    t = t**(1/2)
    if t.is_integer():
      count += 1
print(count)
from collections import defaultdict

MOD = 1000000007
iist = lambda: map(int,input().split())

N,M = iist()
Q = defaultdict(list)
for i in range(M):
  l,r,x = iist()
  Q[r].append((l,x))

if any(x != 1 for l,x in Q[1]):
  print(0)
  exit(0)

dp = defaultdict(int)
dp[0,0] = 3

x_sum = [3]
y_sum = [3]
s = 3

for pk in range(1,N):
  k = pk+1

  dp.update(((i,pk),s%MOD) for i,s in enumerate(map(sum, zip(x_sum,y_sum))))

  for i in range(pk):
    x_sum[i] += dp[i,pk]
  x_sum.append(0)
  y_sum.append((2*s)%MOD)
  s *= 3

  removes = [(i,j) for i,j in dp.keys()
            if any(x != (l<=i)+(l<=j)+1 for l,x in Q[k])]

  for i,j in removes:
    c = dp[i,j]
    del dp[i,j]
    x_sum[i] -= c
    y_sum[j] -= c
    s -= c

  for i,j in range(pk):
    x_sum[i] %= MOD
    y_sum[i] %= MOD
  s %= MOD

print(s)

### FIXED CODE ###

from collections import defaultdict

MOD = 1000000007
iist = lambda: map(int,input().split())

N,M = iist()
Q = defaultdict(list)
for i in range(M):
  l,r,x = iist()
  Q[r].append((l,x))

if any(x != 1 for l,x in Q[1]):
  print(0)
  exit(0)

dp = defaultdict(int)
dp[0,0] = 3

x_sum = [3]
y_sum = [3]
s = 3

for pk in range(1,N):
  k = pk+1

  for i,(a,b) in enumerate(zip(x_sum,y_sum)):
    c = (a+b)%MOD
    dp[i,pk] = c
    x_sum[i] += c

  x_sum.append(0)
  y_sum.append((2*s)%MOD)
  s *= 3
  subQ = Q[k]

  for i,j in list(dp.keys()):
    for l,x in subQ:
      if x != (l<=i)+(l<=j)+1:
        c = dp[i,j]
        x_sum[i] -= c
        y_sum[j] -= c
        s -= c
        del dp[i,j]
        break

  for i in range(pk):
    x_sum[i] %= MOD
    y_sum[i] %= MOD
  s %= MOD

print(s)
a = list(map(int, input.split()))
res = 0

num = a.pop(0)

for i in range(num):
    if (i == 'BTC'):
        b = a[i-1] * 380000
        res += b
    else:
        res += a[i-1]

print(res) 

### FIXED CODE ###

a = int(input())

b = []

for i in range(a):
    b.append(input().split())

res = 0

for i in b:
    if (i[1] == 'BTC'):
        res += float(i[0])*380000
    else:
        res += int(i[0])

print(res)
n,m = map(int,input().split())
ac_list = [0]*n
wa_list = [0]*n
pena = 0
for i in range(m):
    p,s = input().split()
    if s == 'AC':
        if ac_list[int(p)-1] == 0:
            ac_list[int(p)-1] =1
            pena += wa_list[int(p)-1]
        
    if s == 'WA':
        if ac_list[int(p)-1] == 0:
            wa_list[int(p)-1] += 1
            
print('{0} {1}'.format(sum(ac_list) , pena)

### FIXED CODE ###

n,m = map(int,input().split())
ac_list = [0]*n
wa_list = [0]*n
pena = 0
for i in range(m):
    p,s = input().split()
    if s == 'AC':
        if ac_list[int(p)-1] == 0:
            ac_list[int(p)-1] =1
            pena += wa_list[int(p)-1]
        
    if s == 'WA':
        if ac_list[int(p)-1] == 0:
            wa_list[int(p)-1] += 1
            
print('{0} {1}'.format(sum(ac_list) , pena))
N=int(input())
num = list(map(int, input().strip().split()))

count = 0
for i in range(N-2):
    if((num[i]<num[i+1]<num[i+2])or(num[i]>num[i+1]>num[i+2])):
        count +=1
print(count)

### FIXED CODE ###

word = input()

while True:
    if(word[0]==word[1]):
        if((word[2]==word[3])and(word[0]!=word[2])):
            print("Yes")
            break
    if(word[0]==word[2]):
        if(word[1]==word[3])and(word[0]!=word[1]):
            print("Yes")
            break    
    if(word[0]==word[3]):
        if((word[1]==word[2])and(word[0]!=word[1])):
            print("Yes")
            break
    if((word[1]==word[2])and(word[0]==word[1])):
        print("No")
        break
    if((word[1]==word[3])and(word[0]==word[1])):
        print("No")
        break
    if((word[1]==word[3])and(word[2]==word[1])):
        print("No")
        break
    else:      
        print("No")
        break
X=input()
X=X-1
a=0
b=1
while b==1:
    X=X+1
    a=0
    for i in range(2,X):
        if X%i==0:
            a=a+1
    if a==0:
        print(X)
        break;


### FIXED CODE ###

X=int(input())
X=X-1
a=0
b=1
while b==1:
    X=X+1
    a=0
    for i in range(2,X):
        if X%i==0:
            a=a+1
    if a==0:
        print(X)
        break;
s = input()
alphabet = 'abcdefghijklmnopqrstuvwxyz'

s_list = set(s)
s_list = sorted(s_list)

if alphabet in s:
    print('None')
else:
    for i in range(len(s)):
        if s_list[i] != alphabet[i]:
            print(alphabet[i])
            break

### FIXED CODE ###

l=[chr(ord("a")+i) for i in range(26)]
s=set(input())
for i in s:
    l.remove(i)
print(l[0] if len(l)>0 else "None")
c = 0
try:
	while 1:
		s = raw_input()
		if s[::-1] == s:
			c += 1

print c
	

### FIXED CODE ###

c = 0
try:
	while 1:
		s = raw_input()
		if s[::-1] == s:
			c += 1
except:
	pass

print c
S, T = raw_input().split()
A, B = map(int, raw_input().split())
U = raw_input()


if S == U:
	A -= 1
elif T == U:
	B -= 1

print A, B

### FIXED CODE ###

S, T = raw_input().split()
A, B = map(int, raw_input().split())
U = raw_input()
if S == U:
	A -= 1
elif T == U:
	B -= 1
print A, B
N, M = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M)]
 
 
class UnionFind:
    def __init__(self, n):
        self.parents = [i for i in range(n)]
        self.sizes = [1] * n
    def find(self, i):
        parent = self.parents[i]
        if parent == i:
            return i
        else:
            return self.find(parent)
    def unite(self, i, j):
        pi = self.find(i)
        pj = self.find(j)
        self.sizes[pj] += self.sizes[pi]
        self.parents[pi] = pj 
 
def main():
    uf = UnionFind(N)
    p = N * (N - 1) // 2
    ans = [p]
    for x, y in reversed(ab):
        px = uf.find(x)
        py = uf.find(y)
        if px != py:
            p -= uf.sizes[px] * uf.sizes[py]
            uf.unite(px, py)
        ans.append(p)
 
    for a in reversed(ans[:-1]):
        print(a)
 
 
main()


### FIXED CODE ###

N, M = map(int, input().split())
ab = [tuple(map(lambda x:int(x)-1, input().split())) for _ in range(M)]
 
 
class UnionFind:
    def __init__(self,size):
        self.rank = [-1 for _ in range(size)]
        self.number = [1 for _ in range(size)]
 
    def find(self,x):
        while self.rank[x] >= 0:
            x = self.rank[x]
        return x
 
    def union(self,x,y):
        s1 = self.find(x)
        s2 = self.find(y)
        if s1 == s2:
            return
        if self.rank[s1] == self.rank[s2]:
            self.rank[s1] -= 1
            self.rank[s2] = s1
            self.number[s1] += self.number[s2]
        elif self.rank[s1] < self.rank[s2]:
            self.rank[s2] = s1
            self.number[s1] += self.number[s2]
        else:
            self.rank[s1] = s2
            self.number[s2] += self.number[s1]
 
 
def main():
    uf = UnionFind(N)
    p = N * (N - 1) // 2
    ans = [p]
    for x, y in reversed(ab):
        px = uf.find(x)
        py = uf.find(y)
        if px != py:
            p -= uf.number[px] * uf.number[py]
            uf.union(px, py)
        ans.append(p)
 
    for a in reversed(ans[:-1]):
        print(a)
 
 
main()
N, M, Q = map(int, input().split())
s = list(list(map(int, input().split())) for _ in range(Q))

mx = 0
a = [1]*10

for s1 in range(1, M+1):
    a[0] = s1
    for s2 in range(s1, M+1):
        a[1] = s2
        for s3 in range(s2, M+1):
            a[2] = s3
            for s4 in range(s3, M+1):
                a[3] = s4
                for s5 in range(s4, M+1):
                    a[4] = s5
                    for s6 in range(s5, M+1):
                        a[5] = s6
                        for s7 in range(s6, M+1):
                            a[6] = s7
                            for s8 in range(s7, M+1):
                                a[7] = s8
                                for s9 in range(s8, M+1):
                                    a[8] = s9
                                    for s10 in range(s9, M+1):
                                        a[9] = s10
                                        
                                        cnt = 0
                                        for i in range(Q):
                                            si = s[i]
                                            if a[si[1]] - a[si[0]] == si[2]:
                                                cnt += si[3]
                                            mx = max(mx, cnt)
                                            
print(mx)

### FIXED CODE ###

N, M, Q = map(int, input().split())
s = list(list(map(int, input().split())) for _ in range(Q))

mx = 0
a = [1]*10

for s1 in range(1, M+1):
    a[0] = s1
    for s2 in range(s1, M+1):
        a[1] = s2
        for s3 in range(s2, M+1):
            a[2] = s3
            for s4 in range(s3, M+1):
                a[3] = s4
                for s5 in range(s4, M+1):
                    a[4] = s5
                    for s6 in range(s5, M+1):
                        a[5] = s6
                        for s7 in range(s6, M+1):
                            a[6] = s7
                            for s8 in range(s7, M+1):
                                a[7] = s8
                                for s9 in range(s8, M+1):
                                    a[8] = s9
                                    for s10 in range(s9, M+1):
                                        a[9] = s10
                                        
                                        cnt = 0
                                        for i in range(Q):
                                            si = s[i]
                                            if a[si[1]-1] - a[si[0]-1] == si[2]:
                                                cnt += si[3]
                                            mx = max(mx, cnt)
                                            
print(mx)
n=int(input())
s=input()
ans=0
for i in range(n):
  ans+=1
  for j in range(i+1,n+1):
    if s[i]==s[j]:
      break
    ans+=1
  ans%=(10**9+7)
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
mod=10**9+7
ans=1
lets=[1]*26
for i in s:
  lets[ord(i)-97]+=1
for i in range(26):
  ans*=lets[i]
  ans%=mod
print(ans-1)
n = int(input())
if n%2 == 0:
	print (n):
else:
	print (n*2)

### FIXED CODE ###

n = int(input())
if n%2 == 0:
	print (n)
else:
	print (n*2)
N = list(map(int,input().split(" ")))

if N[0]*500 >= N[1]:
  print("Yes")
elif:
  print("No")

### FIXED CODE ###

N = list(map(int,input().split(" ")))
 
if N[0]*500 >= N[1]:
  print("Yes")
else:
  print("No")
import math
n=int(input())
p = []
for i in range(1,10**1000):
    if n / (26**i) >=1:
        if n%(26**i) ==0:
            p.append(chr(26+96))
        else:
            p.append(chr(n%(26**i)+96))

    else:
        if n%(26**i) ==0:
            p.append(chr(26+96))
            break
        else:
            p.append(chr(round(n/26)+96))
            break
p.reverse()
print("".join(p))



### FIXED CODE ###

N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])
s=input()
bf='01'*(len(s)//2)+'0'*(len(s)&1)
wf='10'*(len(s)//2)+'1'*(len(s)&1)
ans=min(len([x!=y if x,y in zip(s,bf)]),len([x!=y if x,y in zip(s,wf)]))
print(ans)

### FIXED CODE ###

#!/usr/bin/env python3
S = input()
bf = '01' * (len(S) // 2) + '0' * (len(S) & 1)
wf = '10' * (len(S) // 2) + '1' * (len(S) & 1)
ans = 10**5
ans = min(ans, [x != y for x, y in zip(S, bf)].count(True))
ans = min(ans, [x != y for x, y in zip(S, wf)].count(True))
print(ans)
x=input().split()
a=int(x[0])
b=int(x[1])
print("%d %r %f"%(a//b, a%b, a//b)


### FIXED CODE ###

x=input().split()
a=int(x[0])
b=int(x[1])
print("%d %d %f"%(a//b, a%b, a/b))
N, M = map(int,input().split())
S = "0" * N

for i in range(M):
    s,c = map(int,input().split())
    if s == 1 and c == 0 and N != 1:
        print("-1")
        quit()
    elif S[s-1] == "0" or S[s-1] == str(c):
        S = S[0:s-1] + str(c) + S[s:-1]
    else:
        print("-1")
        quit()

if S[0] == "0" and N != 1:
    S = "1" + S[1:-1]

print(S)

### FIXED CODE ###

N, M = map(int,input().split())
S = []
C = []
flag = True
if N == 1 and M == 0:
    print("0")
    quit()

for i in range(M):
    s,c = map(int,input().split())
    if s in S:
        if C[S.index(s)] != c:
            flag = False
            break
    if s == 1 and N > 1:
        if c == 0:
            flag = False
            break
    S.append(s)
    C.append(c)

if flag:
    n = [1] + [0 for i in range(N - 1)]
    for i in range(len(S)):
        n[S[i]-1] = C[i]
    print(*n, sep="")
else:
    print("-1")
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
	else:
      break
      
print(ans)


### FIXED CODE ###

import math

x = int(input())

ans = 1
for b in range(2, int(math.sqrt(x)) + 1):
  for p in range(1, int(math.sqrt(x)) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)
import sys
def main():
    input = sys.stdin.readline
    N,K,Q=map(int, input().split())
    *A,=map(int, input().split())

    ans=10**10
    from heapq import heappop, heappush
    A.append(-1)
    for y in A:
        if y==-1: break
        c=[]
        t=[]
        for a in A:
            if a >= y:
                heappush(t, a)
            else:
                for _ in range(len(t)-(K-1)):
                    heappush(c, heappop(t))
                t.clear()
        if len(c) < Q: continue
        x=[heappop(c) for _ in range(Q)][-1]
        ans = min(ans, x-y)
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

N,K,Q=map(int, input().split())
*A,=map(int, input().split())

import heapq
ans = 10**10
A.append(-1)
for y in A:
    if y==-1: break
    p,q=[],[]
    for a in A:
        if a >= y:
            heapq.heappush(p, a)
        else:
            for i in range(max(0,len(p)-(K-1))):
                heapq.heappush(q, heapq.heappop(p))
            p=[]
    if len(q) < Q: continue
    x = -1
    for i in range(Q):
        x = heapq.heappop(q)
    ans = min(ans, x-y)
print(ans)
import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]
T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))

if T_0 != np.array([0,0,0,0,0]):
    A = np.sum(T_c) - 10 + np.sum(T_0) + T_s[0]
    print(A)
else:
    A = np.sum(T_0)
    print(A)

### FIXED CODE ###

import numpy as np
T = np.array([int(input()) for i in range(5)])

T_0 = T[np.mod(T, 10) == 0]
T_o = T[np.mod(T, 10) != 0]

T_c = T_o + 10 - np.mod(T_o, 10)
T_s = np.sort(np.mod(T_o, 10))
if T_0.size == 5:
    print(np.sum(T_0))
else:
    print(np.sum(T_c) - 10 + np.sum(T_0) + T_s[0])
import numpy as np
s = input()
q = int(input())
rbef = []
aft = []
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef.append(qi[2])
        else:
            aft.append(qi[2])


bef = ''.join(list(reversed(rbef)))
ans = (''.join(reversed(rbef))+s).join(aft)

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)


### FIXED CODE ###

import numpy as np
s = input()
q = int(input())
rbef = []
aft = []
sgn = 1
for i in range(q):
    qi = np.array(input().split(),dtype=str)
    if qi[0] == "1":
        sgn *= -1
    else:
        if (qi[1] == "1" or sgn == -1) and (qi[1] == "2" or sgn == 1):
            rbef.append(qi[2])
        else:
            aft.append(qi[2])

bef = "".join(reversed(rbef))
taft = "".join(aft)
ans = bef + s + taft

if sgn == 1:
    print(ans)
else:
    rans = ''.join(list(reversed(ans)))
    print(rans)
while 1:
    h,w = map(int, raw_input().split())

    if h == 0 and w == 0:
    break

    for i in range(h):
        if i == 0 or i == (h-1):
            print "#" * w
        else :
            print "#" + "." * (w-2) + "#"
        print ("")

### FIXED CODE ###

while(True):
    H, W = map(int, raw_input().split())
    if(H == 0 and W == 0):
        break
    for i in range(H):
        if(i == 0 or i == (H - 1)):
            print("#" * W)
        else:
            print("#" + "." * (W - 2) + "#")
    print("")
import numpy as np

N, K = map(int, input().split())
p = (np.array(list((map(int, input().split())))) + 1) / 2

ans = 0

for num in range(len(p)):
    tmp = p[num:num+K].sum()
    if ans < tmp:
        ans = tmp

print(float(ans))

### FIXED CODE ###

S, T = input().split()
A, B = map(int, input().split())
U = input()

if U == S:
    A -= 1
elif U == T:
    B -= 1

print(A, end=" ")
print(B)
n = int(input())
k = 1
kotae = []
kotae2 = []

if n != 0:
    while n != 0:
        if n % ((-2) ** k) == 0:
            kotae.append(0)
        else:
            kotae.append(1)
            n = n - ((-2) ** (k - 1))
        k = k + 1

    for i in kotae[::-1]:
        kotae2.append(i)

    print("".join(kotae2))
else:
    print(0)

### FIXED CODE ###

n = int(input())
k = 1
kotae = []
kotae2 = []

if n != 0:
    while n != 0:
        if n % ((-2) ** k) == 0:
            kotae.append(0)
        else:
            kotae.append(1)
            n = n - ((-2) ** (k - 1))
        k = k + 1

    for i in kotae[::-1]:
        kotae2.append(str(i))

    print("".join(kotae2))
else:
    print(0)