Harryxun/stf_run huggingface dataset:
n = input()
k = int(input())

n_list = []
for a in n:
    n_list.append(int(a))
n_num = len(n_list)

if n_num < k:
    print('0')
    return

dp = [[[0] * (n_num + 1) for _ in range(2)]for _ in range(n_num + 1)]

dp[0][0][0] = 1
for i in range(n_num):
    for smaller in range(2):
        for j in range(n_num):
            lim = 9 if smaller else n_list[i]
            for x in range(lim + 1):
                if x != 0:
                    ns = j + 1
                else:
                    ns = j
                nlt = smaller | (x < n_list[i])
                dp[i + 1][nlt][ns] += dp[i][smaller][j]
ans = dp[n_num][0][k] + dp[n_num][1][k]
print(ans)

### FIXED CODE ###

n = input()
k = int(input())

n_list = []
for a in n:
    n_list.append(int(a))
n_num = len(n_list)

if n_num < k:
    print('0')
else:

    dp = [[[0] * (n_num + 1) for _ in range(2)]for _ in range(n_num + 1)]

    dp[0][0][0] = 1
    for i in range(n_num):
        for smaller in range(2):
            for j in range(n_num):
                lim = 9 if smaller else n_list[i]
                for x in range(lim + 1):
                    if x != 0:
                        ns = j + 1
                    else:
                        ns = j
                    nlt = smaller | (x < n_list[i])
                    dp[i + 1][nlt][ns] += dp[i][smaller][j]
    ans = dp[n_num][0][k] + dp[n_num][1][k]
    print(ans)
N = int(input())
sheet = []
for i in range(N):
  line = input().split()
  sheet += [(int(line[0]), int(line[1]))]

dic = {}
for i in range(N):
  start = sheet[i]
  for j in range(i+1, N):
    vec = ((sheet[j][0]-sheet[i][0]), sheet[j][1]-sheet[i][1])
    if vec not in dic.keys():
      dic[vec]=1
    else:
      dic[vec]+=1

a = max(dic.values())
print(N-a)

### FIXED CODE ###

N,*L = map(int, open(0).read().split())
ls = [0]*N
for i,c in enumerate(zip(*[iter(L)]*2)):
  ls[i] = c
ls.sort()
pls = []
for i in range(N):
  for j in range(i+1,N):
    a,b = ls[i]
    x,y = ls[j]
    pls += [(x-a,y-b)]
ans = 10**10
for X,Y in pls:
  s = set()
  m = 0
  for x,y in ls:
    if (x-X, y-Y) not in s:
      m += 1
    s.add((x,y))
  ans = min(m,ans)
if N==1:
  ans = 1
print(ans)
N, A, B = map(int,input())

