Harryxun/stf_run huggingface dataset:
def counting_sort(A, k):
    B = [0 for i in range(len(A))]
    C = [0 for i in range(0, k + 1)]

    # C[i]???i???????????°????¨??????????
    for j in range(1, n):
        C[A[j]] += 1

    # C[i]???i??\????????°???????????°????¨??????????
    for i in range(1, k + 1):
        C[i] +=  C[i - 1]

    for j in reversed(range(1, n)):
        B[C[A[j]]] = A[j]
        C[A[j]] -= 1
    return B
n = int(input())
A = list(map(int, input().split()))
k = max(A)

print(counting_sort(A, B, k))

### FIXED CODE ###



def counting_sort(A, k):
    n = len(A)
    B = ['0' for i in range(n + 1)]
    C = [0 for i in range(0, k + 1)]

    # C[i]???i???????????°????¨??????????
    for j in range(0, n):
        C[A[j]] += 1

    # C[i]???i??\????????°???????????°????¨??????????
    for i in range(0, k):
        C[i + 1] +=  C[i]

    for j in reversed(range(0, n)):
        B[C[A[j]]] = str(A[j])
        C[A[j]] -= 1
    return ' '.join(B[1:])

n = int(input())
A = list(map(int, input().split()))
k = max(A)
print(counting_sort(A, k))
import math
A = int(input())
B = float(input())
print(math.floor(A*B))

### FIXED CODE ###

def multiply(num1, num2): 
    len1 = len(num1) 
    len2 = len(num2) 
    if len1 == 0 or len2 == 0: 
        return "0"
  
    # will keep the result number in vector 
    # in reverse order 
    result = [0] * (len1 + len2) 
      
    # Below two indexes are used to  
    # find positions in result. 
    i_n1 = 0
    i_n2 = 0
  
    # Go from right to left in num1 
    for i in range(len1 - 1, -1, -1): 
        carry = 0
        n1 = ord(num1[i]) - 48
  
        # To shift position to left after every 
        # multiplication of a digit in num2 
        i_n2 = 0
  
        # Go from right to left in num2 
        for j in range(len2 - 1, -1, -1): 
              
            # Take current digit of second number 
            n2 = ord(num2[j]) - 48
          
            # Multiply with current digit of first number 
            # and add result to previously stored result 
            # at current position. 
            summ = n1 * n2 + result[i_n1 + i_n2] + carry 
  
            # Carry for next iteration 
            carry = summ // 10
  
            # Store result 
            result[i_n1 + i_n2] = summ % 10
  
            i_n2 += 1
  
            # store carry in next cell 
        if (carry > 0): 
            result[i_n1 + i_n2] += carry 
  
            # To shift position to left after every 
            # multiplication of a digit in num1. 
        i_n1 += 1
          
        # print(result) 
  
    # ignore '0's from the right 
    i = len(result) - 1
    while (i >= 0 and result[i] == 0): 
        i -= 1
  
    # If all were '0's - means either both or 
    # one of num1 or num2 were '0' 
    if (i == -1): 
        return "0"
  
    # generate the result string 
    s = "" 
    while (i >= 0): 
        s += chr(result[i] + 48) 
        i -= 1
  
    return s 
  
# Driver code 
str1, str2 = input().split()
str2 = str2.replace(".", "")
# print(str1)
# print(str2)
if((str1[0] == '-' or str2[0] == '-') and 
   (str1[0] != '-' or str2[0] != '-')): 
    print("-", end = '') 
  
  
if(str1[0] == '-' and str2[0] != '-'): 
    str1 = str1[1:] 
elif(str1[0] != '-' and str2[0] == '-'): 
    str2 = str2[1:] 
elif(str1[0] == '-' and str2[0] == '-'): 
    str1 = str1[1:] 
    str2 = str2[1:]
res = multiply(str1, str2)
if len(res)>2:
    print(multiply(str1, str2)[:-2]) 
else:
    print(0)
W = input()
count = 0
while True:
    T = input().split(" ")
    if T == "END_OF_TEXT":
        break
    count += T.count(W)
    print(count)

    
    

### FIXED CODE ###

W = input().lower()
count = 0
while True:
    T = input()
    if T == "END_OF_TEXT":
        break
    count += T.lower().split(" ").count(W)
print(count)
a=input()
a=int(a)
d=a
if a<2:
    b=a
    a=2
else
    b=2
c=1
while c!=0:
    c=a%b
    a=b
    b=c
