Harryxun/stf_run huggingface dataset:
import math

S = input().split(" ")
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])
E = int(S[4])
F = int(S[5])

def calculate(a, b, c, d, e, f):
    result = []

    for x in range(math.ceil(f / (a * 100))):
        for y in range(math.ceil(f / (b * 100))):
            result.append([x, y])

    maxNondu = 0
    finalResult = []
    for res in result:
        m = 0
        waterValue = res[0] * 100 * a + res[1] * 100 * b
        while waterValue + m <= f:
            n = 0
            sugerValue = m * c + n * d
            while waterValue + sugerValue <= F:
                sugerValue = m * c + n * d
                if math.ceil(sugerValue / e) * 100 <= waterValue:
                    if sugerValue + waterValue > 0:
                        nondu = sugerValue * 100 / (sugerValue + waterValue)
                        if nondu > maxNondu:
                            maxNondu = nondu

                            finalResult = [waterValue + sugerValue, sugerValue]

                n = n + 1
            m = m + 1
    print("{} {}".format(finalResult[0],finalResult[1]))


calculate(A, B, C, D, E, F)


### FIXED CODE ###

S = input().split(" ")
A = int(S[0])
B = int(S[1])
C = int(S[2])
D = int(S[3])
E = int(S[4])
F = int(S[5])

def calculate(a, b, c, d, e, f):
    result = []

    memo = {}

    for x in range(0,31):
        for y in range(0,31):
            if a * x * 100 + b * y * 100 <= F:
                result.append([x, y])

    finalResult = []
    memo = {}

    for res in result:
        waterValue = res[0] * 100 * a + res[1] * 100 * b
        for m in range(0, 101):
            for n in range(0, 101):

                sugerValue = m * c + n * d

                if waterValue + sugerValue == 0:
                    break

                if waterValue + sugerValue > f:
                    break

                if (waterValue / 100 * e) < sugerValue:
                    break

                nondu = (sugerValue * 100) / (sugerValue + waterValue)
                memo[res[0],res[1],m,n] = nondu



    maxNonDu = max(memo.values())

    for k,v in memo.items():
        if v == maxNonDu:
            print(k[0]*a*100+k[1]*b*100+k[2]*c+k[3]*d,k[2]*c+k[3]*d)
            break

    memo.values()

calculate(A, B, C, D, E, F)
def cmb(n, k, mod, fac, ifac):
    """
    nCkを計算する
    """
    k = min(k, n-k)
    return fac[n] * ifac[k] * ifac[n-k] % mod

