Harryxun/stf_run huggingface dataset:
n = int(input())
aL = sorted(list(set(list(map(int, input().split(" "))))))

dp = [False for _ in range(100002)]

if len(aL) == 1 and n != 1:
    print(0)
    exit()

ans = 0
for a in aL:
    if not dp[a]:
        ans += 1
    c = 1
    while a * c <= 100000:
        dp[a * c] = True
        c += 1

print(ans)


### FIXED CODE ###

n = int(input())
aL = sorted(list(map(int, input().split(" "))))
# aL = sorted(list(set(aLP)))

dp = [False for _ in range(1000001)]

d = {}
for a in aL:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1

ans = 0
for a in aL:
    if dp[a]:
        continue
    if d[a] > 1:
        c = 1
        while a * c <= 1000000:
            dp[a * c] = True
            c += 1
        continue
    ans += 1

    c = 1
    while a * c <= 1000000:
        dp[a * c] = True
        c += 1

print(ans)
N, K = map(int, input().split())
import math

ttl = math.factorial(N)/(math.factorial(N-K)*math.factorial(K))
l = []
for i in range(K):
  ans = math.factorial(i+1+N-K)/((math.factorial(N-K))*(math.factorial(i+1)))
  ttl -= ans
  if ttl < 0:
    ans += ttl
  l.append(ans)

for j in l:
  print(int(j%(10^9+7)))


### FIXED CODE ###

N, K = map(int, input().split())
import math
mod =10**9+7

l = []
l.append(N-K+1)
for i in range(1, K):
  a = l[i-1] * (N-K-i+1) * (K-i) // ((i+1)*i)
  l.append(int(a))

for j in l:
  print(j%mod)
# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


def solve():
    for cx in range(101):
        for cy in range(101):
            ch = D[0][0] + abs(D[0][1] - cx) + abs(D[0][2] - cy)
            for h, x, y in D:
                if h != ch - (abs(x - cx) + abs(y - cy)):
                    break
            else:
                return cx, cy, ch


if __name__ == '__main__':
    N = int(input())
    D = []
    for i in range(N):
        x, y, h = inpl()
        D.append([h, x, y])

    h_min = max(D)[0]
    ans = solve()
    print(' '.join(map(str, ans)))


### FIXED CODE ###

# coding:utf-8

INF = float('inf')


def inpl(): return list(map(int, input().split()))


def solve():
    for x in range(101):
        for y in range(101):
            for h in range(h_min, h_min + 201):
                for i in range(N):
                    if D[i][0] != max(h - abs(D[i][1] - x) - abs(D[i][2] - y), 0):
                        break
                else:
                    return x, y, h


if __name__ == '__main__':
    N = int(input())
    D = []
    for i in range(N):
        x, y, h = inpl()
        D.append([h, x, y])

    h_min = max(D)[0]
    ans = solve()
    print(' '.join(map(str, ans)))
N, K = [int(i) for i in input().split(' ')]

prev = N

if N == 0:
  print( N)
else:
  while True:
    if prev == 0:
      print(prev)
      break
    elif abs() >= prev:
      print(prev)
      break
    else
      N = abs()
      prev = N




### FIXED CODE ###

N, K = [int(i) for i in input().split(' ')]

def res():
  if N == K:
    return 0
  elif N > K:
    return N % K if K - (N % K) > (N % K) else K - (N % K)
  else :
    return abs(N - K) if abs(N - K) < abs(abs(N-K) - K) else abs(abs(N-K) - K)

print(res())
input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(K):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)

### FIXED CODE ###

input_line=input().split(" ")
N,K=int(input_line[0]),int(input_line[1])
P=input().split(" ")
cumsum=[0]
tol=0
for i in range(N):
    P[i]=(int(P[i])+1)/2
    tol=tol+P[i]
    cumsum.append(tol)
    
k_sum=[]

for i in range(N-K+1):
  k_sum.append(cumsum[i+K]-cumsum[i])  

ans=max(k_sum)
print(ans)
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

# いずれか2つの数字のGCDが1 必ずTrue
# いずれか2つの数字のGCDが2 かつ Ai - K % 2 == 0 のものが存在する場合 True
# いずれか2つのGCDが計算できれば、答えが導けるが、いずれか2つの組み合わせはA * (A-1) // 2通りあるから間に合わない
# 累積GCDで1になる → どうにかこうにか1にできる
# 累積GCDで2になる → どの組み合わせをとっても2にしかならない