print(d*2/b)
#a=2,b=1,c=1,d=1

### FIXED CODE ###

N=input()
N=int(N)
if N%2==0:
    print(N)
else:
    print(N*2)
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

s = input()
t = input()

if len(s) < len(t):
    ans = "UNRESTORABLE"
else:
    reg = -1
    for i in range(len(s)-len(t),-1,-1):
        for j in range(len(t)):
            if s[i+j] != '?' and s[i+j] != t[j]:
                break
        else:
            reg = i
            break
    if reg == -1:
        ans = "UNRESTORABLE"
    elif reg == len(s)-len(t):
        s = s[:i]+t
        ans = s.replace('?','a')
    else:
        s = s[:i]+t+s[i+len(t):]
print(ans)

### FIXED CODE ###

from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

s = input()
t = input()

if len(s) < len(t):
    ans = "UNRESTORABLE"
else:
    reg = -1
    for i in range(len(s)-len(t),-1,-1):
        for j in range(len(t)):
            if s[i+j] != '?' and s[i+j] != t[j]:
                break
        else:
            reg = i
            break
    if reg == -1:
        ans = "UNRESTORABLE"
    elif reg == len(s)-len(t):
        s = s[:i]+t
        ans = s.replace('?','a')
    else:
        s = s[:i]+t+s[i+len(t):]
        ans = s.replace('?','a')
print(ans)
n = int(input())
A = list(map(int, input().split()))

Cnt = [0 for i in range(10**6 + 7)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)

### FIXED CODE ###

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

Cnt = [0 for i in range(10**6 + 8)]
for i in A:
    if Cnt[i] != 0:
        Cnt[i] = 2
        continue
    else:
        pass
    for j in range(i, 10**6 + 8, i):
        Cnt[j] += 1

ans = 0
for i in A:
    if Cnt[i] == 1:
        ans += 1
    else:
        pass

print(ans)
import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

cities = [a, b, c, d, e]
min_val = 1e6
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)


### FIXED CODE ###

import math

n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

cities = [a, b, c, d, e]
min_val = 1e18
idx = 0
for i, x in enumerate(cities):
    if x < min_val:
        min_val = x
        idx = i

ans = 0 if idx == 0 else idx

ans += math.ceil(n / min_val)
ans = ans + 4 - idx
print(ans)
import counter

num = int(input())
s = [input() for i in range(num)].sort
if num == 1:
    print(1)
else:
    max_ans = 0
    for i in range(num):
        start = int(s[i])
        c = s.collections.Counter(1)
        current_ans = c[start]+c[start+1]+c[start+2]
        max_ans = max(current_ans,max_ans)
    print(max_ans) 

### FIXED CODE ###

import collections

num = int(input())
s = sorted(list(map(int, input().split())))
if num == 1:
    print(1)
else:
    c = collections.Counter(s)
    max_ans = 0
    for i in range(num):
        start = s[i]
        current_ans = c[start]+c[start+1]+c[start+2]
        max_ans = max(current_ans,max_ans)
        i += c[start]
    print(max_ans)
abc="abcdefghijklmnopqrstuvwxyz"

A=str(input())
n=len(A)
#make matrix (a-z)*(n characters)
#次にchrが出てくるindex
word_pos=[]
ct=[n]*26
orda=ord("a")

for i in range(n-1,-1,-1):
    ct[ord(A[i])-orda]=i
    word_pos.append(ct.copy())

word_pos.reverse()

dp=[0]*n+[1,0]
j=n
sep=[]
#区切れめをマーク
for i in range(n-1,-1,-1):
    ct=word_pos[i]
    if(max(ct)<j):
        #remove last chunk
        sep.append(i)
        j=min(ct)

sep.reverse()
ans=""
for i in abc:
    if(i not in A[:sep[0]]):
        ans+=i
        break

for i in range(0,len(sep)):
    start=sep[i]
    try:
        end=sep[i+1]
    except:
        end=n
    #ans[-1]が出現するタイミング
    next=word_pos[start][ord(ans[-1])-orda]
    for i in range(0,26):
        if(word_pos[next+1][i]>end-1):
            ans+=chr(orda+i)
            break
ans+="\n"
print(ans)

### FIXED CODE ###

abc="abcdefghijklmnopqrstuvwxyz"

A=str(input())
n=len(A)
#make matrix (a-z)*(n characters)
#次にchrが出てくるindex
word_pos=[]
ct=[n]*26
orda=ord("a")