def make_tables(mod, n):
    """
    階乗テーブル、逆元の階乗テーブルを作成する
    """
    fac = [1, 1] # 階乗テーブル・・・(1)
    ifac = [1, 1] #逆元の階乗テーブル・・・(2)
    inverse = [0, 1] #逆元テーブル・・・(3)
    for i in range(2, n+1):
        fac.append((fac[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        ifac.append((ifac[-1] * inverse[-1]) % mod)
    return fac, ifac

mod = 10**9+7
n,k = map(int,input().split())
for i in range(1,k+1):
    fac,ifac = make_tables(mod,k-1)
    n_divide = cmb(k-1,i-1,mod,fac,ifac)
    fac,ifac = make_tables(mod,n-k+1)
    n_amari = cmb(n-k+1,i,mod,fac,ifac)
    print(n_amari*n_divide)


### FIXED CODE ###

class Combination():
    def __init__(self, n, mod=10**9+7):
        self.mod = mod
        self.fac = [1]*(n+1)
        for i in range(1,n+1):
            self.fac[i] = self.fac[i-1] * i % self.mod
        self.invfac = [1]*(n+1)
        self.invfac[n] = pow(self.fac[n], self.mod - 2, self.mod)
        for i in range(n-1, 0, -1):
            self.invfac[i] = self.invfac[i+1] * (i+1) % self.mod
 
    def combination(self, n, r):
        return self.fac[n] * self.invfac[r] % self.mod * self.invfac[n-r] % self.mod
 
    def permutation(self, n, r):
        return self.factorial(n) * self.invfactorial(n-r) % self.mod
 
    def factorial(self, i):
        return self.fac[i]
 
    def invfactorial(self, i):
        return self.invfac[i]

mod = 10**9+7
N,K = map(int,input().split())
ans_ls = [0] * K
c = Combination(N+K)
for i in range(K):
    Blocks = i+1
    #print('-----')
    #print('B:',Blocks)
    if N-K+1>=Blocks:
        Points = c.combination(N-K+1,Blocks)
    else:
        Points = 0
    #print('入れ方：',Points)
    Division = c.combination(K-1,Blocks-1)
    #print('分け方：',Division)
    ans_ls[i] = (Points*Division)%mod

for ans in ans_ls:
    print(ans)
D,T,S = map(input().split())
result = D / S
if T <= result :
  print('Yes')
else:
  print('No')  

### FIXED CODE ###

D,T,S = map(int,input().split())
result = D / S
if T >= result:
  print('Yes')
else:
  print('No')
from collections import defaultdict
import heapq


vertice,edge,source = map(int,input().split(" "))
link = defaultdict(dict)
weight = defaultdict(dict)
for e in range(edge):
    i,j,w = map(int,input().split(" "))
    link[i] = link.get(i,set()) | {j}
    weight[i].update({j:w})
#print(weight,link)
for v in range(vertice):
    goal = v
    queue = []
    heapq.heappush(queue,(0,source))
    heapq.heapify(queue)
    went = set()

    while queue != []:
        #print(queue)
        now_cost,here = heapq.heappop(queue)
        #print(now_cost,here,queue)
        if here == goal:
            print(now_cost)
            break

        can_go = link[here]
        not_went = can_go - went
        #print(v,here,now_cost,not_went,queue)
        for nw in not_went:
            next_cost = now_cost + weight[here][nw]
            heapq.heappush(queue,(next_cost,nw))
        went = went | {here}
    else:
        print("INF")

### FIXED CODE ###

import sys
from heapq import heappush, heappop
readline = sys.stdin.readline
from collections import defaultdict
vertices, edges, start = map(int, readline().split())
connect = defaultdict(list)
cost = defaultdict(dict)
answer = ["INF" for n in range(vertices)]
for _ in range(edges):
    s, t, w = map(int, readline().split())
    connect[s].append(t)
    cost[s].update({t:w})
 
 
now = start
weight = 0
p_queue = []
heappush(p_queue, (0, now))
visited = set()
while p_queue:
    weight, now = heappop(p_queue)
    if now in visited:
        continue
    visited |= {now}
    answer[now] = weight
    for c in connect[now]:
        if c not in visited:
            heappush(p_queue, (weight + cost[now][c], c))
for a in answer:
    print(a)
class Node:
        def __init__(self, index):
            self.count = 0
            self.fr = -1
            self.index = index
     
     
    N, Q = map(int, input().split())
    node = [Node(i) for i in range(N)]
    for i in range(N - 1):
        fr, to = map(int, input().split())
        node[to - 1].fr = fr - 1
     
    for i in range(Q):
        fr, c = map(int, input().split())
        node[fr - 1].count += c
     
    print(node[0].count, end=' ')
     
    for i in range(1, N):
        node[i].count += node[node[i].fr].count
        if not i == N:
            print(node[i].count, end=' ')
        else:
            print(node[i].count)

### FIXED CODE ###

class Node:
    def __init__(self, index):
        self.count = 0
        self.fr = -1
        self.index = index


N, Q = map(int, input().split())
node = [Node(i) for i in range(N)]
for i in range(N - 1):
    fr, to = map(int, input().split())
    node[to - 1].fr = fr - 1

for i in range(Q):
    fr, c = map(int, input().split())
    node[fr - 1].count += c

print(node[0].count, end=' ')

for i in range(1, N):
    node[i].count += node[node[i].fr].count
    if not i == N:
        print(node[i].count, end=' ')
    else:
        print(node[i].count)
S = input()

weather = ["Sunny", "Cloudy", "Rainly"]
print(weather[(weather.index(s)+1)%3])


### FIXED CODE ###


S = input()

weather = ["Sunny", "Cloudy", "Rainy"]
print(weather[(weather.index(S)+1)%3])
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from math import gcd
from functools import reduce


def solve(string):
    n, *a = map(int, string.split())
    return str(reduce(gcd, a))


if __name__ == '__main__':
    print(solve("4\n2 10 8 40"))


### FIXED CODE ###

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

from fractions import gcd
from functools import reduce


def solve(string):
    n, *a = map(int, string.split())
    return str(reduce(gcd, a))


if __name__ == '__main__':
    print(solve("\n".join([input(), input()])))
a,b,c,x = map(int,[input() for i in range(4)]
c = 0
for i in range(a+1):
    for j in range(b+1):
        for n in range(c+1):
            if t = i*500 + j*100 + n*50 == x:
                c = c + 1
print(c)
              

### FIXED CODE ###

a, b, c, x = map(int, [input() for i in range(4)])
count = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i*500 + j*100 + k*50 == x:
                count+=1
print(count)
import sys
import time
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
#import heapq
import math
start=time.time()
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n=ri()
a=rl()
t=0
for i in a:
    t^=i
t=bin(t)[2:]
max_len=max(len(bin(max(a)))-2,len(t))

if len(t)<max_len:t="0"+t
try:
    a=list(map(lambda x : bin(x)[2:],a))
except:
    sys.exit()
    
try:
    for i in range(n):
    if len(a[i])<max_len:
        a[i]="0"+a[i]
except:
    sys.exit()


#print(a)
ans=[[] for i in range(n)]
for i in range(max_len):
    for j in range(n):
        if a[j][i]==t[i]:
            ans[j].append("0")
        else:
            ans[j].append("1")
#print(ans)
for i in ans:
    print(int("".join(i), 2))


### FIXED CODE ###

import sys
import time
#from collections import deque, Counter, defaultdict
#from fractions import gcd
#import bisect
#import heapq
import math
start=time.time()
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))
n=ri()
a=rl()
t=0
for i in a:
    t^=i
t=bin(t)[2:]
max_len=max(len(bin(max(a)))-2,len(t))

if len(t)<max_len:t="0"*(max_len-len(t))+t
try:
    a=list(map(lambda x : bin(x)[2:],a))
except:
    sys.exit()
    
try:
    for i in range(n):
        if len(a[i])<max_len:
            a[i]="0"*(max_len-len(a[i]))+a[i]
except:
    sys.exit()


ans=[[] for i in range(n)]
for i in range(max_len):
    for j in range(n):  
            if a[j][i]==t[i]:
                ans[j].append("0")
            else:
                ans[j].append("1")

for i in ans:
    print(int("".join(i), 2))
a=int(input())
b=int(input())

if (a*b)%2==0:
    print("Even")

else:
    print("Odd")
 

### FIXED CODE ###

a,b=map(int,input().split()) #1行で1スペースあけて入力

if (a*b)%2==0:
    print('Even')
else:
    print('Odd')
A,B,C = map(int,input())

if A + B >= C:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

if A + B >= C:
    print('Yes')
else:
    print('No')
import heapq
import sys
sys.setrecursionlimit(10 ** 7)

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

event=[]
for _ in range(n):
    s,t,x=map(int,input().split())
    event.append([s-x,1,x])
    event.append([t-x,-1,x])

for i in range(q):
    event.append([int(input()),2,i])
event.sort()

ans=[0]*q

stop=set()
hq=[]
for e in event:
    t,op,x=map(lambda x:x,e)
    if op==1:
        heapq.heappush(hq,x)
        stop.add(x)
    elif op==-1:
        stop.remove(x)

    else:
        while hq and hq[0] not in stop:
            heapq.heappop(hq) 
        ans[x]=hq[0] if hq else -1
    
for x in ans:
    print(x)

### FIXED CODE ###

import sys

A,P=map(int,input().split())
print((A*3+P)//2)
n = input()
s = input()
x = 0
y = 0

for i in range(len(s)):
  if s[i] == "I":
    y += 1
    x = max(x,y)
  if s[i] == "D":
    y = y - 1
	x = max(x,y)
print(x)

### FIXED CODE ###

input()
s=input()
c,m=0,0
for i in range(len(s)):
    if s[i]=="I":
        c+=1
        m=max(c,m)
    if s[i]=="D":
        c=c-1
        m=max(c,m)
print(m)
import sys
input = sys.stdin.readline
from collections import *

class BIT:
    def __init__(self, n):
        self.n = n
        self.bit = [0]*(n+1)
    
    def add(self, i, x):
        i += 1
        
        while i<=self.n:
            self.bit[i] += x
            i += i&(-i)

    def acc(self, i):
        s = 0
        
        while i>0:
            s += self.bit[i]
            i -= i&(-i)
        
        return s

N, Q = map(int, input().split())
c = list(map(int, input().split()))
prev = [-1]*N
ys = defaultdict(list)

for i in range(N):
    if prev[c[i]-1]!=-1:
        ys[prev[c[i]-1]].append(i)
    
    prev[c[i]-1] = i

que = defaultdict(list)

for i in range(Q):
    l, r = map(int, input().split())
    que[l-1].append((i, r-1))
    
idx = 0
bit = BIT(N)
ans = [-1]*N

for x in range(N-1, -1, -1):
    for y in ys[x]:
        bit.add(y, 1)
    
    for i, r in que[x]:
        ans[i] = r-x+1-bit.acc(r+1)

for ans_i in ans:
    print(ans_i)

### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import *

class BIT:
    def __init__(self, n):
        self.n = n
        self.bit = [0]*(n+1)
    
    def add(self, i, x):
        i += 1
        
        while i<=self.n:
            self.bit[i] += x
            i += i&(-i)

    def acc(self, i):
        s = 0
        
        while i>0:
            s += self.bit[i]
            i -= i&(-i)
        
        return s

N, Q = map(int, input().split())
c = list(map(int, input().split()))
prev = [-1]*N
ys = defaultdict(list)

for i in range(N):
    if prev[c[i]-1]!=-1:
        ys[prev[c[i]-1]].append(i)
    
    prev[c[i]-1] = i

que = defaultdict(list)

for i in range(Q):
    l, r = map(int, input().split())
    que[l-1].append((i, r-1))
    
idx = 0
bit = BIT(N)
ans = [-1]*Q

for x in range(N-1, -1, -1):
    for y in ys[x]:
        bit.add(y, 1)
    
    for i, r in que[x]:
        ans[i] = r-x+1-bit.acc(r+1)

for ans_i in ans:
    print(ans_i)
from itertools import permutations
n = int(input())
P = list(map(int, input().split()))
Q = list(map, int(input().split()))

A = list(itertools.permutations(P))
A.sort()
print(abs(A.index(tuple(P)) - A.index(turple(Q))))

### FIXED CODE ###

from itertools import permutations
n = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

A = list(permutations(P))
A.sort()
print(abs(A.index(tuple(P)) - A.index(tuple(Q))))
import numpy as np
import scipy.special as ss
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
v = np.array(v)
##print(v)
ansarray = v[0:A]
##print(ansarray)
ave = np.mean(ansarray)
print(ave)
mi = min(ansarray)
ma = max(ansarray)
biggerarray = v[v>mi]
m = len(biggerarray)
numminarray = v[v==mi]
a = len(numminarray)
##print(nummin)
##print(num_kouho)
ans = 0
if ma == mi:
    if m+a <= B:
        for i in range(A-m,a+1):
            ans+=ss.comb(a,i)
    else:
        for i in range(A-m,B-m+1):
            ans+=ss.comb(a,i)

else:
    ans = a
#print('a=',a)
#print('m=',m)
print(int(ans))

### FIXED CODE ###

import numpy as np
import math
def ncm(n,m):
    return math.factorial(n)/(math.factorial(m) * math.factorial(n-m))

N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)
v = np.array(v)
##print(v)
ansarray = v[0:A]
##print(ansarray)
ave = np.mean(ansarray)
print(float(ave))
mi = min(ansarray)
ma = max(ansarray)
biggerarray = v[v>mi]
m = len(biggerarray)
numminarray = v[v==mi]
a = len(numminarray)
##print(nummin)
##print(num_kouho)
ans = 0
if ma == mi:
    if m+a <= B:
        for i in range(A-m,a+1):
            ans+=ncm(a,i)
    else:
        for i in range(A-m,B-m+1):
            ans+=ncm(a,i)

else:
    ans = ncm(a,A-m)
#print('a=',a)
#print('m=',m)
print(int(ans))
# -*- coding: utf-8 -*-
N = int(input())
X = input()
X_10 = 0
popcount_X = 0

def popcount(n):
  return bin(n).count("1")

def f_func(n):
  popcnt = popcount(n)
  if popcnt == 0:
    return 0
  return n % popcnt

for i in range(N):
  j = N - (i + 1)
  X_10 += int(X[i]) * 2 ** j
  if X[i] == '1':
    popcount_X += 1

popcount_X_plus = popcount_X + 1
popcount_X_minus = popcount_X - 1
if popcount_X_plus == 0:
  fX_plus = 0
else:
  fX_plus = X_10 % popcount_X_plus

fX_minus = X_10 % popcount_X_minus


for i in range(N):
  j = N - (i + 1)
  
  Xi = 0
  f = 0
  ans = 1
  
  if X[i] == '0':
    Xi = X_10 + 2**j
    f = (fX_plus + 2**j % popcount_X_plus) % popcount_X_plus
    
  elif X[i] == '1':
    Xi = X_10 - 2**j
    if popcount_X_minus == 0:
      f = 0
    else:
      f = (fX_minus - 2**j % popcount_X_minus) % popcount_X_minus
      
  
  while f > 0:
    f = f_func(f)
    ans += 1
  print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
X = input()
X_10 = int(X, 2)
popcount_X = X.count("1")
popcount_X_plus = popcount_X + 1
popcount_X_minus = popcount_X - 1
f_plus = X_10 % popcount_X_plus
f_minus = X_10 % popcount_X_minus if popcount_X_minus != 0 else 0

def popcount(n):
  return bin(n).count("1")

def f(n):
  if n == 0:
    return 0
  return n % popcount(n)

for i in range(N):
  j = N - (i + 1)
  n = 0
  ans = 1
  
  if X[i] == '0':
#    n = (f_plus + (2**j % popcount_X_plus)) % popcount_X_plus
    n = (f_plus + pow(2, j, popcount_X_plus)) % popcount_X_plus
  else:
    if popcount_X_minus == 0:
      print(0)
      continue
    else:
#      n = (f_minus - (2**j % popcount_X_minus) + popcount_X_minus) % popcount_X_minus
      n = (f_minus - pow(2, j, popcount_X_minus) + popcount_X_minus) % popcount_X_minus
  
  while n > 0:
    n = f(n)
    ans += 1
  print(ans)
N = int(input())
A = list(map(int,input().split(" ")))
B = list(map(int,input().split(" ")))
ans = 0
for i in range(N):
    if A[i] >= B[i]:
        ans += B[i]
    else: 
        if B[i] >= (A[i] + A[i+1]):
            ans += (A[i] + A[i+1])
            A[i+1] = 0
        
        elif B[i] < (A[i] + A[i+1]):
            print(ans)
            ans += B[i]
            print(ans)
            A[i+1] = (A[i] + A[i+1]) - B[i]
    print(A,ans)
print(ans)





### FIXED CODE ###

N = int(input())
A = list(map(int,input().split(" ")))
B = list(map(int,input().split(" ")))
ans = 0
for i in range(N):
    if A[i] >= B[i]:
        ans += B[i]
    else: 
        if B[i] >= (A[i] + A[i+1]):
            ans += (A[i] + A[i+1])
            A[i+1] = 0
        
        elif B[i] < (A[i] + A[i+1]):
            ans += B[i]
            A[i+1] = (A[i] + A[i+1]) - B[i]
print(ans)
n,k = map(int,input().split())
A = [int(i) for i in input().split()]

Visit = [False for i in range(n+1)]

loop_st,loop_end,loop_len = 0,0,0
st = 1
releki = []
for i in range(1000000):
    
    if Visit[st] == True:
        loop_key = st
        loop_st = releki.index(loop_key)
        loop_end = len(releki)-loop_st
        loop_len = len(releki)-loop_st-1
        break
    releki.append(st)
    Visit[st] = True
    st = A[st-1]
k-= loop_st
print(releki[loop_len%k])

### FIXED CODE ###

n,k = map(int,input().split())
A = [int(i) for i in input().split()]

Visit = [False for i in range(n+1)]

loop_st,loop_end,loop_len = 0,0,0
st = 1
releki = []
loop_list = []
for i in range(10000000000000):
    if Visit[st] == True:
        loop_key = st
        loop_st = releki.index(loop_key)
        loop_end = len(releki)-loop_st
        loop_list = releki[loop_st:]
        loop_len = len(loop_list)
        break
    releki.append(st)
    Visit[st] = True
    st = A[st-1]
if k <loop_st:
    print(releki[k])
    exit()
k -= loop_st

print(loop_list[k%loop_len])
import math
tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])

