Harryxun/stf_run huggingface dataset:
from collections import defaultdict 

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

adjList = defaultdict(list)

for i in range(m):
    a,b = map(int, input().strip().split(" "))
    a-=1
    b-=1
    if b not in adjList[a]:
        adjList[a].append(b)
        
    if a not in adjList[b]:
        adjList[b].append(a)
    
mca = 0
visited = [False]*n

def dfs(node, cml):
    if len(adjList[node])>0:
        for ngh in adjList[node]:
            if not visited[ngh]:
                visited[ngh] = True
                cml = dfs(ngh, cml+1)
    
    return cml

for i in range(n):
    if not visited[i]:
        visited[i] = True
        ca = dfs(i, 1)
        mca = max(mca, ca)

print(mca)
    
    

### FIXED CODE ###

from collections import defaultdict 

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

dp = [-1]*n

def root(x):
    if dp[x] < 0:
        return x
    return root(dp[x])

def unite(x, y):
    rx = root(x)
    ry = root(y)
    
    if rx == ry:
        return False
        
    if dp[rx] > dp[ry]:
        rx,ry = ry,rx
        
    dp[rx] += dp[ry]
    dp[ry] = rx
    return True

def size(x):
    return -dp[root(x)]

for i in range(m):
    a,b = map(int, input().strip().split(" "))
    a-=1
    b-=1
    unite(a,b)
    
ans = 0
for i in range(n):
    ans = max(ans, size(i))
    
print(ans)
s = input()
even = ["L","U","D"]
odd = ["R","U","D"]
f=True
for i in range(len(s)):
    if i%2==1:
        if s[i] not in even:
            f = False
    if i%2==0:
        id s[i] not in odd:
            f=False
if f:
    print("Yes")
else:
    print("No")

  


### FIXED CODE ###

s = input()
even = ["L","U","D"]
odd = ["R","U","D"]
f=True
for i in range(len(s)):
    if i%2==1:
        if s[i] not in even:
            f = False
    if i%2==0:
        if s[i] not in odd:
            f=False
if f:
    print("Yes")
else:
    print("No")
A=input()
if A='ABC':
  print('ARC')
else:
  print('ABC')

### FIXED CODE ###

A=input()
if A=='ABC':
  print('ARC')
else:
  print('ABC')
if __name__=="__main__":
        l1 = list(map(int,input().split(" ")))
        l2 = list(map(int,input().split(" ")))
        l = {i:0 for i in range(200001)}
        N = l1[0]
        K = l1[1]
        for i in range(N):
            l[l2[i]]+=1
        dict = sorted(l.values())
        condition = lambda t:t!=0
        fliter_dict = list(filter(condition,dict))
        if len(fliter_dict)<=K:
            print(0)
        else:
            print(sum(fliter_dict[0:(len(fliter_dict)-K)]))

### FIXED CODE ###

if __name__=="__main__":
    n = list(map(int,input()))
    print(n.count(1))
def edit_distance():
 s = raw_input()
 t = raw_input()
 a = len(X)
 b = len(Y)
 x = [0 for i in range(b+1)]
 for i in range(a):
   q = s[i]
   x2 = x1+[]
   for j in range(b):
    if (q ==t[j]):
     x[j+1] =x2[j]+1
    elif (x[j+1]<x2[j]+1):
      x[j+1] =x2[j]
 return x1[-1]
n = input()
for i2 in range(n):
 print edit_distance()

     

### FIXED CODE ###

def edit_distance():
 s = raw_input()
 t = raw_input()
 a = len(s)
 b = len(t)
 x = [0 for i in range(b+1)]
 for i in range(a):
   q = s[i]
   x2 = x+[]
   for j in range(b):
    if (q ==t[j]):
     x[j+1] =x2[j]+1
    elif (x[j+1]<x[j]):
     x[j+1] =x[j]
 return x[-1]

n = input()
for i2 in range(n):
 print edit_distance()