for i in range(n-1,-1,-1):
    ct[ord(A[i])-orda]=i
    word_pos.append(ct.copy())

word_pos.reverse()

dp=[0]*n+[1,0]
j=n
sep=[]
#区切れめをマーク
for i in range(n-1,-1,-1):
    ct=word_pos[i]
    if(max(ct)<j):
        #remove last chunk
        sep.append(i)
        j=min(ct)
        
if(j==n):
    for i in abc:
        if(i not in A):
            print(i+"\n")
            break

else:
    sep.reverse()
    ans=""
    for i in abc:
        if(i not in A[:sep[0]]):
            ans+=i
            break

    for i in range(0,len(sep)):
        start=sep[i]
        try:
            end=sep[i+1]
        except:
            end=n
        #ans[-1]が出現するタイミング
        next=word_pos[start][ord(ans[-1])-orda]
        for i in range(0,26):
            if(word_pos[next+1][i]>end-1):
                ans+=chr(orda+i)
                break
    ans+="\n"
    print(ans)
while True:
 a,b=[int(i) in input().split()]
 print(len(a+b))

### FIXED CODE ###

while True:
 try:
  x,y=[int(i) for i in input().split()]
  print(len(str(x+y)))
 except EOFError:
  break
n = input().rsplit()
points = [int(i) for i in n]
dist = points[-2] - points[0]
if dist > points[-1]:
    print(':(')
else:
    print('Yay!')

### FIXED CODE ###

a, b, c, d, e, k = [int(input()) for i in range(6)]
if e-a > k:
    print(':(')
else:
    print('Yay!')
a,b = input().split()
c = a*b
if type(c) == int:
	s = c
s,t =c.split('.')
print(s)

### FIXED CODE ###

from decimal import Decimal
a,b = input().split()
c = int(a)*Decimal(b)
print(int(c))
n=int(input())
max=-1000001;min=1000001;g=0;i=0;
while i<n:
 j=int(input())
 if max<j:
  max=j
 if min>j:
  min=j
 g+=j
 i=i+1
print(mi,max,j)


### FIXED CODE ###

n=int(input())
max=-1000001;min=1000001;g=0;i=0;
num=list(map(int,input().split()))
for x in num:
 if max<x:
  max=x
 if min>x:
  min=x
 g+=x
 i+=1
print(min,max,g)
def prime_factorize(n):
    a = []
    if n=1:
      return 1
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
if __name__=='__main__':
  print(prime_factorize(N))

### FIXED CODE ###

N=int(input())
cnt=0
L=[3*5*7,3*5*9,3*5*11,3*5*13,3*7*9]
for l in L:
  cnt+=(l<=N)
print(cnt)
H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
while y<H:
  if y%2==0:
    if x<W-1:
      nx=x+1
      ny=y
    else:
      nx=x
      ny=y+1
  else:
    if x>0:
      nx=x-1
      ny=y
    else:
      nx=x
      ny=y+1
  if l[y][x]%2==1:
    l[ny][nx]+=1
    ans+=1
    J.append((x,y,nx,ny))
  x,y=nx,ny
  if x==[0,W-1][H%2] and y==H-1:
    break

print(ans)
for a,b,c,d in J:
  print(a,b,c,d)

### FIXED CODE ###

H,W=map(int,input().split())
l=[]
for i in range(H):
  l.append(list(map(int,input().split())))
  
x,y=0,0
p=1
J=[]
ans=0
if(H,W)==(1,1):
  print(0)
else:
  while y<H:
    if y%2==0:
      if x<W-1:
        nx=x+1
        ny=y
      else:
        nx=x
        ny=y+1
    else:
      if x>0:
        nx=x-1
        ny=y
      else:
        nx=x
        ny=y+1
    if l[y][x]%2==1:
      l[ny][nx]+=1
      ans+=1
      J.append((y+1,x+1,ny+1,nx+1))
    x,y=nx,ny
    if x==[0,W-1][H%2] and y==H-1:
      break

  print(ans)
  for a,b,c,d in J:
    print(a,b,c,d)
s = raw_input()

if 'B' not in s:
    print s
else:
    str_list = list(s)
    output_list = []
    for i, c in enumerate(str_list):
        if c != 'B':
            output_list.append(c)
        else:
            if output_list:
                output_list.pop()

print ''.join(output_list)


### FIXED CODE ###

s = raw_input()

str_list = list(s)
output_list = []
for i, c in enumerate(str_list):
    if c != 'B':
        output_list.append(c)
    else:
        if output_list:
            output_list.pop()