ans = (A * B) // math.gcd(A, B)

print(ans)

### FIXED CODE ###

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

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])

mo = 0
if A >= B:
    mo = gcd(A, B)
else:
    mo = gcd(B, A)
ans = (A * B) // mo

print(ans)
import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
a.sort()
a_true = [True]*n
a_set = set(a)
if 1 in a or len(a_set) == 1:
    print(0)
else:
    a_max = a[n-1]
    i = 0
    while a[i]*2 <= a_max:
        while i < n-1:
            if a[i] == a[i+1]:
                a_true[i] = False
                a_true[i+1] = False
            i += 1
        for j in range(i+1,n):
            if a[j] % a[i] == 0:
                a_true[j] = False
        i += 1
    while i < n-1:
        if a[i] == a[i+1]:
            a_true[i] = False
            a_true[i+1] = False
        i += 1
    print(len([i for i in range(0, n) if a_true[i]]))

### FIXED CODE ###

import sys
n = int(sys.stdin.readline().rstrip("\n"))
a = [int(s) for s in sys.stdin.readline().rstrip("\n").split()]
a_max = max(a)
c = {num: 0 for num in a}
for num in a:
    c[num] += 1
d = {num: 0 for num in a}
for num in a:
    t = 2
    while num * t <= a_max:
        d[num*t] = 1
        t += 1
