Harryxun/stf_run huggingface dataset:
T = input()
lis = list(T)
n = lis.count("?")

temp = [i for i, x in enumerate(lis) if x == '?']

t = 0
for i, e in enumerate(temp):
    if 1 == e-t  and lis[e - 2] == "D":
        lis[e-1] = "P"
        lis[e] = "D"
    if e == 0:
        lis[e] = "P"
    if e < len(lis) - 1:
        if lis[e + 1] == "D":
            lis[e] = "P"
    if lis[e - 1] == "P":
        lis[e] = "D"

    t = e
    LIS = ''.join(lis)
print(LIS)

### FIXED CODE ###

T = input()
print(T.replace("?","D"))
# abc177_b.py
S = input()
T = input()
for i in range(1,len(T)):
    if T[0:i] in S:
        continue
    else:
        ans = i
        break
print(len(T)-i)

### FIXED CODE ###

# abc177_b.py
S = input()
T = input()

ans = 0
length = len(T)
slen= len(S)
mincnt = 10000
for i in range(slen-length+1):
    tmp = S[i:i+length]
    cnt = 0
    for i in range(length):
        if tmp[i]!=T[i]:
            cnt+=1
    if cnt < mincnt:
        mincnt=cnt
print(mincnt)
N,M = map(int,input().split())
ichi = []
juu = []
hyaku = []
for i in range(M):
    if N == 1:
        s,c = map(int,input().split())
        ichi.append(c)
    elif N == 2:
        s,c = map(int,input().split())
        if s == 1:
            juu.append(c)
        else:
            ichi.append(c)
    elif N == 3:
        s,c = map(int,input().split())
        if s == 1:
            hyaku.append(c)
        elif s == 2:
            juu.append(c)
        else:
            ichi.append(c)
ichi = set(ichi)
juu = set(juu)
hyaku = set(hyaku)
if N == 1:
    if len(ichi) >= 2:
        print(-1)
    else:
        print(min(ichi))
elif N == 2:
    if juu == set([0]):
        print(-1)
    elif len(juu) >= 2:
        print(-1)
    elif len(ichi) >= 2:
        print(-1)
    else:
        if ichi == set():
            ichi.add(0)
        if juu == set():
            juu.add(1)
        print(str(min(juu))+str(min(ichi)))
else:
    if hyaku == set([0]):
        print(-1)
    elif len(hyaku) >= 2:
        print(-1)
    elif len(juu) >= 2:
        print(-1)
    elif len(ichi) >= 2:
        print(-1)
    else:
        if hyaku == set():
            hyaku.add(1)
        if juu == set():
            juu.add(0)
        if ichi == set():
            ichi.add(0)
        print(str(min(hyaku))+str(min(juu))+str(min(ichi)))



### FIXED CODE ###

N,M = map(int,input().split())
values = []
for i in range(N):
    values.append([])
for i in range(M):
    s,c = map(int,input().split())
    values[s-1].append(c)

#同じ桁に2つ以上候補があるなら-1
for i in values:
    if len(set(i)) >= 2:
        print(-1)
        exit()

#最上位桁に候補がないときは1を補う
if values[0] == list():
    if N != 1:
        values[0].append(1)

#候補がない桁は0を補う
for i in range(N):
    if len(values[i]) == 0:
        values[i].append(0)

#探索
for i in range(1000):
    i = [int(j) for j in list(str(i))]
    if len(i) != N:
        continue
    if N==3:
        if i[0] in values[0] and i[1] in values[1] and i[2] in values[2]:
            print("".join([str(j) for j in i]))
            exit()
    elif N==2:
        if i[0] in values[0] and i[1] in values[1]:
            print("".join([str(j) for j in i]))
            exit()
    else:
        if i[0] in values[0]:
            print("".join([str(j) for j in i]))
            exit()
print(-1)
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
lis = []
prv = -1
for i in range(n):
    if prv != A[i]:
        lis.append(A[i])
        prv = A[i]