print ''.join(output_list)
s=input()
if s == ARC:
  print("ABC")
elif s == ABC:
  print("ARC")
else:
  print("input is wrong")

### FIXED CODE ###

s=input()
if s == "ARC":
  print("ABC")
elif s == "ABC":
  print("ARC")
else:
  print("input is wrong")
n,k=map(int,input().split())

class SegmentTree:
    def __init__(self,n,ele):

        self.ide_ele = ele

        self.num =2**(n-1).bit_length()
        self.seg=[self.ide_ele]*2*self.num


    #####segfunc######
    #クエリに応じて変える
    def segfunc(self,x,y):
        return max(x,y)

    def init(self,init_val):
        #set_val
        for i in range(n):
            self.seg[i+self.num-1]=init_val[i]    
        #built
        for i in range(self.num-2,-1,-1) :
            self.seg[i]=self.segfunc(self.seg[2*i+1],self.seg[2*i+2]) 
        
    def update(self,k,x):
        k += self.num-1
        self.seg[k] = x
        while k:
            k = (k-1)//2
            self.seg[k] = self.segfunc(self.seg[k*2+1],self.seg[k*2+2])
        
    def query(self,p,q):
        if q<=p:
            return self.ide_ele
        p += self.num-1
        q += self.num-2
        res=self.ide_ele
        while q-p>1:
            if p&1 == 0:
                res = self.segfunc(res,self.seg[p])
            if q&1 == 1:
                res = self.segfunc(res,self.seg[q])
                q -= 1
            p = p//2
            q = (q-1)//2
        if p == q:
            res = self.segfunc(res,self.seg[p])
        else:
            res = self.segfunc(self.segfunc(res,self.seg[p]),self.seg[q])
        return res

st=SegmentTree(300001,0)
dp=[0]*n
for i in range(n):
    a=int(input())
    dp[i]=max(dp[i],st.query(a-k,a+k+1)+1)
    st.update(a,dp[i])
    dp[i]=max(dp[i],st.query(0,300001))
print(dp[n-1])

### FIXED CODE ###

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

class SegmentTree:
    def __init__(self,n,ele):

        self.ide_ele = ele

        self.num =2**(n-1).bit_length()
        self.seg=[self.ide_ele]*2*self.num


    #####segfunc######
    #クエリに応じて変える
    def segfunc(self,x,y):
        return max(x,y)

    def init(self,init_val):
        #set_val
        for i in range(n):
            self.seg[i+self.num-1]=init_val[i]    
        #built
        for i in range(self.num-2,-1,-1) :
            self.seg[i]=self.segfunc(self.seg[2*i+1],self.seg[2*i+2]) 
        
    def update(self,k,x):
        k += self.num-1
        self.seg[k] = x
        while k:
            k = (k-1)//2
            self.seg[k] = self.segfunc(self.seg[k*2+1],self.seg[k*2+2])
        
    def query(self,p,q):
        if q<=p:
            return self.ide_ele
        p += self.num-1
        q += self.num-2
        res=self.ide_ele
        while q-p>1:
            if p&1 == 0:
                res = self.segfunc(res,self.seg[p])
            if q&1 == 1:
                res = self.segfunc(res,self.seg[q])
                q -= 1
            p = p//2
            q = (q-1)//2
        if p == q:
            res = self.segfunc(res,self.seg[p])
        else:
            res = self.segfunc(self.segfunc(res,self.seg[p]),self.seg[q])
        return res

st=SegmentTree(300001,0)
dp=[0]*n
for i in range(n):
    a=int(input())
    dp[i]=max(dp[i],st.query(max(0,a-k),min(300000,a+k)+1)+1)
    st.update(a,dp[i])
    dp[i]=max(dp[i],st.query(0,300001))
print(dp[n-1])
import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
LR = [tuple(map(int, input().split())) for _ in range(n)]

def quicksort(x):
    if x==[]: return []

    smallerSorted = quicksort([a for a in x[1:] if a[0] < x[0][0] or (a[0] == x[0][0] and a[1] => x[0][1])])
    biggerSorted = quicksort([a for a in x[1:] if a[0] > x[0][0] or (a[0] == x[0][0] and a[1] < x[0][1])])

    return(smallerSorted+[x[0]]+biggerSorted)

LR = quicksort(LR)

ans = [0] * (n+1)
temp = 10 ** 9
i = 1
for L, R in LR:
    temp = min(temp, R)
    if L > temp:
        break   
    ans[i] = temp - L + 1
    i += 1