def main():
    ma = max(A)
    if ma < K:
        return False
    if K in A:
        return True
    gcd = A[0]
    for a in A:
        gcd = math.gcd(gcd, a)
    for a in A:
        if (a-K) % gcd == 0:
            return True
    return False
    

if main():
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

def gcd(x, y):
    '''
    最大公約数の計算
    '''
    if y == 0:
        return x
    return gcd(y, x % y)
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

# いずれか2つの数字のGCDが1 必ずTrue
# いずれか2つの数字のGCDが2 かつ Ai - K % 2 == 0 のものが存在する場合 True
# いずれか2つのGCDが計算できれば、答えが導けるが、いずれか2つの組み合わせはA * (A-1) // 2通りあるから間に合わない
# 累積GCDで1になる → どうにかこうにか1にできる
# 累積GCDで2になる → どの組み合わせをとっても2にしかならない


def main():
    ma = max(A)
    if ma < K:
        return False
    if K in A:
        return True
    g = A[0]
    for a in A:
        g = gcd(g, a)
    for a in A:
        if (a-K) % g == 0:
            return True
    return False


if main():
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
k = int(input())
a = list(range(1,10))
for i in a:
     if k in / i >= 10:
             print("No")
     else:
             print("Yes")

### FIXED CODE ###

k = int(input())
for i in range(1,10):
    if k // i <= 9 and k % i == 0:
       print("Yes")
       exit()
     
print("No")
a,b=map(int,input().split())
if (a%2=1) and (b%2=1):
    print('Odd')
else:
    print('Even')

### FIXED CODE ###

a,b=map(int,input().split())
if (a%2==1) and (b%2==1):
    print('Odd')
else:
    print('Even')
n,m=map(int,input().split())
a=[list(map(int,input().split())) for i in range(m)]
ikeruheya = [[] for i in range(n)]
ans = [0]*(n+1)
check = [0]*n
check[0]=1
for i in range(m):
    ikeruheya[a[i][0]-1].append(a[i][1])
    ikeruheya[a[i][1]-1].append(a[i][0])
print(ikeruheya)
    
next=[1]
count = 1
while len(next) != 0 and count <= n:
    imaheya = next.pop(0)
    for j in range(len(ikeruheya[imaheya-1])):
        print(ikeruheya[imaheya-1])
        if check[ikeruheya[imaheya-1][j]-1]==0:
            ans[ikeruheya[imaheya-1][j]]= imaheya 
            check[ikeruheya[imaheya-1][j]-1] = 1
            next.append(ikeruheya[imaheya-1][j])
            count += 1
            
print("Yes")
for i in range(2, n+1):
    print(ans[i])

print(check)
print(count)
    
    
    


### FIXED CODE ###

from collections import deque
n,m = map(int,input().split())
a=[list(map(int, input().split())) for i in range(m)]
b=[[] for j in range(n)] 

michi=[-1]*(n)
michi[0]=0
heya=[]


for i in range(m):
    b[a[i][0]-1].append(a[i][1])
    b[a[i][1]-1].append(a[i][0])



heya.append(1)


while len(heya):
    now=heya.pop(0)-1
    
    for i in range(len(b[now])):
        if michi[b[now][i]-1] == -1:
            heya.append(b[now][i])
            michi[b[now][i]-1] = now+1
print("Yes")
for i in range(1,n):
    print(michi[i])
from collections import deque
N, Q = map(int, input().split())
root = [[] for i in range(5)]
ans = [0]*N

for i in range(N-1):
  a, b = map(int, input().split())
  root[a-1].append(b)
  
for i in range(Q):
  p, x = map(int, input().split())
  ans[p-1] += x
  
now = 1
visit = deque([1])
while len(visit) < N:
  if root[now-1] == []:
    now = visit[visit.index(now)-1]
  else:
    go = root[now-1][0]
    root[now-1].pop(0)
    visit.append(go)
    ans[go-1] += ans[now-1]
    now = go
    
print(' '.join(map(str, ans)))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
inf = 10**17
mod = 10**9+7


n, q = map(int, input().split())
g = [[] for _ in range(n)]
val = [0] * n

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

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

seen = [False] * n
def dfs(v):
    seen[v] = True
    for nv in g[v]:
        if seen[nv]:
            continue
        val[nv] += val[v]
        dfs(nv)