#print(lis)
dp = [[[0] * ]
def dfs(money,kabu,now):
    global ans
    if now == len(lis):
        ans = max(money,ans)
        return;
    if kabu != 0:
        dfs(money + kabu*lis[now],0,now+1)
    if money//lis[now] >= 1:
        dfs(money - lis[now] * (money//lis[now]),money//lis[now],now+1)
    dfs(money,kabu,now+1)
ans = 1000
dfs(1000,0,0)
print(ans)


### FIXED CODE ###

#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
money = 1000
kabu = 0
for i in range(1,n):
    if A[i-1] < A[i]:
        kabu = money // A[i-1]
        money -= kabu * A[i-1]
        money += kabu * A[i]
        kabu = 0
    #print(money,kabu)
print(money)
A,B = map(int,input().split())
if (A+B)%2 == 0:
  pint(int((A+B)//2))
else:
  print('IMPOSSIBLE')

### FIXED CODE ###

A,B = map(int,input().split())
if (A+B)%2 == 0:
  print(int((A+B)//2))
else:
  print('IMPOSSIBLE')
input()
print("YNEOS"[sum(map(int,input()))%2::2])

### FIXED CODE ###

input()
print("YNEOS"[sum(map(int,input().split()))%2::2])
n, m = [int(i) for i in input().split()]

matrix = []
for ni in range(n):
    matrix.append([int(a) for a in input().split])

vector = []
for mi in range(m):
    vector.append(int(input()))


for ni in range(n):
    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]
        
    print(sum)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
  
matrix = []
for ni in range(n):
    matrix.append([int(a) for a in input().split()])
  
vector = []
for mi in range(m):
    vector.append(int(input()))
  
b = []
for ni in range(n):
    sum = 0
    for mi in range(m):
        sum += matrix[ni][mi] * vector[mi]
  
    print(sum)
import sys

sys.setrecursionlimit(100000)


def get_ncr(div):
    cache = {}

    def f(*args):
        if args in cache:
            return cache[args]
        n, r = args
        if r == 0 or n == r:
            cache[args] = 1
            return 1
        cache[args] = (f(n - 1, r) + f(n - 1, r - 1)) % div
        return cache[args]

    return f


def find_duplicated(aa):
    appeared = [-1] * (n + 1)
    for i, a in enumerate(aa):
        if appeared[a] >= 0:
            return appeared[a], i
        appeared[a] = i


n = int(input())
aa = list(map(int, input().split()))
i1, i2 = find_duplicated(aa)
between_n = i2 - i1 + 1
outside_n = n + 1 - between_n
div = int(1e9 + 7)
ncr = get_ncr(div)

for part_n in range(1, n + 2):
    sub = ncr(outside_n, part_n - 1) if outside_n >= part_n - 1 else 0
    print((ncr(n + 1, part_n) - sub) % div)


### FIXED CODE ###

def ncr(n, r):
    return fact[n] * inv_fact[r] * inv_fact[n - r] % div


def find_duplicated(aa):
    appeared = [-1] * (n + 1)
    for i, a in enumerate(aa):
        if appeared[a] >= 0:
            return appeared[a], i
        appeared[a] = i


div = int(1e9 + 7)
n = int(input())
aa = list(map(int, input().split()))

fact, inv_fact = [1], [1]
fact_tmp = 1
for i in range(1, n + 2):
    fact_tmp *= i
    fact_tmp %= div
    fact.append(fact_tmp)
    inv_fact.append(pow(fact_tmp, div - 2, div))

i1, i2 = find_duplicated(aa)
outside_n = n + 1 - (i2 - i1 + 1)

for part_n in range(1, n + 2):
    sub = ncr(outside_n, part_n - 1) if outside_n >= part_n - 1 else 0
    print((ncr(n + 1, part_n) - sub) % div)
def merge(A, left, mid, right):
    n1 = mid - left
    n2 = right - mid
    L = [0]*(n1+1)
    R = [0]*(n2+1)
    for i in range(n1):
        L[i] = A[left + i]
    for i in range(n2):
        R[i] = A[mid + i]
    L[n1] = float("inf")
    R[n2] = float("inf")
    i = 0
    j = 0
    for k in range(left,right): 
        if L[i] <= R[j]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1

def mergeSort(A, left, right):
  if left+1 < right
    mid = (left + right)//2;
    mergeSort(A, left, mid)
    mergeSort(A, mid, right)
    merge(A, left, mid, right)
    
### Main Function
n = int(input())
S = list(map(int,input().split()))
c = 0

mergeSort(S, 0, n)

print(S)
print(c)



### FIXED CODE ###

def merge(A,left,mid,right):
    n1=mid-left
    n2=right-mid
    L = A[left:mid]
    R = A[mid:right]
    L.append(float("inf"))
    R.append(float("inf"))
    """
    L=[0]*(n1+1)
    R=[0]*(n2+1)
    for i in range(n1):
        L[i]=A[left+i]
    for i in range(n2):
        R[i]=A[mid+i]
    L[n1]=float("inf")
    R[n2]=float("inf")
    """
    i=0
    j=0
    for k in range(left,right):
        global cnt
        cnt+=1
        if L[i]<=R[j]:
            A[k]=L[i]
            i=i+1
        else:
            A[k]=R[j]
            j=j+1

def mergeSort(A,left,right):
    if left+1<right:
        mid=(left+right)//2
        mergeSort(A,left,mid)
        mergeSort(A,mid,right)
        merge(A,left,mid,right)

n=int(input())
S=list(input().split())
for i in range(n):
    S[i]=int(S[i])
cnt=0
mergeSort(S,0,n)
for i in range(n):
    if i==n-1:
        print(S[i])
    else:
        print(S[i],end=" ")
print(cnt)
N,A=map(int,input().split())

ans=N
for n in range(1,41):
    for i in range(2*n,N**(1/n)+100):
        test=i+n*A
        q=i//n
        r=i%n
        prod=pow(q,n-r)*pow(q+1,r)
        test+=(N-1)//prod+1
        ans=min(ans,test)

print(ans)


### FIXED CODE ###

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

ans=N

for i in range(-10,10):
    x=int(N**.5)+i
    if x>0:
        test=x+A+(N-1)//x+1
        ans=min(ans,test)

for n in range(2,41):
    for i in range(2*n,int(N**(1/n))+1000):
        test=i+n*A
        q=i//n
        r=i%n
        prod=pow(q,n-r)*pow(q+1,r)
        test+=(N-1)//prod+1
        ans=min(ans,test)

print(ans)
import math
import numpy as np
import queue
from collections import deque
import heapq
mod = 10**9+7
ans = 1

def twoxxn(t,mod):
    ni = t
    an = 1
    n2 = 2
    while ni > 0:
        if ni%2 == 1:
            an = (an*n2)%mod
        n2 = (n2**2)%mod
        ni //= 2
    return an

n = int(input())
d = dict()
for i in range(n):
    a,b = map(int,input().split())
    if a < 0 :
        a = -a
        b = -b
    if a == 0:
        b = 1
        g = 1
    elif b == 0:
        a = 1
        b = 1
    else:
        g = math.gcd(abs(a),abs(b))
    if a == 0 and b == 0:
        continue
    else:
        p1 = str(a//g)+" "+str(b//g)
        if p1 in d:
            d[p1] += 1
        else:
            d[p1] = 1

for i in d.keys():
    i0, i1 = map(int,i.split())
    if str(i1)+" "+str(-i0) in d:
        if d[i] == 0:
            continue
        aaa = (twoxxn(d[str(i1)+" "+str(-i0)],mod)+twoxxn(d[i],mod)-1)%mod
        ans = (ans*aaa)%mod
        d[str(i1)+" "+str(-i0)] = 0
    elif str(-i1)+" "+str(i0) in d:
        if d[i] == 0:
            continue
        aaa = (twoxxn(d[str(-i1)+" "+str(i0)],mod)+twoxxn(d[i],mod)-1)%mod
        ans = (ans*aaa)%mod
        d[str(-i1)+" "+str(i0)] = 0
    else:
        ans = (ans*twoxxn(d[i],mod))%mod

if ans == 1:
    print(1)
    exit()
ans = (ans-1)%mod
print(ans)


### FIXED CODE ###

import math
import numpy as np
import queue
from collections import deque
import heapq
mod = 10**9+7
ans = 1
iw0 = 0

def twoxxn(t,mod):
    ni = t
    an = 1
    n2 = 2
    while ni > 0:
        if ni%2 == 1:
            an = (an*n2)%mod
        n2 = (n2**2)%mod
        ni >>= 1
    return an

n = int(input())
d = dict()
for i in range(n):
    a,b = map(int,input().split())
    if a == 0 and b == 0:
        iw0 += 1
        continue
    if a == 0:
        b = 1
        g = 1
    elif b == 0:
        a = 1
        g = 1
    else:
        g = math.gcd(abs(a),abs(b))
    if a < 0 :
        a = -a
        b = -b
    p1 = a//g, b//g
    if p1 in d:
        d[p1] += 1
    else:
        d[p1] = 1
done = []
for (i0,i1), din in d.items():
    if d.get((-i1,i0),1) == 0 or d.get((i1,-i0),1) == 0:
        continue
    w = d.get((i1,-i0),0) + d.get((-i1,i0),0)
    aaa = (twoxxn(w,mod)+twoxxn(din,mod)-1)%mod
    ans = (ans*aaa)%mod
    d[(i0,i1)] = 0

if len(d.keys()) == 0:
    print(iw0)
    exit()

ans = (iw0+ans+mod-1)%mod
print(ans)
s = list(input())

out = 0

for i in range(0, len(s), 2):
    if s[i] == 'h' and s[i+1] == 'i':
        continue
    else:
        out = 1

if out:
    print("No")
else:
    print("Yes")

### FIXED CODE ###

s = list(input())

out = 0

if len(s) % 2 != 0:
    print("No")
else:
    for i in range(0, len(s), 2):
        if s[i] == 'h' and s[i+1] == 'i':
            continue
        else:
            out = 1

    if out:
        print("No")
    else:
        print("Yes")
N = int(input())
P = list(map(int, input().split()))
res = 0
for idx in range(len(P)):
    if P[idx] == idx + 1:
        if idx < N:
            P[idx], P[idx+1] = P[idx+1], P[idx]
        res += 1

print(res)


### FIXED CODE ###

N = int(input())
P = list(map(int, input().split()))
res = 0
for idx in range(len(P) - 1):
    if P[idx] == idx + 1:
        P[idx], P[idx+1] = P[idx+1], P[idx]
        res += 1

if P[-1] == N:
    res += 1

print(res)
for i in range(int(input())):
    res = 0
    c,a,n = list(map(int,input().split()))
    res = min(n,a,c)
    c -= res
    a -= res
    if c >= 2 and a >= 1:
        cca += min(c//2,a)
        c -= cca*2

    if c >=3:
        res += c//3

    print(res)

### FIXED CODE ###

for i in range(int(input())):
    res = 0
    c,a,n = list(map(int,input().split()))
    res = min(n,a,c)
    c -= res
    a -= res
    if c >= 2 and a >= 1:
        cca = min(c//2,a)
        c -= cca*2
        res += cca

    if c >=3:
        res += c//3

    print(res)
from sys import stdin
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
A,B,C,D=list(map(int,stdin.readline().strip().split()))
C_A=(A-1)//C
C_B=B//C
D_A=(A-1)//D
D_B=B//D
CD=lcm(C,D)
CD_A=(A-1)//(CD)
CD_B=B//(CD)
# CD_A=0
# CD_B=0
print((1+B-A)-((C_B-C_A)+((D_B-D_A)-(CD_B-CD_A))))

### FIXED CODE ###

from sys import stdin
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
A,B,C,D=list(map(int,stdin.readline().strip().split()))
C_A=(A-1)//C
C_B=B//C
D_A=(A-1)//D
D_B=B//D
CD=lcm(C,D)
CD_A=(A-1)//(CD)
CD_B=B//(CD)

print((1+B-A)-((C_B-C_A)+((D_B-D_A)-(CD_B-CD_A))))
# -*- coding: <encoding name> -*-

import math
n = map(int, input())
print(math.ceil(n / 2))

### FIXED CODE ###

# -*- coding: <encoding name> -*-

import math
n = int(input())
print(math.ceil(n / 2))
n,q=map(int,input().split())
s=input()
for i in range(n):
  l,r=map(int,input().split())
  print(s[l-1:r].count('AC'))

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
c=[0 for _ in range(n)]
p=''
d=0
for i in range(n):
  x=s[i]
  if p=='A' and x=='C':
    d+=1
  p=x
  c[i]=d
for i in range(q):
  ans=0
  l,r=map(int,input().split())
  ans=c[r-1]-c[l-1]

  print(ans)
import numpy as np

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

A = a.reshape(1, -1)
Asq = np.transpose(A) @ A
Asq = np.triu(Asq) - np.diag(np.ndarray.diagonal(Asq))
Asq = Asq % (10**9+7)

print(np.sum(Asq) % (10**9+7))


### FIXED CODE ###

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

a2=[a[n-1]]
for i in range(n-1,0,-1):
    a2.append(a2[-1]+a[i-1])
ans=0
for i in range(n-1):
    ans = ( ans + (a[i]*a2[-i-2]) )%(10**9+7)
print(ans)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-


nnk = input().split(" ")
n = int(nnk[0])
k = int(nnk[1])

hs = [int(input()) for l in range(n)]
hs.sort()

hmmm = []
for l in range(n-k+1):
    hmmm.append(hs[k+l-1] - hs[l])

hmmm.sort()
print(hmmm[0])

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-


d = input()

if d == "22":
    print("Christmas Eve Eve Eve")
elif d == "23":
    print("Christmas Eve Eve")
elif d == "24":
    print("Christmas Eve")
elif d == "25":
    print("Christmas")
N, X, T = map(int,input().split())
if N % X == 0:
  print( T*N // X )
else:
  print( N*T // X + T )


### FIXED CODE ###

N, X, T = map(int,input().split())
if N % X == 0:
  print( T*N // X )
else:
  print( T*(N // X + 1))
n=int(input())
p=1
if 360//n == 0:
	print(360//n)
else:
  while true:
	if n*p%360 == 0:
		print(n)
      	exit()
    n+=1
	

### FIXED CODE ###

p = int(input())
index = 1
while True:
    if p* index % 360 == 0:
        print(index)
        break
    index += 1
n = input()
a = list(map(int, input().split()))

count = 0
while all(i % 2 == 0 for i in a):
    a = [i / 2 for i in a]
    count += 1
print(count)

### FIXED CODE ###

i = input()
print(i.count("1"))
import math

input_data = input()

for line in input_data:
    datas = line.split(" ")
    datas = [int(x) for x in datas]
    print(int(math.floor((datas[0] + datas[1]) / 2)))

### FIXED CODE ###

import math
x,y=[int(i) for i in input().split()]
print(int(math.ceil((x + y) / 2)))
from collections import defaultdict
def debug(*args): print(*args, file=sys.stderr)
N=int(input())
A=[int(i) for i in input().split()]
dd=defaultdict(int)
for a in A:
    dd[a]+=1
#print(dd)
B=sorted(A,reverse=True)
ans=0
for x in B:
    debug(*args)
    #print(x)
    if dd.get(x,-1)==0:
        continue
    s=len(bin(x))-3
    if x==1<<s:
        t=dd.get(x,-1)
        if t!=-1:
            ans+=t//2
            dd[x]-=(t//2)*2
            #print(ans)
            #print(dd)
    else:
        s+=1
        #print((1<<s)-x)
        t=dd.get((1<<s)-x,-1)
        if t>=1:
            ans+=1
            dd[x]-=1
            dd[(1<<s)-x]-=1
            #print(ans)
            #print(dd)
print(ans)




### FIXED CODE ###

from collections import defaultdict
N=int(input())
A=[int(i) for i in input().split()]
dd=defaultdict(int)
for a in A:
    dd[a]+=1
#print(dd)
B=sorted(A,reverse=True)
ans=0
for x in B:
    #print(x)
    if dd.get(x,-1)==0:
        continue
    s=len(bin(x))-3
    if x==1<<s:
        t=dd.get(x,-1)
        if t!=-1:
            ans+=t//2
            dd[x]-=(t//2)*2
            #print(ans)
            #print(dd)
    else:
        s+=1
        #print((1<<s)-x)
        t=dd.get((1<<s)-x,-1)
        if t>=1:
            ans+=1
            dd[x]-=1
            dd[(1<<s)-x]-=1
            #print(ans)
            #print(dd)
print(ans)
A = int(input())
B = int(input())
print((A-1)*(B-1))

### FIXED CODE ###

ab = input().split()
print((int(ab[0])-1)*(int(ab[1])-1))
n, k = map(int, input().split())
h = list(map(int, input().split()))
attack_cnt = 0
 
desc_h = sorted(h, reverse=True)
for i in range(k):
  desc_h.pop(0)
 
print(sum(desc_h))

### FIXED CODE ###

n, k = map(int, input().split())
h = list(map(int, input().split()))
attack_cnt = 0
 
desc_h = sorted(h, reverse=True)
end = k if k <= n else n
del desc_h[0:end]
 
print(sum(desc_h))
ef find_negative_loop(s,n,w,es):
  # s: start
  # n: number of nodes
  # w: number of edges
  # es[i]: from, to, cost
  
  # d: shortest dist of s -> i
  d = [float('inf')]*n
  d[s] = 0
  for i in range(2*n):
    for j in range(w):
      p, q, r = es[j]
      if d[p] != float('inf') and (d[q] > d[p] + r):
        d[q] = d[p] + r
        if i >= n:
          d[q] = -float('inf')
      if i == n-1:
        temp = d[-1]
  return temp, d[-1]
         
n, w, p = map(int, input().split())
es = []
for i in range(w):
  x, y, z = map(int, input().split())
  x, y = x-1, y-1
  z = (z-p)*(-1)
  es.append([x, y, z])
  
temp, d = find_negative_loop(0, n, w ,es)
if temp == d:
  print(min(0, d)*(-1))
else:
  print('-1')

### FIXED CODE ###

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

def find_negative_loop(s,n,w,es):
  # s: start
  # n: number of nodes
  # w: number of edges
  # es[i]: from, to, cost
  
  # d: shortest dist of s -> i
  inf = float('inf')
  d = [inf for _ in range(n)]
  d[s] = 0
  for i in range(2*n):
    for j in range(w):
      p, q, r = es[j]
      if d[p] != inf and (d[q] > d[p] + r):
        d[q] = d[p] + r
        if i >= n:
          d[q] = (-1)*inf
    if i == n-1:
      temp = d[-1]
  return temp, d[-1]
         

n, w, p = map(int, input().split())
es = []
for i in range(w):
  x, y, z = map(int, input().split())
  es.append([x-1, y-1, (z-p)*(-1)])
  
temp, d = find_negative_loop(0, n, w ,es)
if temp == d:
  print(min(0, d)*(-1))
else:
  print('-1')
m,k=map(int,input().split())
if m==0:
  print(0,0)
elif m==1:
  if k==0:
    print(0,0,1,1)
  elif k==1:
    print(-1)
else:
  ris=[i for i in range(m)]
  ris.remove(k)
  print(ris+k+ris[::-1]+k)

### FIXED CODE ###

m,k=map(int,input().split())
if k>=2**m:
  print(-1)
elif m==0:
  print(0,0)
elif m==1:
  if k==0:
    print(0,0,1,1)
  elif k==1:
    print(-1)
else:
  ris=[str(i) for i in range(2**m)]
  ris.remove(str(k))
  l=" ".join(ris)
  r=" ".join(ris[::-1])
  print(l,str(k),r,str(k))
import heapq
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
ansC = []

N, K = LI()
V = LI()
dp = [[[0]]*(K+1) for _ in range(K+1)]
right = [0]*N
left = [0]*N
#right[1] = V[-1]
#left[1] = V[0]

for i in range(min(N,K+1)):
    for j in range(min(N+1,K-i+1)):
        if i<N-j:
            dp[i][j] = [V[:i]+V[N-j:]+[0]]
        else:
            dp[i][j] = [V+[0]]
        dp[i][j][0].sort()

#print(dp)

for i in range(min(N,K)):
    for j in range(min(N,K)):
        if i+j!=0:
            t = K - (i + j)
            for l in range(t):
                if dp[i][j]!=[]:
                    m = dp[i][j][0][0]
#                    print(m)
                    if m < 0:
                        del dp[i][j][0][0]
#            print(i,j)
#            print(dp[i][j])
            if dp[i][j][0]:
#                print(dp[i][j][0])
                ansC.append(sum(dp[i][j][0][::]))

#print(ansC)
print(max(ansC))

### FIXED CODE ###

import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')
ansC = []

N, K = LI()
V = LI()
dp = [[[0]]*(K+1) for _ in range(K+1)]
right = [0]*N
left = [0]*N
#right[1] = V[-1]
#left[1] = V[0]

for i in range(min(N+1,K+1)):
    for j in range(min(N+1,K-i+1)):
        if i<N-j:
            dp[i][j] = [V[:i]+V[N-j:]+[0]]
        else:
            dp[i][j] = [V+[0]]
        dp[i][j][0].sort()

#print(dp)

for i in range(min(N+1,K+1)):
    for j in range(max(0,min(N+1,K-i+1))):
        if i+j!=0:
            t = max(K - (i + j),0)
            for l in range(t):
                if dp[i][j]!=[]:
                    m = dp[i][j][0][0]
#                    print(m)
                    if m < 0:
                        del dp[i][j][0][0]
#            print(i,j)
#            print(dp[i][j])
            if dp[i][j][0]:
#                print(dp[i][j][0])
                ansC.append(sum(dp[i][j][0][::]))

#print(ansC)
if ansC:
    print(max(ansC))
else:
    print("0")
N = int(input())
A = list(map(str,input().split()))
Q = int(input())
b = []
c = []
for i in range(Q):
    B,C = map(str,input().split())
    b.append(B)
    c.append(C)

for i in range(Q):
    if b[i] in A:
        A = [s.replace(b[i],c[i]) for s in A]
    print(sum(int(i) for i in A))

### FIXED CODE ###

α = str(input())

if α == α.upper():
    print("A")
else:
    print("a")