if (A-B)%2 == 0:
  print((A-B)//2)
else:
  print(min(max(N-A,N-B),max(A-1,B-1)))

### FIXED CODE ###

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

if (A-B)%2 == 0:
  print(abs(A-B)//2)
else:
  print(min((A+B-1)//2,(2*N-(A+B)+1)//2))
def Otoshidama():
    N,Y = input().split()
    N = int(N)
    Y = int(Y)
    for i in range(N+1):
        for j in range(N-i+1):
            for k in range(N-i-j+1):
                ans = 10000*i + 5000*j + 1000*k
                if Y == ans:
                    return(i,j,k)
    return(-1,-1,-1)

One,Two,Three = Otoshidama()
print(One,Two,Th

### FIXED CODE ###

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

for i in range(N+1):
    for j in range(N-i+1):
        if Y-10000*i-5000*j == 1000*(N-i-j):
            print(i,j,N-i-j)
            break
    else:
        continue
    break
else:
    print(-1,-1,-1)
n,m=map(int,input().split())

li=[list(map(int,input().split())) for i in range(n)]
lj=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
    li_distance=[abs(lj[j][0]-li[i][0])+abs(lj[j][1]-li[i][1]) for j in range(m)]
    print(li_distance.index(min(li_distance)+1))
    

### FIXED CODE ###

n,m=map(int,input().split())

li=[list(map(int,input().split())) for i in range(n)]
lj=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
    li_distance=[abs(lj[j][0]-li[i][0])+abs(lj[j][1]-li[i][1]) for j in range(m)]
    print(li_distance.index(min(li_distance))+1)
a,b,c,d=map(int,input().split())
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
e=lcm(c,d)    
ans=(b-a+1)-(b//c-(a-1)//c)-(b//d-(a-1)//d)+(b//e-(a-1)//e)
print(ans)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
import fractions
e=(c*d)//fractions.gcd(c,d)
ans=(b-a+1)-(b//c-(a-1)//c)-(b//d-(a-1)//d)+(b//e-(a-1)//e)
print(ans)
from collections import Counter
N = int(input())
ball = [[int(i) for i in input().split()] for k in range(N)]
diff = []
for i in range(N):
    for j in range(i+1, N):
        diff.append((abs(ball[i][n]-ball[j][n]) for n in range(2)))
k = Counter(diff).most_common()[0][1]
print(max(1,N-1-k))


### FIXED CODE ###

from collections import Counter
N = int(input())
ball = [[int(i) for i in input().split()] for k in range(N)]
ball.sort(key=lambda x: x[1])
ball.sort()
diff = []
if N == 1:
    print(1)
else:
    for i in range(N-1):
        for j in range(i+1, N):
            diff.append([(ball[j][n]-ball[i][n]) for n in range(2)])
    k = Counter(map(tuple, diff)).most_common()[0][1]
#    print(diff)
    print(max(1,N-k))
n = int(input())
from collections import Counter
c = Counter()
for i in range(n):
  c.update[{input():1}]
  
m = int(input())
for i in range(m):
  s = input()
  if c[s] >= 1:
    c.update[{s:-1}]
    
print(c.most_common()[0][1])

### FIXED CODE ###

n = int(input())
from collections import Counter
c = Counter()
for i in range(n):
  a = input()
  c.update({a:1})
  
m = int(input())
for i in range(m):
  s = input()
  if c[s] >= 1:
    c.update({s:-1})
    
print(c.most_common()[0][1])
N,L = list(map(int,input().split()))
A = list(range(L,L+N))
ans = sum(A)
if abs(A[0])>abs(A[N]):
  print(ans-A[N])
else:
  print(ans-A[0])

### FIXED CODE ###

N,L = list(map(int,input().split()))
A = list(range(L,L+N))
ans = sum(A)
mi = min(list(map(abs,A)))
if abs(A[0])==mi:
  print(ans-A[0])
elif abs(A[N-1])==mi:
  print(ans-A[N-1])
else:
  print(ans-mi)
s = input()
k = int(input())
s = list(s)
ind = 0
anss = [[] for i in range(100)]
for i in range(len(s)-1):
  anss[ind].append(s[i])
  if s[i] != s[i+1] and i != len(s)-2:
    ind += 1
  elif i == len(s)-2:
    ind += 1
#print(ind)
#print(anss)
for i in range(100-ind):
  anss.remove([])
#print(anss)
f = 0
pf = 0
if len(anss) == 0:
  anss.append([])
if s[0] == s[len(s)-1] and s[len(s)-2] == s[len(s)-1] and len(anss)>1 and k > 1:
  if len(anss[0]) % 2 == 1:
    pf = 1
  anss[0] += anss[len(anss)-1]
  anss.remove(anss[len(anss)-1])
  anss[0].append(s[len(s)-1])
  if len(anss[0]) % 2 == 0 and pf == 1 and len(anss) > 1:
    f = 1
elif s[0] == s[len(s)-1] and k > 1:
  if len(anss[0]) % 2 == 1:
    pf = 1
  anss[0].append(s[len(s)-1])
  if len(anss[0]) % 2 == 0 and pf == 1 and len(anss) > 1:
    #print(len(anss[0]),pf)
    f = 1
elif s[len(s)-2] == s[len(s)-1] and k > 1:
  anss[len(anss)-1].append(s[len(s)-1])
else:
  anss.append([s[len(s)-1]])
pans = 0
#print(anss)
for i in anss:
  pans += len(i) // 2
#print(f)
if len(anss) == 1 and len(anss[0]) % 2 == 1:
  print(len(list(s*k))//2)
elif f == 1:
  print(pans*k-1)
else:
  print(pans*k)

### FIXED CODE ###

s = input()
k = int(input())
s = list(s)
ind = 0
anss = [[] for i in range(100)]
for i in range(len(s)-1):
  anss[ind].append(s[i])
  if s[i] != s[i+1] and i != len(s)-2:
    ind += 1
  elif i == len(s)-2:
    ind += 1
#print(ind)
#print(anss)
for i in range(100-ind):
  anss.remove([])
#print(anss)
f = 0
pf = 0
if len(anss) == 0:
  anss.append([])
if s[0] == s[len(s)-1] and s[len(s)-2] == s[len(s)-1] and len(anss)>1 and k > 1:
  if len(anss[0]) % 2 == 1:
    pf = 1
  anss[0] += anss[len(anss)-1]
  anss.remove(anss[len(anss)-1])
  anss[0].append(s[len(s)-1])
  if len(anss[0]) % 2 == 0 and pf == 1 and len(anss) > 1:
    f = 1
elif s[0] == s[len(s)-1] and k > 1:
  if len(anss[0]) % 2 == 1:
    pf = 1
  anss[0].append(s[len(s)-1])
  if len(anss[0]) % 2 == 0 and pf == 1 and len(anss) > 1:
    #print(len(anss[0]),pf)
    f = 1
elif s[len(s)-2] == s[len(s)-1] and k > 1:
  anss[len(anss)-1].append(s[len(s)-1])
else:
  anss.append([s[len(s)-1]])
pans = 0
#print(anss)
for i in anss:
  pans += len(i) // 2
#print(f)
if len(anss) == 1 and len(anss[0]) % 2 == 1:
  print((len(s)*k)//2)
elif f == 1:
  print(pans*k-1)
else:
  print(pans*k)
a,b = map(int,input().split())
txt = input()
txt[b] = txt[b].lower
print(txt)

### FIXED CODE ###

a,b = map(int,input().split())
txt = list(input())
txt[b - 1] = txt[b - 1].lower()
print("".join(txt))
a,b = list(map(int, input().split()))
if a*500>=b:
  print("Yes)
else:
  print("No")

### FIXED CODE ###

a,b = list(map(int, input().split()))
if a*500>=b:
  print("Yes")
else:
  print("No")
n = input()
k = input()

ans = n - k + 1
print (ans)


### FIXED CODE ###

n,k=input().split()

n = int(n)
k = int(k)

ans = n - k + 1
print (ans)
n, k = map(int, input().split())
d = list(map(int, input().split()))
digit = [str(i) for i in range(10) if not i in d]
ans = []
stack = [i for i in digit]
while stack:
  s = stack.pop()
  if int(s) >= n:
    ans.append(s)
  else:
    for i in digit:
      if len(i+s) <= len(str(n)):
        stack.append(i+s)
print(min(ans))
      


### FIXED CODE ###

n, k = map(int, input().split())
d = list(map(int, input().split()))
digit = [str(i) for i in range(10) if not i in d]
ans = []
stack = [i for i in digit]
while stack:
  s = stack.pop()
  if int(s) >= n:
    ans.append(int(s))
  else:
    for i in digit:
      if len(i+s) <= len(str(n))+1:
        stack.append(i+s)

print(min(ans))
import numpy as np

n = int(input())
records= np.array([int(i) for i in input().split()])

enrolled = np.argsort(records)

attendance_num = [i+1 for i in range(len(records))]

attendance_order = attendance_num[enrolled]

print(attendance_order)

### FIXED CODE ###

import numpy as np

n = int(input())
records= np.array([int(i) for i in input().split()])

enrolled = np.argsort(records)

attendance_list = np.array([i+1 for i in range(n)])

attendance_order = np.array(attendance_list[enrolled]).tolist()

for i in attendance_order:
  print('{} '.format(i), end="")
print()
from math import ceil
N, K = map(int,input().split())
A = list(map(int,input().split()))
def chk(L):
    cnt = 0
    for i in range(N):
        cnt += ceil(A[i]/L)-1
    return cnt <= K
l, r = 1, max(A)
while l <= r:
    m = (l+r)//2
    if chk(m):
        r = m-1
    else:
        l = m+1
print(max([x for x in [l, r, m-1,m,m] if chk(x)]))

### FIXED CODE ###

from math import ceil
N, K = map(int,input().split())
A = list(map(int,input().split()))
def chk(L):
    cnt = 0
    for i in range(N):
        cnt += ceil(A[i]/L)-1
    return cnt <= K
l, r = 1, max(A)
while l <= r:
    m = (l+r)//2
    if chk(m):
        r = m-1
    else:
        l = m+1
print(min([x for x in [m-1,m,m+1] if x > 0 and chk(x)]))
t=input()
n=len(t)
a=[0]*n
for i in range(n):
    a[i]=t[i]

for i in range(n):
    if a[i]=="?":
        if i==0:
            a[i]="D"
        elif a[i-1]=="D" and a[i+1]=="D":
            a[i]="P"
        elif a[i-1]=="P":
            a[i]="D"
        else:
            a[i]="D"
    #print(a)

s=''.join(a)
print(s)

### FIXED CODE ###

t=input()
n=len(t)
a=[0]*n
for i in range(n):
    a[i]=t[i]

for i in range(n):
    if a[i]=="?":
        if i!=n-1:
            if a[i-1]=="D" and a[i+1]=="?":
                a[i]="P"
            elif a[i-1]=="P" and a[i+1]=="?":
                a[i]="D"
            elif a[i-1]=="D" and a[i+1]=="D":
                a[i]="P"
            else:
                a[i]="D"
        else:
            a[i]="D"
    #print(a)

s=''.join(a)
print(s)
H, N = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for _ in range(N)]
dp = [float('inf')] * 10**4
dp[0] = 0
for a, b in AB:
    for i in range(10**4 - a):
        dp[i + a] = min(dp[i + a], dp[i] + b)
print(min(dp[H:]))


### FIXED CODE ###

H, N = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for _ in range(N)]
dp = [float('inf')] * 10001
dp[0] = 0
for a, b in AB:
    for i in range(10001 - a):
        dp[i + a] = min(dp[i + a], dp[i] + b)
print(min(dp[H:]))
while True:
    try:
        n = int(input())
    except:
        break

    arr = []
    if n == 0:
        print(arr[-1])
        arr = arr[:-1]
    else:
        arr.append(n)

### FIXED CODE ###

arr = []

while True:
    try:
        n = int(input())
    except:
        break

    if n == 0:
        print(arr[-1])
        arr = arr[:-1]
    else:
        arr.append(n)
a, b = int(input().split()[0]), float(input().split()[1])

print(int(floor(a*b)))


### FIXED CODE ###

import math
import decimal

a, b = input().split()

a = int(a)
b = decimal.Decimal(b)

print(int(math.floor(a*b)))
s = list(input())

s.sort()
if s[0]==s[1] and s[2]==s[4]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = list(input())

s.sort()
if s[0]==s[1] and s[2]==s[3] and s[0]!=s[3]:
  print("Yes")
else:
  print("No")
N = int(input())
lis = [input() for i in range(N)]

 
tmp_dic = {}
for s in lis:
    if s not in tmp_dic:
        tmp_dic[s] = 1
    else:
        tmp_dic[s] += 1
        
max_count = 0
for k,v in tmp_dic.items():
    max_count = max(v,max_count)
    
ans_lis = []
for k,v in tmp_dic.items():
    if v == max_count:
        ans_lis.append(k)
        
ans_lis.sort()
[print(f"{s}") for s in ans_lis]

### FIXED CODE ###

lis = list(map(int, input().split(" ")))

tmp_dic = {}
for n in lis:
    if n not in tmp_dic:
        tmp_dic[n] = 1
    else:
        tmp_dic[n] += 1
        
if len(tmp_dic) == 2:
    print("Yes")
else:
    print("No")
n  =int(input())
s = input()
c = 0
t = []
t1 = []
for i in s:
	if i=='I':
		c+=1
		t.append(c)
	elif i=='D':
		c-=1
		t1.append(c)

print(max(max(t),max(t1)))

### FIXED CODE ###

n  =int(input())
s = input()
x = 0
c = 0
x1 = 0
t = []
for i in s:
	if i=='I':
		c+=1
	if c>x:
		x =c
	elif i=='D':
		c-=1
	if c>x1:
		x1=c

	t.append(max(x1,x))
print(max(t))
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)

b1 = [i[0] for i in c.items() if i[1] >= 4]
b2 = [i[0] for i in c.items() if 4 >= i[1] >= 2]
b = b1 + b2 

b.sort()
print(b[-1]*b[-2])

### FIXED CODE ###

from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)

b1 = [i[0] for i in c.items() if i[1] >= 4]
b2 = [i[0] for i in c.items() if i[1] >= 2]
b = b1 + b2 + [0,0]

b.sort()
print(b[-1]*b[-2])
X, K, D = map(int, input().split())

ans_list = []

if X+K*D <= 0:
    ans = abs(X+K*D)
else:
    if D>0:
        a = int((X+K*D)/(2*D))
        for i in range(-1,2):
            if a+i <= K and a+i >= 0:
                #ans_list.append(abs(X+(K-(a+i))*D - (a+i)*D))
                ans_temp = K-2*(a+i)
                ans_list.append(abs(X + ans_temp*D))
        ans = min(ans_list)
print(ans)

### FIXED CODE ###

X, K, D = map(int, input().split())
ans_list = []

if X+K*D <= 0:
    ans = abs(X+K*D)
else:
    a = (X+K*D)//(2*D)
    if a >= K:
        a = K
        ans = abs(X-K*D)
    else:
        ans_1 = abs(X+K*D-2*a*D)
        ans_2 = abs(X+K*D-2*(a+1)*D)
        ans = min(ans_1, ans_2)
print(ans)
#! -*- coding:utf-8 -*-
def gcd(a, b):
    if b == 0:
        return int(a)
    else:
        return int(gcd(int(b), int(a % b)))
 
def lcm(c, d):
    return int(int(c * d) / int(gcd(c, d)))

n = int(input())
k = []
for i in range(n):
    k.append(int(input()))

if n == 1:
    print(k[0])
else:
    p = lcm(k[0],k[1])
    for i in range(n):
        p = lcm(p,k[i])
    print(int(p))


### FIXED CODE ###

#! -*- coding:utf-8 -*-
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a
 
def lcm(a, b):
    return a * b // gcd(a, b)

n = int(input())
k = []
for i in range(n):
    k.append(int(input()))

if n == 1:
    print(k[0])
else:
    p = lcm(k[0],k[1])
    for i in range(n):
        p = lcm(p,k[i])
    print(int(p))
# coding: utf-8
# Your code here!
H,W=map(int,input().split())


def dfs(h,w,num):
    
    l[h][w]=min(l[h][w],num)
    
    if h>0:
        if A[h-1][w]!="#" and l[h-1][w]>num:
            dfs(h-1,w,num+1)
    if w>0:
        if A[h][w-1]!="#" and l[h][w-1]>num:
            dfs(h,w-1,num+1)
    if h<H-1:
        if A[h+1][w]!="#" and l[h+1][w]>num:
            dfs(h+1,w,num+1)
    if w<W-1:
        if A[h][w+1]!="#" and l[h][w+1]>num:
            dfs(h,w+1,num+1)
    
    return 0


A=[]
for _ in range(H):
    A.append(list(input()))

#print(A)

l=[[10**9]*W for i in range(H)]

for h in range(H):
    for w in range(W):
        if A[h][w]=="#":
            dfs(h,w,0)
ans=0
for item in l:
    ans=max(ans,max(item))

#print(l)
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!
H,W=map(int,input().split())


def dfs(h,w):
    A[h][w]="#"
    que=[]
    if h>0:
        if A[h-1][w]!="#":
            que.append([h-1,w])
            A[h-1][w]="#"
    if w>0:
        if A[h][w-1]!="#":
            que.append([h,w-1])
            A[h][w-1]="#"
    if h<H-1:
        if A[h+1][w]!="#":
            que.append([h+1,w])
            A[h+1][w]="#"
    if w<W-1:
        if A[h][w+1]!="#":
            que.append([h,w+1])
            A[h][w+1]="#"
    
    return que


A=[]
for _ in range(H):
    A.append(list(input()))

#print(A)

ans=0
lis=[]
for h in range(H):
    for w in range(W):
        if A[h][w]=="#":
            lis.append([h,w])
while True:
    pre=[]
    if lis:
        N=len(lis)
        lis=lis[::-1]
        for i in range(N):
            item=lis.pop(-1)
            pre+=dfs(item[0],item[1])
        lis=pre
    if len(lis)==0:
        break
    ans+=1
    #print(lis)
    #print(A)
    
print(ans)
A,　B, C, = taple(map(int, input().split()))
if (A - B) >= C:
  	print(0)
else:
  	print(C - (A - B))

### FIXED CODE ###

A, B, C, = tuple(map(int, input().split()))
if (A - B) >= C:
  	print(0)
else:
  	print(C - (A - B))
from collections import defaultdict
n = int(input())
aa = list(map(int, input().split()))

if n % 3 != 0:
    if all(map(lambda x: x == 0, aa)):
        print('Yes')
    else:
        print('No')
    exit(0)
m = n // 3

cnt_map = defaultdict(int)
for a in aa:
    cnt_map[a] += 1

if len(cnt_map.keys()) > 3:
    print('No')
elif len(cnt_map.keys()) == 1:
    k = cnt_map.keys()[0]
    if k == 0:
        print('Yes')
    else:
        print('No')
elif len(cnt_map.keys()) == 2:
    k1, k2 = cnt_map.keys()
    if k1 > k2:
        k1, k2 = k2, k1
    if k1 == 0 and cnt_map[k1] == m:
        print('Yes')
    else:
        print('No')
elif len(cnt_map.keys()) == 3:
    a, b, c = cnt_map.keys()
    if a == b ^ c and cnt_map[a] == m and cnt_map[b] == m and cnt_map[c] == m:
        print('Yes')
    else:
        print('No')


### FIXED CODE ###

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

if n % 3 != 0:
    if all(map(lambda x: x == 0, aa)):
        print('Yes')
    else:
        print('No')
else:
    m = n // 3

    cnt_map = {}
    for a in aa:
        if a not in cnt_map:
            cnt_map[a] = 0
        cnt_map[a] += 1

    if len(cnt_map.keys()) > 3:
        print('No')
    elif len(cnt_map.keys()) == 1:
        k = list(cnt_map.keys())[0]
        if k == 0:
            print('Yes')
        else:
            print('No')
    elif len(cnt_map.keys()) == 2:
        k1, k2 = cnt_map.keys()
        if k1 > k2:
            k1, k2 = k2, k1
        if k1 == 0 and cnt_map[k1] == m:
            print('Yes')
        else:
            print('No')
    elif len(cnt_map.keys()) == 3:
        a, b, c = cnt_map.keys()
        if a == b ^ c and cnt_map[a] == m and cnt_map[b] == m and cnt_map[c] == m:
            print('Yes')
        else:
            print('No')
# -*- coding: utf-8 -*-
import numpy as np

def mk_prime_list(num):
    num_list = np.array(range(2, num + 1))
    prime_list = np.array([])

    i = num_list[0]
    while i <= np.sqrt(num):
        prime_list = np.append(prime_list, i)
        num_list = num_list[~(num_list % i == 0)]
        i = num_list[0]

    return prime_list


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

if a > b:
    max_num = a
else:
    max_num = b

num_list = np.array(range(2, max_num + 1))
#prime_list = np.array([])

ans = 1
i = num_list[0]
while i <= np.sqrt(max_num):
    if a % i == 0 and b % i == 0:
        ans += 1
    num_list = num_list[~(num_list % i == 0)]
    i = num_list[0]

#prime_list = mk_prime_list(max_num)
#print(prime_list)

#ans = 1

#for i in prime_list:
#    if a % i == 0 and b % i == 0:
#        ans += 1

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import numpy as np

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

soin_a = np.array([], dtype='int')
for i in range(2, int(np.sqrt(a)) + 1):
    if a % i == 0:
        soin_a = np.append(soin_a, i)
        while a % i == 0:
            a //= i
if a != 1:
    soin_a = np.append(soin_a, a)

soin_b = np.array([], dtype='int')
for i in range(2, int(np.sqrt(b)) + 1):
    if b % i == 0:
        soin_b = np.append(soin_b, i)
        while b % i == 0:
            b //= i
if b != 1:
    soin_b = np.append(soin_b, b)

ans = 1
for j in soin_a:
    if soin_b[soin_b == j].size != 0:
        ans += 1

print(ans)
s=input().split()
if s[1]-2*s[2]<0:
  print(0)
else:
  print(s[1]-2*s[2])

### FIXED CODE ###

s=list(map(int,input().split()))
if s[0]-2*s[1]<0:
  print(0)
else:
  print(s[0]-2*s[1])
while True:
    h,w=map(int, input().split())
    if h==w== 0:break
    print('#' * w)
    print('#' + '.'*(w-2) + '#\n')*(h-2)
    print('#'*w + '\n')

### FIXED CODE ###

while True:
    h,w=map(int, input().split())
    if h==w== 0:break
    print('#' * w + '\n' + ('#' + '.' * (w-2) + '#\n')*(h-2) +'#'* w + '\n')
Sd = input()
T = input()

r_Sd = Sd[::-1]
r_T = T[::-1]

for i in range(len(Sd)- len(T)):
    temp_words = r_Sd[i:i+len(T)]
    res = r_Sd[0:i] + ''
    for j in range(len(T)):
        if temp_words[j] == '?' or temp_words[j] == r_T[j]:
            res+=r_T[j]
        else:
            break
    else:
        res = res + r_Sd[i+len(T):]
        break
else:
    print('UNRESTORABLE')

print(res.replace('?', 'a')[::-1])

### FIXED CODE ###

def resolve():
    '''
    code here
    '''
    S_dash = input()
    T = input()

    is_flag = False

    res = ''
    res_list = ['zzzzz']
    for i in range(len(S_dash) - len(T) +1):
        res = S_dash[:i]
        # print(i, res)
        if len(S_dash) - len(res) >= len(T):
            for j in range(len(T)):
                if S_dash[i+j] == T[j] or S_dash[i+j] == '?':
                    res += T[j]
                else:
                    # print('bk')
                    break
            else:
                is_flag = True
                res += S_dash[i+len(T):]
                res_list.append(res)


    # print(res_list)

    res2_list = []
    for res in res_list:
        res = res.replace('?','a')
        res2_list.append(res)

    res2_list.sort()
    res = res2_list[0]

    print(res) if is_flag else print('UNRESTORABLE')     

if __name__ == "__main__":
    resolve()
A,B = map(int,input().split())

if B%A = 0 :
	print(A+B)
else :
	print(B-A)

### FIXED CODE ###

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

if B%A == 0 :
	print(A+B)
else :
	print(B-A)
A = int(input())
B = int(input())
C = int(input())

if B+C > A :
  print(C-(A-B))
  
else:
  print(0)

### FIXED CODE ###

a,b,c = map(int, input().split())
 
if b+c > a :
  print(c-(a-b))
  
else:
  print(0)
nn = int(input())
x = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if x != 3:
        if d1 != d2:
            x = 0
        else:
            x += 1
print("Yes" if x == 3 else "No")

### FIXED CODE ###

n = int(input())
x = 0
for i in range(n):
    d1, d2 = map(int, input().split())
    if x != 3:
        if d1 != d2:
            x = 0
        else:
            x += 1
print("Yes" if x == 3 else "No")
import sys

args = sys.argv

length = arg[1]
focus = arg[2]
abcs = arg[3]

def change_upper_to_lower(str, num):
  if(str[num] == "A"):
    str[num] == "a"
  elif(str[num] == "B"):
    str[num] == "b"
  else:
    str[num] == "c"
    
change_upper_to_lower(abcs, focus)

print(abcs)

### FIXED CODE ###

import sys

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

abcs = input()
 
def change_upper_to_lower(str, num):
  
  before = str[:int(num) - 1]
  after = str[int(num):]

  if(str[int(num) - 1] == "A"):
    newstr = before + "a" + after
  elif(str[int(num) - 1] == "B"):
    newstr = before + "b" + after
  else:
    newstr = before + "c" + after
    
  return newstr
 
 
changed_abcs = change_upper_to_lower(abcs, b)
 
print(changed_abcs)
s=set(input().split())
a='abcdefghijklmnopqrstuvwxyz'
b=set()
for i in range(26):
    b+=a[i]
if s==b:
    print('None')
else:
    print(b-s)


### FIXED CODE ###

s=set(list(input()))
a=set(list('abcdefghijklmnopqrstuvwxyz'))

if s==a:
    print('None')
else:
    b=sorted(list(a-s))
    print(str(b[0]))