def add(s,d):
     sum=0
     for i in d[1:]:
          sum+=s[i] 
     return sum

def check(m):
    for i in range(m):
        if add(s, d[i]) % 2 == p[i]:
            pass
        else :
            return -1
    return 1
        
        
d = []
s=[]
inc=0

n, m = (int(x) for x in input().split())
for i in range(m):
    i = [int(i) for i in input().split()] 
    d.append(i)
p = [int(i) for i in input().split()]


for i in range(32):
    x = '{:0>6}'.format(bin(i).split('b')[1])
    s=list(x)
    s= [int(s) for s in s]
    #print(i, l)
    if check(m) == 1:
            inc +=1
    
print(inc)

### FIXED CODE ###

def add(s,d):
     sum=0
     for i in d[1:]:
          sum+=s[i] 
     return sum

def check(m):
    for i in range(m):
        if add(s, d[i]) % 2 == p[i]:
            pass
        else :
            return -1
    return 1
        
        
d = []
s=[]
inc=0

n, m = (int(x) for x in input().split())
for i in range(m):
    i = [int(i) for i in input().split()] 
    d.append(i)
p = [int(i) for i in input().split()]

r = 2 ** n

for i in range(r):
    x = str(bin(i).split('b')[1]).zfill(n + 1)
    s=list(x)
    s= [int(s) for s in s]
    if check(m) == 1:
            inc +=1
    
print(inc)
#!/usr/bin/env python3
import sys
import sympy
import numpy as np


def solve(N: int):

    fct = sympy.factorint(N)

    fct_list = []
    for key, item in zip(fct.keys(), fct.values()):
        fct_list += [key] * item

    result = 1e12

    if len(fct_list) == 2:
        x = fct_list[0]
        y = fct_list[1]
        print(x - 1 + y - 1)
    elif len(fct_list) == 1:
        x = fct_list[0]
        y = 1
        print(x - 1 + y - 1)

    else:
        for i in range(1, len(fct_list) - 1):

            x = np.prod(fct_list[: i + 1])
            y = np.prod(fct_list[i + 1 :])

            result = min(result, x - 1 + y - 1)
        print(result)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int):
    result_list = []
    for i in range(1, int(np.sqrt(N)) + 1):
        if N % i == 0:
            result_list.append(i - 1 + N // i - 1)
        else:
            pass
    print(min(result_list))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()
import sys


def rec(i):
    #if(i==0):print(i,H[i])
    #if(i>=1):print(i,H[i],H[i-1])
    #if(i>=2):print(i,H[i],H[i-2])
    print(i)
    if (dp[i] < float('inf')): return dp[i]
    if(i==0): return 0

    res = float('inf')
    res = rec(i-1)+abs(H[i]-H[i-1])
    if(i==1): return res

    calc = rec(i-2)+abs(H[i]-H[i-2])
    if(res > calc):
        res = calc

    dp[i] = res

    return res

N = int(input())
H = list(map(int,input().split()))
dp = [float('inf')]*N

#print(N)
#print(H)

print(rec(N-1))

#7
#2 9 4 5 1 6 10


### FIXED CODE ###

import sys


N = int(input())

H = list(map(int,input().split()))

dp = [float('inf')]*N

dp[0] = 0
#print(N)
#print(H)
#print(dp)


for i in range(1,N):
    if(i==1):
        dp[1] = abs(H[1]-H[0])
    else:
        dp[i] = dp[i-1]+abs(H[i]-H[i-1])
        if(dp[i] > dp[i-2]+abs(H[i]-H[i-2])):
            dp[i] = dp[i-2]+abs(H[i]-H[i-2])
        #
        #print(i,dp)

print(dp[-1])

#7
#2 9 4 5 1 6 10
A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input())
count = 0 //初期値
           
#全件走査
maxA = X // 500 if 500 * A > X else A


### FIXED CODE ###