ans = 0
for num in a:
    if c[num] == 1 and d[num] == 0:
        ans += 1
print(ans)
#Coding: utf-8
N=in(input())
a=[]
for i in 5:
  a.append(int(input()))
import math
print(math.ceil(N/min(a))-4)

### FIXED CODE ###

#Coding: utf-8
N=int(input())
a=[]
for i in range(5):
  a.append(int(input()))
import math
print(math.ceil(N/min(a))+4)
l = map(int, input().split())
l.sort()
print("YES" if l == [5, 5, 7] else "NO")

### FIXED CODE ###

l = input().split()
print("YES" if sorted(l) == ['5', '5', '7'] else "NO")
a=input()
b=a*a*a+a*a+a
print(b)

### FIXED CODE ###

a=int(input())
b=int(a*a*a+a*a+a)
print(b)
S = input()
T = input()

if len(S) < len(T):
    print('UNRESTORABLE')
else:
    raise Exception()
    # pos = []
    # # Sのi文字目をスタートとしたときにマッチするか
    # for i in range(len(S)-len(T)+1):
    #     # print('S[i]', S[i])
    #     match = True
    #     for j in range(len(T)):
    #         # print('-', T[j], S[i+j])
    #         if T[j] == S[i+j] or S[i+j] == '?':
    #             pass
    #         else:
    #             match = False
    #     if match:
    #         pos.append(i)

    # # print(pos)
    # if len(pos) == 0:
    #     print('UNRESTORABLE')
    # else:
    #     ans = 'z' * 51
    #     for pi in pos:
    #         r = ''
    #         for j in range(pi):
    #             if S[j] == '?':
    #                 r += 'a'
    #             else:
    #                 r += S[j]
    #         r += T
    #         for j in range(pi+len(T), len(S)):
    #             if S[j] == '?':
    #                 r += 'a'
    #             else:
    #                 r += S[j]
    #         ans = min(ans, r)
    #     print(ans)