temp = 10 ** 9
i = n - 1
L = LR[-1][0]
for x, R in reversed(LR):
    temp = min(temp, R)
    if L > temp:
        break
    ans[i] += temp - L + 1
    i -= 1

res = max(ans)
for L, R in LR:
    res = max(res, R - L + 1)

print(res)

### FIXED CODE ###

S = list(input())

n = len(S) + 1

a = [0] * n

for i, x in enumerate(S):
    if x == '<':
        a[i+1] = a[i] + 1
    else:
        a[i+1] = 0

for i, x in enumerate(reversed(S)):
    j = n - i - 1
    if x == '>':
        a[j - 1] = max(a[j] + 1, a[j-1])

print(sum(a))
H,W=list(map(int,input().split())) # R行 C列 の迷路を受け取る

canv=[]
for i in range(H):
    canv.append([])
    line_input=input() # 迷路を1行取得
    for j in range(W):
        canv[i].append(line_input[j:j+1]) # slice による部分文字列取得

dx=[1,0,-1,0]
dy=[0,1,0,-1]

def dfs(x,y):
    for i in range(4):
        canv[x][y]="."
        nx = x + dx[i]
        ny = y + dy[i]
        if 0<=nx and nx<H and 0<=ny and ny<W:
            if canv[nx][ny]=="#":
                dfs(nx,ny)

for i in range(H):
    for j in range(W):
        for k in range(4):
            nx1 = i + dx[k]
            ny1 = j + dy[k]
            if 0<=nx1 and nx1<H and 0<=ny1 and ny1<W:
                if canv[i][j]=="#" and canv[nx1][ny1]=="#":
                    dfs(i,j)
flg = True
for i in range(H):
    for j in range(W):
        if canv[i][j]=="#":
            flg = False
if flg: print("Yes")
else: print("No")

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

H,W=list(map(int,input().split())) # R行 C列 の迷路を受け取る

canv=[]
for i in range(H):
    canv.append([])
    line_input=input() # 迷路を1行取得
    for j in range(W):
        canv[i].append(line_input[j:j+1]) # slice による部分文字列取得

dx=[1,0,-1,0]
dy=[0,1,0,-1]

def dfs(x,y):
    for i in range(4):
        canv[x][y]="."
        nx = x + dx[i]
        ny = y + dy[i]
        if 0<=nx and nx<H and 0<=ny and ny<W:
            if canv[nx][ny]=="#":
                dfs(nx,ny)

for i in range(H):
    for j in range(W):
        for k in range(4):
            nx1 = i + dx[k]
            ny1 = j + dy[k]
            if 0<=nx1 and nx1<H and 0<=ny1 and ny1<W:
                if canv[i][j]=="#" and canv[nx1][ny1]=="#":
                    dfs(i,j)
flg = True
for i in range(H):
    for j in range(W):
        if canv[i][j]=="#":
            flg = False
if flg: print("Yes")
else: print("No")
N, X = map(int, input().split())
L = list(map(int, input().split()))
bound = 1
D = 0
i = 0
while X >= D + L[i] and i < N:
    bound += 1
    D = D + L[i]
    i += 1
print(bound)

### FIXED CODE ###

N, X = map(int, input().split())
L = list(map(int, input().split()))
bound = 1
D = 0
i = 0
for i in range(N):
    if X >= D + L[i]:
        bound += 1
        D = D + L[i]
    else:
        break
print(bound)
import sys
input = sys.stdin.readline


def main():
    S = input().strip()
    answer = []
    for i in range(1, len(S)+1):
        [answer.append(j) for j in range(i+4, len(S)+1)
         if int(S[i-1:j]) % 2019 == 0]
    print(len(answer))


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline


def main():
    S, W = map(int, input().split())
    print("safe") if S > W else print("unsafe")


if __name__ == "__main__":
    main()
K = int(input())
S = int(input())

ans = 0

for i in range(0,K+1):
    for j in range (0,K+1):
        for k in range (0,K+1):
            if (i + j + k) == S:
                ans = ans + 1
            

print(ans)


### FIXED CODE ###

K, S = map(int, input().split())

ans = 0

for i in range(0,K+1):
    for j in range (0,K+1):
        if (S-K) <= (i + j) <= S:
            ans = ans + 1
            continue
            

print(ans)
n = input()
if int(n) % sum(map(int, n)) == 0:
  print('Yes')
else;
  print('No')


### FIXED CODE ###