A = int(input()) #500
B = int(input()) #100
C = int(input()) #50
X = int(input())
count = 0 #初期値
           
#全件走査
maxA = X // 500 if 500 * A > X else A
for i in range(maxA + 1):
  maxB = (X - 500 * i) // 100 if 100 * B > (X - 500 * i) else B
  for j in range(maxB + 1):
    q,mod = divmod (X - 500 * i - 100 * j ,50)
    if mod == 0 and q <= C:count += 1    
print(count)
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
res = 0
res += B[0]
for i in range(1, N):
    res += B[i]
    if A[i - 1] = A[i] - 1:
        res += C[i - 1]

print(res)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
res = 0
res += B[A[0]-1]
for i in range(1, N):
    res += B[A[i]-1]
    if A[i - 1] == A[i] - 1:
        res += C[A[i - 1]-1]

print(res)
S = input()
T = input()
ans = 0
for i in range(3):
  is S[i] == T[i]:
    ans += 1
print(ans)

### FIXED CODE ###

S = input()
T = input()
ans = 0
for i in range(3):
  if S[i] == T[i]:
    ans += 1
print(ans)
N=int(input())
P=list(map(int,input().split()))
cnt=0
x=[]
i=0
while True:
  max=P[0]
  if max>=P[i+1]:
    cnt+=1
    max=P[i+1]
  i+=1
  if i==N-1:
    break
print(cnt)
    

### FIXED CODE ###

n = int(input())
p_n = list(map(int, input().split()))
ans = 1
p_i_1 = [p_n[0]]
m = p_n[0]
for i in range(1, n):
    if m > p_n[i]:
        ans += 1
    m = min(m, p_n[i])
    p_i_1.append(p_n[i])
    if m == 1:
        break
print(ans)
class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n + 1)]

    def root(self, x):
        if self.par[x] == x:
            return x
        r = self.root(self.par[x])
        self.par[x] = r
        return r

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx == ry:
            return
        self.par[x] = ry
        self.par[rx] = ry

def main():
    N, M, *AB = map(int, open(0).read().split())
    uf = UnionFind(N)
    elems = [1] * (N + 1)
    ans = N * (N - 1) // 2
    ANS = [0]*M
    for i in range(M):
        # print(ans)
        ANS[M - i - 1] = ans
        a = AB[2 * M - i * 2 - 2 + 0]
        b = AB[2 * M - i * 2 - 2 + 1]
        ra = uf.root(a)
        rb = uf.root(b)
        uf.unite(ra, rb)
        r = uf.root(ra)
        if ra != rb:
            era = elems[ra]
            erb = elems[rb]
            ans -= era * erb
            elems[r] = era + erb
    for ans in ANS:
        print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.par = [i for i in range(n + 1)]
        self.rank = [0]*(n + 1)

    def root(self, x):
        if self.par[x] == x:
            return x
        r = self.root(self.par[x])
        self.par[x] = r
        return r

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        rx = self.root(x)
        ry = self.root(y)
        if rx == ry:
            return
        if self.rank[rx] < self.rank[ry]:
            self.par[x] = ry
            self.par[rx] = ry
        else:
            self.par[y] = rx
            self.par[ry] = rx
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1

def main():
    N, M, *AB = map(int, open(0).read().split())
    uf = UnionFind(N)
    elems = [1] * (N + 1)
    ans = N * (N - 1) // 2
    ANS = [0]*M
    for i in range(M):
        # print(ans)
        ANS[M - i - 1] = ans
        a = AB[2 * M - i * 2 - 2 + 0]
        b = AB[2 * M - i * 2 - 2 + 1]
        ra = uf.root(a)
        rb = uf.root(b)
        uf.unite(ra, rb)
        r = uf.root(ra)
        if ra != rb:
            era = elems[ra]
            erb = elems[rb]
            ans -= era * erb
            elems[r] = era + erb
    for ans in ANS:
        print(ans)


if __name__ == '__main__':
    main()