### FIXED CODE ###

def main():
    S = input()
    T = input()

    SR = S[::-1]
    TR = T[::-1]

    restore = False
    pos = 0
    r = ""
    for i in range(len(S)):
        r += SR[:i]
        for j, si in enumerate(SR[i:]):
            if si == '?':
                r += TR[pos]
                pos += 1
            elif si == TR[pos]:
                r += TR[pos]
                pos += 1
            else:
                break
            # print(i, si, pos)
            if pos == len(T):
                restore = True
                break
        if restore:
            r += SR[i+j+1:]
            break
        pos = 0
        r = ""

    if restore:
        r = r.replace('?', 'a')
        r = r[::-1]
        print(r)
    else:
        print('UNRESTORABLE')


if __name__ == "__main__":
    main()
L = list(map(int,input().split())).sort(reverse=True)
m = (L[0]-L[1]) % 2 - (L[0] - L[2]) % 2
if m == 0:
    print(L[0]+(-L[1]-L[2])//2)
else:
    print(L[0]+(-L[1]-L[2]+3)//2)


### FIXED CODE ###

L = sorted(list(map(int,input().split())),reverse=True)
m = (L[0]-L[1]) % 2 - (L[0] - L[2]) % 2
if m == 0:
    print(L[0]+(-L[1]-L[2])//2)
else:
    print(L[0]+(-L[1]-L[2]+3)//2)