dfs(0)
print(*val)
h,n=map(int,input().split())
a=list(map(int,input().split())
damage=sum(a)
if damage>=h:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

h,n=map(int,input().split())
a=list(map(int,input().split()))
damage=sum(a)
if damage>=h:
    print("Yes")
else:
    print("No")
al=[chr(ord('a') + i) for i in range(26)]
def dfs2(N, f):
    if len(f) == N:
        return f
    else:
        result = ""
        f_index = [al.index(i) for i in f]
        for i in range(max(f_index) +1 + 1):#追加できるのは(f+1) + 1
            result +=dfs(N,  f + al[i])
        return result

N = int(input())
ans = dfs2(N, 'a')
for i in range(int(len(ans) / N)):
    print(ans[N*i : N * (i+1)])

### FIXED CODE ###

al=[chr(ord('a') + i) for i in range(26)]
def dfs(N, f):
    if len(f) == N:
        return f
    else:
        result = ""
        f_index = [al.index(i) for i in f]
        for i in range(max(f_index) +1 + 1):#追加できるのは(f+1) + 1
            result +=dfs(N,  f + al[i])
        return result

N = int(input())
ans = dfs(N, 'a')
for i in range(int(len(ans) / N)):
    print(ans[N*i : N * (i+1)])
sumu,x,y=(map(int,input.split()))
minum=max(x+y-sumu,0)
maxim=min(x,y)
print(maxim,minum)

### FIXED CODE ###

N,A,B=map(int,input().split())
#the max
print(min(A,B),max(0,A+B-N))
while True:
    height, width = [int(x) for x in input().split(" ")]
    if height == width == 0:
        break
    col1 = "#." * 150
    col2 = ".#" * 150
    col_set = col,1[:width] + "\n" + col1[:width] + "\n"
    print(col_set * (height // 2) + (col1[:width] + "\n") * (height % 2))

### FIXED CODE ###

while True:
    h, w = map(int,input().strip().split())
    if h == w == 0: break
    for y in range(h):
        print(''.join('#.'[(x + y) % 2] for x in range(w)))
    print()
x,a,b = map(int, input().split())

if abs(x-a) > abs(x-b):
    print(B)
else:
    print(A)

### FIXED CODE ###

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

if abs(x-a) > abs(x-b):
    print('B')
else:
    print('A')
main():
  n = int(input())
  print(n**3)

if __name__ == '__main__':
  main()

### FIXED CODE ###

def main():
  n = int(input())
  print(n**3)
 
if __name__ == '__main__':
  main()
a,b=map(int, input(),split)
print(a*b)

### FIXED CODE ###

a,b=map(int,input().split())
print(int(a)*int(b))
N, Y = map(int, input().split())
res_x = -1, res_y = -1, res_z = -1
for x in range(N):
  for j in range(N-x):
    z = N - x - y
    if 10000 * x + 5000 * y + 1000 * z == Y:
      res_x = x
      res_y = y
      res_z = z
print('{} {} {}'.format(res_x, res_y, res_z))

### FIXED CODE ###

N, Y = map(int, input().split())
res_x = -1
res_y = -1
res_z = -1
for x in range(N+1):
  for y in range(N-x+1):
    z = N - x - y
    if 10000 * x + 5000 * y + 1000 * z == Y:
      res_x = x
      res_y = y
      res_z = z
print('{} {} {}'.format(res_x, res_y, res_z))
num_input = [input() for i in range(2)]
x = int(num_input[0].split()[0])
n = int(num_input[0].split()[1])

num_list = [int(n) for n in num_input[1].split()]
num_list.sort()

ans=x

if n!=0:
    if x in num_list:
        index=num_list.index(6)
        index_left=index-1
        index_right=index+1
        value_left=x-1
        value_right=x+1
        
        for i in range(n):
            if num_list[index_left]!=value_left:
                ans=value_left
                break
            elif num_list[index_right]!=value_right:
                ans=value_right
                break
            index_left=index_left-1
            index_right=index_right+1
            value_left=value_left-1
            value_right=value_right+1

print(ans)

### FIXED CODE ###

num_input = [input() for i in range(2)]
x = int(num_input[0].split()[0])
n = int(num_input[0].split()[1])

num_list = [int(n) for n in num_input[1].split()]
num_list.sort()

ans=x

if n!=0 and n!=1 and n!=100:
    if x in num_list:
        index=num_list.index(x)

        value_left=x-1
        value_right=x+1

        if index!=0:
            index_left=index-1
        if index!=n-1:
            index_right=index+1
        
        if index==0:
            ans=x-1
        elif index==n-1:
            if num_list[index-1]==x-1:
                ans=x+1
            else:
                ans=x-1
        else:
            for i in range(n):
                if num_list[index_left]!=value_left:
                    ans=value_left
                    break
                elif num_list[index_right]!=value_right:
                    ans=value_right
                    break
                if index_left!=0:
                    index_left=index_left-1
                if index_right!=n:
                    index_right=index_right+1
                value_left=value_left-1
                value_right=value_right+1

if n==1:
    ans=x-1

if n==100:
    if x<=50:
        ans=0
    if x>50:
        ans=101

print(ans)
#coding: UTF-8
#@document_it
import numpy as np

def document_it(func):
  def new_function(*args,**kwargs):
    print('Running function:', func.__name__)
    print('Positional arguments:', args)
    print('Kewword arguments:', kwargs)
    result = func(*args,**kwargs)
    print('Result:', result)
    return result
  return new_function

#@document_it
def bsearch(v,list,l=None):
  if l == 0 or list == []:
    return False
  if l==None:
    l = len(list)
  
  import math
  T = math.ceil(math.log2(l))
  t = 0
  wid = l
  offset = 0
  while t <= T:
    if wid == 0:
        return False
    pos = wid//2 + offset
    w = list[pos]
    if wid == 1:
        if v == w:
            return True
        else:
            return False
    else:
        if v == w:
            return True
        elif v < w:
            wid = wid//2
        else:
            wid = wid//2 - 1 + wid%2
            offset = pos + 1
    t+=1



def exe():
    n = int(input())
    S = list(map(int,input().split()))
    q = int(input())
    T = map(int,input().split())
    ans = 0

    for t in T:
        if bsearch(t,S,n):
            ans += 1

    print(ans)

if __name__ == '__main__':
    exe()
    
  


### FIXED CODE ###

#coding: UTF-8
#@document_it

def document_it(func):
  def new_function(*args,**kwargs):
    print('Running function:', func.__name__)
    print('Positional arguments:', args)
    print('Kewword arguments:', kwargs)
    result = func(*args,**kwargs)
    print('Result:', result)
    return result
  return new_function

#@document_it
def bsearch(v,list,l=None):
  if l == 0 or list == []:
    return False
  if l==None:
    l = len(list)
  
  import math
  T = math.ceil(math.log2(l))
  t = 0
  wid = l
  offset = 0
  while t <= T:
    if wid == 0:
        return False
    pos = wid//2 + offset
    w = list[pos]
    if wid == 1:
        if v == w:
            return True
        else:
            return False
    else:
        if v == w:
            return True
        elif v < w:
            wid = wid//2
        else:
            wid = wid//2 - 1 + wid%2
            offset = pos + 1
    t+=1



def exe():
    n = int(input())
    S = list(map(int,input().split()))
    q = int(input())
    T = map(int,input().split())
    ans = 0

    for t in T:
        if bsearch(t,S,n):
            ans += 1

    print(ans)

if __name__ == '__main__':
    exe()
n,c = [int(i) for i in input().split()]
d = [] 
for i in range(c):
    d.append(list(map(int, input().split())))
color = []
for i in range(n):
    color.append(list(map(int, input().split())))
for i in range(n):
    for j in range(n):
        color[i][j] -= 1
dofc = [[0 for i in range(3)] for j in range(c)]
for t in range(3):
    for a in range(c):
        for l in range(n):
            for row in range(n):
                dofc[a][(l+row)%3] += d[a][color[row][l]]
D = dofc[0][0]+dofc[1][1]+dofc[2][2]
for c0 in range (c):
    for c1 in range (c):
        if c1 == c0:
            continue
        for c2 in range (c):
            if c2 == c1 or c2 == c0:
                continue
            D = min(D,dofc[c0][0]+dofc[c1][1]+dofc[c2][2])
print(D)

### FIXED CODE ###

num = input()
num = int(num)
if num <= 999 and num >= 0 :
    print('ABC')
elif num >= 1000 and num <= 1998 :
    print('ABD')
import fraction

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

a_min = min(a)
ans = 1e10
for i in a:
    tmp = fraction.gcd(a_min, i)
    if(tmp < ans): ans = tmp

print(ans)

### FIXED CODE ###

import fractions

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

a_min = min(a)
ans = 1e10
for i in a:
    tmp = fractions.gcd(a_min, i)
    if(tmp < ans): ans = tmp

print(ans)
N,K = map(int, raw_input().split(" "))

points = []
pointsx = []
pointsy = []

smin = 0

for i in range(N):
    x,y = map(int, raw_input().split(" "))
    pointsx.append(x)
    pointsy.append(y)

spx = sorted(pointsx)

for i in range(N-K+1):
    for h in range(N-K-i+1):
        yneed = []
        for k in range(N):
            if pointsx[k]>=spx[i] and pointsx[k]<=spx[i+K+h-1]:
                yneed.append(pointsy[k])
        spy = sorted(yneed)
        ylength = 0
        xlength = spx[i+K+h-1]-spx[i]
        for k in range(len(spy) - K + 1):
            if ylength < spy[k+K-1]-spy[k]: ylength = spy[k+K-1]-spy[k]
        if smin == 0: smin = ylength * xlength
        elif smin > ylength * xlength:
            smin = ylength * xlength


print smin


### FIXED CODE ###

a,b,c = map(int, raw_input().split(" "))
if a == b:
    print c
elif b == c:
    print a
else: print b
6
0 6 7 6 7 0

### FIXED CODE ###

from collections import deque
n=int(input())
a=list(map(int,input().split()))
b=deque(maxlen=2*10**5)
if n%2==0:
  for i in range(n):
    if i%2==1:
      b.appendleft(a[i])
    else:
      b.append(a[i])
else:
  for j in range(n):
    if j%2==0:
      b.appendleft(a[j])
    else:
      b.append(a[j])
print(*b)
# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

N,Q = map(int, input().split())
s = str(input())
T = []
D = []
for i in range(Q):
    t,d = map(str,input().split())
    T.append(t)
    D.append(d)

T.reverse()
D.reverse()

nl = 0
nr = N-1
L = []#回収できた分
R = []
for i in range(Q):
    if D[i]=="R":
        if s[nr] == T[i]:
            L.append(s[nr])
            nr -= 1
        elif len(R)>0:
            if R[-1] == s[nr]:
                R.pop()
                nr += 1

    else:
        if s[nl] == T[i]:
            R.append(s[nl])
            nl += 1
        elif len(L)>0:
            if L[-1] == s[nl]:
                L.pop()
                nl -= 1

print(N-len(R)-len(L))



#
# print(N-len(L)-len(R))


### FIXED CODE ###

# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える

N,Q = map(int, input().split())
s = input()
td = [input().split() for i in range(Q)]

td.reverse()

nl = 0
nr = N-1
L = []
R = []
for i in td:#全ての指示
    # print(L,R)
    if i[1]=="L":
        if nl < N:
            if s[nl] == i[0]:
                L.append(i[0])
                nl += 1
            if len(R) != 0:
                if R[-1]==i[0]:
                    R.pop()
                    nr += 1
    else:
        if nr >= 0:
          if s[nr] == i[0]:
            R.append(i[0])
            nr -= 1
        if len(L) != 0:
          if L[-1] == i[0]:
            L.pop()
            nl -= 1

print(N-len(L)-len(R))
X = int(input())
for A in range(-150, 150):
    for B in range(-150, 150):
        if A**5 - B**5 == X:
            print(A, B)
            break
    else:
        continue
    break

### FIXED CODE ###

S = input()

if S == "ARC":
    print("ABC")
else:
    print("ARC")
a=int(input())
b=int(input())
print(a*b)
print(a*2+b*2)

### FIXED CODE ###

a,b = [int(i) for i in input().split()]
print(a*b,a*2+b*2)
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(0,N+1,2):
  if A[i]%2==1:
    ans+=1
print(ans)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(0,N,2):
  if A[i]%2==1:
    ans+=1
print(ans)
from sys import stdin
import numpy as np
n, m = map(int, raw_input().split())
# print(n)
vals_list = np.zeros((n, 2))
# print(vals_list)
for itr in range(n):
    a, b = map(int, raw_input().split())
    vals_list[itr][0], vals_list[itr][1] = a, b
sorted_vals_list = vals_list[np.argsort(vals_list[:, 0])]
# print(sorted_vals_list)

cnt = m
total_money = 0
for itr in range(n):
    if (cnt - sorted_vals_list[itr][1]) <= 0:
        total_money += sorted_vals_list[itr][0] * cnt
        break
    else:
        cnt -= sorted_vals_list[itr][1]
        total_money += sorted_vals_list[itr][0] * sorted_vals_list[itr][1]
print(total_money)

### FIXED CODE ###

from sys import stdin
import numpy as np
n, m = (int(i) for i in input().rstrip().split())
# print(n)
vals_list = np.zeros((n, 2))
# print(vals_list)
for itr in range(n):
    a, b = (int(i) for i in input().rstrip().split())
    vals_list[itr][0], vals_list[itr][1] = a, b
sorted_vals_list = vals_list[np.argsort(vals_list[:, 0])]
# print(sorted_vals_list)

cnt = m
total_money = 0
for itr in range(n):
    if (cnt - sorted_vals_list[itr][1]) <= 0:
        total_money += sorted_vals_list[itr][0] * cnt
        break
    else:
        cnt -= sorted_vals_list[itr][1]
        total_money += sorted_vals_list[itr][0] * sorted_vals_list[itr][1]
print(int(total_money))
import numpy as np

N = int(input)

digit = int(np.log10(N).round()+1)
cnt = 0

for x in range(digit):
    x += 1
    if x % 2 != 0:
        if x < digit:
            cnt += (10**x) - (10**(x-1))
        else:
            cnt += N - (10**(x-1)) + 1
print('{}'.format(cnt))

### FIXED CODE ###

N = int(input())
# %%

digit = len(str(N))
cnt = 0

for x in range(digit):
    x += 1
    if x % 2 != 0:
        if x < digit:
            cnt += (10**x) - (10**(x-1))
        else:
            cnt += N - (10**(x-1)) + 1

print('{}'.format(cnt))
#!/usr/bin/env python3

import sys

DEBUG = False


def read_int_list(sep = " "):
    return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]

def read_int():
    return int(sys.stdin.readline())

def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return

def solve(s, t):
    if len(t) > len(s):
        return None
    ans = None
    for i in range(0, len(s) - len(t) + 1):
        dprint(f"i: {i}")
        can_insert = True
        for j in range(0, len(t)):
            pos = i + j
            dprint(f"pos: {pos}, j: {j}")
            if s[pos] != '?' and s[pos] != t[j]:
                dprint(f"cannot insert")
                can_insert = False
                break
        if not can_insert:
            continue
        inserted = s[0:i] + t + s[i + len(t) + 1:]
        dprint(f"inserted: {inserted}")
        inserted = inserted.replace("?", "a")
        if ans is None or inserted < ans:
            ans = inserted
    if ans is None:
        return "UNRESTORABLE"
    return ans


def main():
    s = sys.stdin.readline().rstrip()
    t = sys.stdin.readline().rstrip()
    print(solve(s, t))
    



if __name__ == "__main__":
    main()

### FIXED CODE ###

#!/usr/bin/env python3

import sys

DEBUG = False

def read_int_list(sep = " "):
    return [int(s) for s in sys.stdin.readline().rstrip().split(sep)]

def read_int():
    return int(sys.stdin.readline())

def dprint(*args, **kwargs):
    if DEBUG:
        print(*args, **kwargs)
    return

def solve(s, t):
    if len(t) > len(s):
        return "UNRESTORABLE"

    ans = None
    for i in range(0, len(s)):
        can_insert = True
        for j in range(0, len(t)):
            pos = i + j
            if pos >= len(s) or (s[pos] != '?' and s[pos] != t[j]):
                can_insert = False
                break
        if not can_insert:
            continue
        inserted = s[0:i] + t + s[i + len(t):]
        inserted = inserted.replace("?", "a")

        if ans is None or inserted < ans:
            ans = inserted

    if ans is None:
        return "UNRESTORABLE"
    return ans


def main():
    s = sys.stdin.readline().rstrip()
    t = sys.stdin.readline().rstrip()
    print(solve(s, t))
    

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

D = A % B
M = D
ok = False
for _ in range(B+1):
  if M == C:
    ok = True
	break
    
  M = (M + D) % B
  
if ok:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

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

D = A % B
M = D
ok = False
for _ in range(B+1):
  if M == C:
    ok = True
    break
    
  M = (M + D) % B
  
if ok:
  print('YES')
else:
  print('NO')