s = list(input())
t = list(input())
for i in s:
  for j in t:
    if ord(i)<ord(j):
      print("Yes")
      exit()
 
count = 0
if len(s)<len(t):
  for i in range(len(s)):
    if s[i]=t[i]:
      count+=1
  if count = len(s):
    print("Yes")
    exit()
 
print("No")
    
s = list(input())
t = list(input())
for i in s:
  for j in t:
    if ord(i)<ord(j):
      print("Yes")
      exit()

S = sorted(s)
T = sorted(t)
count = 0
if len(s)<len(t):
  for i in range(len(s)):
    if S[i]=S[i]:
      count+=1
  if count = len(s):
    print("Yes")
    exit()

print("No")
    


### FIXED CODE ###

s = sorted(input())
t = sorted(input())[::-1]
if s < t:
  print("Yes")
else:
  print("No")
a = [0 for _ in range*6]

for i in range(6):
    a[i]= int(input())
k = int(input())

dist = a[5]-a[0]

if dist > k:
    print(":(")
else:
    print("Yay!")

### FIXED CODE ###

a = [0 for _ in range(5)]

for i in range(5):
    a[i]= int(input())
k = int(input())

dist = a[4]-a[0]

if dist > k:
    print(":(")
else:
    print("Yay!")
a = sorted(list(map(int, input().split())))
if a[1]-a[0] >= 1:
  print(a[2]*2-1)
else:
  print(a[2]*2)

### FIXED CODE ###

a = sorted(list(map(int, input().split())))
if a[1]-a[0] >= 1:
  print(a[1]*2-1)
else:
  print(a[1]*2)
N = int(input())
A=list(map(int, input().split()))
from collections import Counter


c = dict(Counter(A))
MOD = 10**9 + 7
if N % 2 == 0:
    is_ok = 1
    cnt = 0
    for num in range(1, N, 2):
        cnt += 1
        if c[num] != 2:
            is_ok=0
            break
    if not is_ok:
        print(0)
        exit()
    print(pow(2, cnt, MOD))
else:
    is_ok = 1
    cnt = 0
    if c[0] != 1:
        is_ok = 0
    for num in range(2, N, 2):
        cnt += 1
        if c[num] != 2:
            is_ok = 0
            break
    if not is_ok:
        print(0)
        exit()
    print(pow(2, cnt, MOD))

### FIXED CODE ###

N = int(input())
A=list(map(int, input().split()))
from collections import Counter


c = Counter(A)
MOD = 10**9 + 7
if N % 2 == 0:
    is_ok = 1
    cnt = 0
    for num in range(1, N, 2):
        cnt += 1
        if c[num] != 2:
            is_ok=0
            break
    if not is_ok:
        print(0)
        exit()
    print(pow(2, cnt, MOD))
else:
    is_ok = 1
    cnt = 0
    if c[0] != 1:
        is_ok = 0
    for num in range(2, N, 2):
        cnt += 1
        if c[num] != 2:
            is_ok = 0
            break
    if not is_ok:
        print(0)
        exit()
    print(pow(2, cnt, MOD))
import numpy as np
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
 
num_str = input()

lst = []

tmp_sum = 0
tmp = 0
count = 1
out_sum = 0
while True:
  if tmp_sum + 10**10 * count < len(num_str):
      out_sum += sum([int(num_str[i]) for i in range(tmp, 10**10 * count)])
  else:
      out_sum += sum([int(num_str[i]) for i in range(tmp, len(num_str))])
      break
  tmp = 10**10 * count
  count += 1
  tmp_sum += tmp
 
if out_sum%9 == 0:
  print("Yes")
else:
  print("No")










### FIXED CODE ###

import numpy as np
import sys
# input = sys.stdin.readline
# sys.setrecursionlimit(10**8)
 
num_str = input()

num_sum = 0
for i in range(len(num_str)):
  num_sum+=int(num_str[i])
 