n = input()
if int(n) % sum(map(int, n)) == 0:
  print('Yes')
else:
  print('No')
canChange = {alphabet: True for alphabet in "abcedfghijklmnopqrstuvwxyz"}
 
s = str(input())
t = str(input())
 
for i in s:
  if !canChange[s[i]]:
    print("No")
    break
  elif s[i]!=t[i]:
    t.replace(t[i], s[i])
    canChange[t[i]] = False
  else: #s[i]==t[i]:
    canChange[t[i]] = False
    continue
    
return("Yes)

### FIXED CODE ###

table = {alphabet: "-" for alphabet in "abcedfghijklmnopqrstuvwxyz"}
rev_table = {alphabet: "-" for alphabet in "abcedfghijklmnopqrstuvwxyz"}

s = str(input())
t = str(input())

flag = True

for i in range(len(s)):
    if table[s[i]] == t[i]:
        continue
    elif table[s[i]] == "-":
        table[s[i]] = t[i]
    else:
        flag = False
        break

for i in range(len(t)):
    if rev_table[t[i]] == s[i]:
        continue
    elif rev_table[t[i]] == "-":
        rev_table[t[i]] = s[i]
    else:
        flag = False
        break

if flag is True:
    print("Yes")
else:
    print("No")
import sys
for line in sys.stdin:
    num = map(float,raw_input().split())
    x = (num[2]*num[4] - num[1]*num[5]) / (num[0]*num[4] - num[1]*num[3])
    y = (num[5]*num[0]-num[2]*num[3]) / (num[0]*num[4]-num[3]*num[1])
    print "%0.3f %0.3f"%(x,y)

### FIXED CODE ###

import sys
out=[]
for line in sys.stdin.readlines():
    num = map(float, line.strip().split())
    x = (num[2]*num[4] - num[1]*num[5]) / (num[0]*num[4] - num[1]*num[3])
    y = (num[5]*num[0] - num[2]*num[3]) / (num[0]*num[4] - num[3]*num[1])
    if x == 0:
        x=0.00
    if y == 0:
        y=0.00
    out.append( "%.3f %.3f"%(round(x,3),round(y,3)))
for i in xrange(len(out)):
    print out[i]
print((int(input())%int(input())+99)/100)

### FIXED CODE ###

n,k=map(int,input().split())
print(1 if n%k else 0)
n = input()

def dfs(i, f, s):
    if i == 3:
        if s==7:
            return f+"=7"
    return dfs(i+1, f+"+"+n[i+1], s+int(n[i+1])) or dfs(i+1, f+"-"+n[i+1], s-int(n[i+1]))

print(dfs(0, n[0], int(n[0])))

### FIXED CODE ###

s = input()

def dfs(i, f, sum):
    if i == 3:
        if sum == 7:
            print(f + "=7")
            exit()
    else:
        dfs(i+1, f + "+" + s[i+1], sum + int(s[i+1]))
        dfs(i+1, f + "-" + s[i+1], sum - int(s[i+1]))

dfs(0, s[0], int(s[0]))
n = int(input())
s = input()

if "ABC" in s:
  print(s.count("ABC")
else:
  print(0)

### FIXED CODE ###

n = int(input())
s = str(input())

if "ABC" in s:
    print(s.count("ABC"))
else:
    print(0)
import numpy as np
N, K, M = map(int,input().split())
A = list(map(int,input().split()))
A = np.array(A)
if M*N-np.mean(A)*(N-1) < 0:
    print(0)
elif M*N-np.mean(A)*(N-1)<K:
    print(Decimal(str(M*N-np.mean(A)*(N-1))).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
else:
    print(-1)



### FIXED CODE ###

x = input()
if x =='a':
    print('b')
if x =='b':
    print('c')
if x =='c':
    print('d')
if x =='d':
    print('e')
if x =='e':
    print('f')
if x =='f':
    print('g')
if x =='g':
    print('h')
if x =='h':
    print('i')
if x =='i':
    print('j')
if x =='j':
    print('k')
if x =='k':
    print('l')
if x =='l':
    print('m')
if x =='m':
    print('n')
if x =='n':
    print('o')
if x =='o':
    print('p')
if x =='p':
    print('q')
if x =='q':
    print('r')
if x =='r':
    print('s')
if x =='s':
    print('t')
if x =='t':
    print('u')
if x =='u':
    print('v')
if x =='v':
    print('w')
if x =='w':
    print('x')
if x =='x':
    print('y')
if x =='y':
    print('z')