if num_sum%9 == 0:
  print("Yes")
else:
  print("No")
a, b = map(int, input().split())
import math
n = math.gcd(a, b)
devide = 2
l1 = []
while devide <= n:
    while n % devide == 0:
        n = n / devide
        l1.append(devide)
    devide += 1
l1 = list(set(l1))
print(int(len(l1) + 1))


### FIXED CODE ###

a, b = map(int, input().split())
import math
import fractions
n = fractions.gcd(a, b)
devide = 2
l1 = []
while devide <= math.sqrt(n):
    while n % devide == 0:
        n = n / devide
        l1.append(devide)
    devide += 1
l1.append(n)
l1 = list(set(l1))
if n == 1:
    print(int(len(l1)))
else:
    print(int(len(l1) + 1))
S =input()
T =input()
mint=10000

for i in range(len(S)-len(T)+1):
    con = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            con += 1
            
    mint =min(con,mint)
    
    if min_count == 0:
        break


print(mint)

### FIXED CODE ###

S =input()
T =input()
mint=10000

for i in range(len(S)-len(T)+1):
    con = 0
    for j in range(len(T)):
        if S[i+j] != T[j]:
            con += 1
            
    mint =min(con,mint)
    
    if mint == 0:
        break


print(mint)
N, Q = map(int, input().split())
tree = [list(map(int, input().split())) for i in range(N-1)]
counter = [list(map(int, input().split())) for i in range(Q)]
dic = {}
for i in tree:
  try:
    dic[i[0]].append(i[1])
  except KeyError:
    dic[i[0]] = [i[1]]
keys = dic.keys()
for i in tree:
  if i[1] not in keys:
    dic[i[1]] = []
q = {i: 0 for i in dic.keys()}

def child_sum(q,v, child):
  if child == []:
    #print('test', q, v, child)
    return q
  else:
    for j in child:
      
      q[j] += v
      child = dic[j]
      #print('test2', j, v, child)
      q = child_sum(q, v, child)
  return q
    
for i, v in counter:
  q[i] += v
  child = dic[i]
  #print(q, i, child)
  q = child_sum(q, v, child)


### FIXED CODE ###

N, Q = map(int, input().split())
edge = [[] for i in range(N)]
q = [0 for i in range(N)]
 
for i in range(N-1):
  a, b = map(int, input().split())
  edge[a-1].append(b)
for i in range(Q):
  a, v = map(int, input().split())
  q[a-1] += v
 
for i, v in enumerate(q):
  #print(i, v)
  for j in edge[i]:
    #print(j)
    q[j-1] += v
print(*q)
count = input()
numbers = map(int, input().split())

counter = 0
while True:
  tmp = 0
  for item in numbers:
    tmp += item % 2
  if tmp > 0:
    break
  counter ++
  numbers = [item / 2 for item in numbers]
print(counter)

### FIXED CODE ###

count = int(input())
numbers = [int(num) for num in input().split()]

counter = 0
while True:
  tmp = 0
  for item in numbers:
    tmp += item % 2
  if tmp > 0:
    break
  counter += 1
  numbers = [item / 2 for item in numbers]
print(counter)
import heapq
import bisect
from collections import deque
stdin=sys.stdin

ns=lambda:input().rstrip()
ni=lambda:int(input().rstrip())
nm=lambda:map(int,input().split())
nl=lambda:list(map(int,input().split()))

s=list(ns())
t=list(ns())
d={'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25}

order=[[] for _ in range(26)]

for i in range(len(s)):
  order[d[s[i]]].append(i)
  
now=0
ans=0
rep=0
for i in range(len(t)):
  inds=d[t[i]]
  if(order[inds]==[]):
    print(-1)
    sys.exit(0)
  index=bisect.bisect_left(order[inds],now)
  if(index==len(order[inds])):
    now=order[inds][0]
    rep+=1
  else:
    now=order[inds][index]


print(rep*len(s)+now+1)

### FIXED CODE ###

import sys
import heapq
import bisect
from collections import deque
stdin=sys.stdin

ns=lambda:input().rstrip()
ni=lambda:int(input().rstrip())
nm=lambda:map(int,input().split())
nl=lambda:list(map(int,input().split()))

s=list(ns())
t=list(ns())
d={'a':0,'b':1,'c':2,'d':3,'e':4,'f':5,'g':6,'h':7,'i':8,'j':9,'k':10,'l':11,'m':12,'n':13,'o':14,'p':15,'q':16,'r':17,'s':18,'t':19,'u':20,'v':21,'w':22,'x':23,'y':24,'z':25}

order=[[] for _ in range(26)]

for i in range(len(s)):
  order[d[s[i]]].append(i)
  
now=0
ans=0
rep=0
for i in range(len(t)):
  inds=d[t[i]]
  if(order[inds]==[]):
    print(-1)
    sys.exit(0)
  index=bisect.bisect_left(order[inds],now)
  if(index==len(order[inds])):
    now=order[inds][0]+1
    rep+=1
  else:
    now=order[inds][index]+1


print(rep*len(s)+now)
n, k = map(int, input().split())

if n != k:
  x1 = n % k
  x2 = k - x1
  print(min(x1, x2))
else n == k:
  print(0)

### FIXED CODE ###

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

if n != k:
  x1 = n % k
  x2 = k - x1
  print(min(x1, x2))
else:
  print(0)
str = input()
length = len(str)
ans = [""] * length
for x in range(length):
    if str[length - (x + 1)] == "P":ans[length - (x + 1)] += "P"
    elif str[length - (x + 1)] == "D":ans[length - (x + 1)] += "D"
    elif str[length - (x + 1)] == "?":
        if x == 0 or x == length: ans[length - (x + 1)] = "D"
        elif ans[length - x] == "P": ans[length - (x + 1)] = "D"
        elif ans[length - x] == "D" and ans[length - (x - 1)] == "P": ans[length - (x + 1)] = "D"
        elif ans[length - x] == "D" and ans[length - (x - 1)] == "D": ans[length - (x + 1)] = "P"
print(''.join(ans))

### FIXED CODE ###

str = input()
length = len(str)
ans = [""] * length
for x in range(length):
    if str[length - (x + 1)] == "P":ans[length - (x + 1)] += "P"
    elif str[length - (x + 1)] == "D":ans[length - (x + 1)] += "D"
    elif str[length - (x + 1)] == "?":
        if x == 0 or x == length - 1: ans[length - (x + 1)] = "D"
        elif ans[length - x] == "P": ans[length - (x + 1)] = "D"
        elif ans[length - x] == "D" and str[length - (x + 2)] == "P": ans[length - (x + 1)] = "D"
        elif ans[length - x] == "D" and str[length - (x + 2)] == "D": ans[length - (x + 1)] = "P"
        elif ans[length - x] == "D" and str[length - (x + 2)] == "?": ans[length - (x + 1)] = "P"
print(''.join(ans))
x,a,b=map(int,input().split())
a_x=abs(a,x)
b_x=abs(b,x)
if a_x<b_x:
    print("A")
else:
    print("B")

### FIXED CODE ###

x,a,b=map(int,input().split())
a_x=abs(a-x)
b_x=abs(b-x)
if a_x<b_x:
    print("A")
else:
    print("B")
import re
s1 = input()
t = input()
pre = ""
count = 0
ans = ""
start = 0
end = 0
it = ""

for w in s1:
  if w == t[count]:
    count += 1
    it += w
  elif pre == "?" and w == t[0]:
    count = 1
    it += w
  elif w != "?" and pre == "?":
    pre = w
    count = 0
    it = ""
  elif w == "?" and pre == "?":
    count += 1
    it += w
  else:
    if w == "?":
      pre = w
      count += 1
      it += w
  # if count >= len(t):
  #   print("きたよ")
  #   print(w)
  #   end = s1.index(w)
  #   start = end - len(t)
#print(f"count is {count}")
#print("endは" + end)
#replace = "?" * len(t)
#print("replace is" + it)
if count >= len(t):
  it = it.replace("?","\?")
  # 合致した最も後方のものを置換
  ans = re.sub(it,t,s1)
  ans = ans.replace("?","a")
  #print(ans)
  # if end < len(s1) - 1:
  #   ans = s1[:start] + t + s1[end+1:]
  #   # 全てaに置換
  #   ans = ans.replace("?","a")
  #   print(ans)
  # else:
  #   ans = s1[:start] + t
  #   ans = ans.replace("?","a")
  print(ans)
else:
  print("UNRESTORABLE")

### FIXED CODE ###

# pythonはindexでstringの文字を変更できない
s = list(input())
t = list(input())
x = 0
ans = []
gotk = False

# pythonて関数にするとスコープの外の変数参照できないんだっけ？

# 0 <= k <= s - t
def match(k):
  for i in range(len(t)):
    if s[i + k] != t[i] and s[i + k] != "?":
      return False
  return True

def construct(k,s):
  for i in range(len(t)):
    s[i + k] = t[i]
  for i in range(len(s)):
    if s[i] == "?":
      s[i] = "a"
  return s

# 大きいkから探せば良い(今回逆順にしてるためrangeの第二引数が直前まで処理されることに注意！)
for i in range(len(s) - len(t),-1,-1):
  if match(i):
    x = i
    gotk = True
    break

if gotk == True:
  ans = construct(x,s)
  print("".join(ans))
else:
  print("UNRESTORABLE")
hitachi = input()
flag = 0
for x in range(len(hitachi)):
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            print(hitachi[x] + hitachi[x+1])
            print("No")
            break
print(flag)
print(int(len(hitachi)/2))
if(flag == len(hitachi)/2):
    print("Yes")

### FIXED CODE ###

hitachi = input()
#type(hitachi)
flag = 0
if(len(hitachi) == 1):
    hitachi += " "
elif(len(hitachi) >= 11):
    hitachi = " "
elif(len(hitachi) % 2 ==1):
    hitachi += " "
for x in range(len(hitachi)):
    if(hitachi[x] == " "):
        break
    if(x %2 == 0):
        if(hitachi[x] + hitachi[x+1] == "hi"):
            #print(hitachi[x] + hitachi[x+1])
            flag += 1
        else:
            #print(hitachi[x] + hitachi[x+1])
            print("No")
            break
if(not len(hitachi) == 0):
    if(flag == len(hitachi)//2):
        print("Yes")
a, b = map(int, input().split())

base = 2
ans = ''
while base // 2 <= b:
  nb = (b // base) * (base // 2)
  na = (a // base) * (base // 2)
  if b % base != 0:
    nb += max(0, b % base - (base // 2) + 1)
  if a % base != 0:
    na += max(0, (a - 1) % base - (base // 2) + 1)
  if (nb - na) % 2 == 1:
    ans += '1'
  else:
    ans += '0'
  base *= 2
print(int(ans[::-1], 2))

### FIXED CODE ###

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

base = 2
ans = ''
if a == 0 and b == 0:
  print(0)
else:
  while base // 2 <= b:
    nb = (b // base) * (base // 2)
    na = (a // base) * (base // 2)
    if b % base != 0:
      nb += max(0, b % base - (base // 2) + 1)
    if a % base != 0:
      na += max(0, (a - 1) % base - (base // 2) + 1)
    if (nb - na) % 2 == 1:
      ans += '1'
    else:
      ans += '0'
    base *= 2
  print(int(ans[::-1], 2))
a,b = map(int input().split())

if a < b:
    print(0)

else:
    print(10)

### FIXED CODE ###

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

if a < b:
    print(0)

else:
    print(10)