Harryxun/stf_run huggingface dataset:
a = list(map(int,input()))
b = a.count(’5')
c = a.count(’7')
if b == 2 and c ==1:
            print('YES')
else:
            print('NO')

### FIXED CODE ###

a = list(map(int,input().split()))
b = a.count(5)
c = a.count(7)
if b == 2 and c ==1:
            print('YES')
else:
            print('NO')
import math
from functools import reduce
import numpy as np

N = int(input())
As = [int(elm) for elm in input().split(" ")] 


def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass

if N >= 3:
    gs = []
    for i in range(0, (N//2)*2 , 2):
        g = math.gcd(As[i], As[i+1])
        gs.append(g)
    if N % 2 == 1:
        gs.append(As[N-1])

    while len(gs) != 2:
        #print(gs)
        new_gs = []
        N1 = len(gs)
        #print("len",len(gs), (N1//2)*2)
        for i in range(0, (N1//2)*2, 2):
            g = math.gcd(gs[i], gs[i+1])
            new_gs.append(g)
        if N1 % 2 == 1:
            new_gs.append(gs[-1])
        gs = new_gs

    g1, g2 = gs
    d1 = divisor(g1) 
    d2 = divisor(g2) 
    ds = sorted(d1 + d2, reverse=True)

    #print(gs)
    #print(ds)
    for d in ds:
        count = sum([int(A % d == 0) for A in As])
        if count >= N-1:
            out = d
            break

else:
    out = max(As)

print(out)

### FIXED CODE ###

#import math
from fractions import gcd

N = int(input())
As = [int(elm) for elm in input().split(" ")] 


def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass

if N >= 3:
    gs = []
    for i in range(0, (N//2)*2 , 2):
        g = gcd(As[i], As[i+1])
        gs.append(g)
    if N % 2 == 1:
        gs.append(As[N-1])

    while len(gs) != 2:
        #print(gs)
        new_gs = []
        N1 = len(gs)
        #print("len",len(gs), (N1//2)*2)
        for i in range(0, (N1//2)*2, 2):
            g = gcd(gs[i], gs[i+1])
            new_gs.append(g)
        if N1 % 2 == 1:
            new_gs.append(gs[-1])
        gs = new_gs

    g1, g2 = gs
    d1 = divisor(g1) 
    d2 = divisor(g2) 
    ds = sorted(d1 + d2, reverse=True)

    #print(gs)
    #print(ds)
    for d in ds:
        count = sum([int(A % d == 0) for A in As])
        if count >= N-1:
            out = d
            break

else:
    out = max(As)

print(out)
import numpy as np
#from numba import njit

#(N, K) = map(int, input().split())
#A = np.array(list(map(int, input().split())))
(N,M) = map(int, input().split())
X = map(int, input().split())
X = sorted(X)

Y = []
for i in range(1,M):
    Y.append((i,X[i] - X[i-1]))

Y = sorted(Y, key=lambda x: (x[1]))
Y.reverse()

Z = []
last = 0
for i in range(0,min(N-1, len(Y))):
    Z.append(X[last:Y[i][0]])
    last = Y[i][0]
Z.append(X[last:])
if len(Z) == 0:
    Z.append(X)

s = 0
for array in Z:
    u = max(array)
    l = min(array)
    s += u - l

print(s)

### FIXED CODE ###

import numpy as np
#from numba import njit

#(N, K) = map(int, input().split())
#A = np.array(list(map(int, input().split())))
(N,M) = map(int, input().split())
X = map(int, input().split())
X = sorted(X)

Y = []
for i in range(1,M):
    Y.append((i,X[i] - X[i-1]))

Y = sorted(Y, key=lambda x: (x[1]))
Y.reverse()

I = list(map(lambda x: x[0], Y[0:min(N-1, len(Y))]))
I.sort()

Z = []
last = 0
for i in range(0,min(N-1, len(Y))):
    if last < I[i]:
        Z.append(X[last:I[i]])
        last = I[i]
Z.append(X[last:])
if len(Z) == 0:
    Z.append(X)

s = 0
for array in Z:
    if len(array) > 0:
        u = max(array)
        l = min(array)
        s += u - l

print(s)
from otsutil.funcs import parg
_ = input()
A = map(int, input().split())
prev = next(A)
up = None
count = 1
for i in A:
    if prev < i:
        if up is None:
            up = True
        elif not up:
            count += 1
            up = None
    else:
        if up is None:
            up = False
        elif up:
            count += 1
            up = None
    prev = i
print(count)


### FIXED CODE ###

_ = input()
A = map(int, input().split())
prev = next(A)
up = None
count = 1
for i in A:
    if prev < i:
        if up is None:
            up = True
        elif not up:
            count += 1
            up = None
    elif prev > i:
        if up is None:
            up = False
        elif up:
            count += 1
            up = None
    prev = i
print(count)
A = []
 B = []
 for i in range(3):
     a, b = [int(n) for n in input().split()]
     A.append(a)
     B.append(b)

 counter = [0] * 4

 for i in range(3):
     counter[A[i] - 1] += 1
     counter[B[i] - 1] += 1

 oddscounter = 0

 for i in range(4):
     if counter[i] % 2 == 1:
         oddscounter += 1

 answer = ""
 if oddscounter >= 3:
     answer = "NO"
 else:
     answer = "YES"

 print(answer)


### FIXED CODE ###

A = []
B = []
for i in range(3):
    a, b = [int(n) for n in input().split()]
    A.append(a)
    B.append(b)

counter = [0] * 4

for i in range(3):
    counter[A[i] - 1] += 1
    counter[B[i] - 1] += 1

oddscounter = 0

for i in range(4):
    if counter[i] % 2 == 1:
        oddscounter += 1

answer = "YES"
if oddscounter >= 3:
    answer = "NO"
else:
    answer = "YES"

print(answer)
# -*- coding: utf-8 -*-
def main():
    StringN = input();
    listA = input().split();
    lsitA.sort();
#    newlistA = sorted(listA);
#    print(newlistA);

    for i in range(int(StringN)-1):
#        print(newlistA[i]);
#        print(newlistA[i+1]);
        if lsitA[i] == lsitA[i+1]:
            print('No');
#            print (i)
            return 0;
    print('Yes');


main();

### FIXED CODE ###

# -*- coding: utf-8 -*-
def main():
    StringN = input();
    listA = input().split();
    listA.sort();
#    newlistA = sorted(listA);
#    print(newlistA);

    for i in range(int(StringN)-1):
#        print(newlistA[i]);
#        print(newlistA[i+1]);
        if listA[i] == listA[i+1]:
            print('NO');
#            print (i)
            return 0;
    print('YES');


main();
S = str(input())
ans = set()

def dfs(i, j):
    if int(S[i:j+1])%2019 == 0:
        ans.add((i, j))
    if j == len(S)-1:
        return

    dfs(i, j+1)
    dfs(i+1, j+1)

if len(S) < 4:
    print(0)

else:
    dfs(0, 3)
    if not ans:
        print(0)
    else:    
        print(len(ans))

### FIXED CODE ###

s=input()
n=len(s)
mod=2019
d=0
p=1
ml=[0]*mod
for i in range(1,n+1):
  k=int(s[-i])
  d+=p*k
  d%=mod
  ml[d]+=1
  p*=10
  p%=mod
ans=0
for i in ml:
  ans+=i*(i-1)//2
print(ans+ml[0])
### from collections import Counter

n = int(input())
vn = list(map(int,input().split()))
vn_odd = [vn[i] for i in range(n) if i%2==1]
vn_even = [vn[i] for i in range(n) if i%2==0]
odd_freq = Counter(vn_odd).most_common(2)
even_freq = Counter(vn_even).most_common(2)

ans = 0

if odd_freq[0][0] != even_freq[0][0]:
    ans += n - odd_freq[0][1] - even_freq[0][1]
else:
    ans += n - max(odd_freq[0][1]+even_freq[1][1], odd_freq[1][1]+even_freq[0][1])
            
print(ans)


### FIXED CODE ###

import collections
 
def counter_top(c, exclude):
  for a in c.most_common():
    if a[0] != exclude:
      return a
  return (object(), 0)
 
def conv_seq(seq, exclude=None):
  c = collections.Counter(seq)
  mc = counter_top(c, exclude)
  return sum(c.values()) - mc[1], mc[0]
 
input()
vals = list(map(int, input().split()))
s1, a = conv_seq(vals[::2])
s2, b = conv_seq(vals[1::2])
if a != b:
  print(s1 + s2)
else:
  s1_new, _ = conv_seq(vals[::2], exclude=b)
  s2_new, _ = conv_seq(vals[1::2], exclude=a)
  print(min(s1_new + s2, s1 + s2_new))
INF = 10**10
def solve(h, n, a, b):
    ab = sorted(zip(a, b), key=lambda _:_[0]/_[1], reverse=True)
    dp = [-1] * h
    def f(h):
        best = INF
        for x, y in ab:
            if h-x <= 0:
                score = y
            else:
                if dp[h-x] == -1:
                    dp[h-x] = f(h-x)
                score = y + dp[h-x]
            if score < best:
                best = score
            else:
                break
        return best
    return f(h)

h, n = map(int, input().split())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())
print(solve(h, n, a, b))

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

INF = 10**10
def solve(h, n, a, b):
    ab = sorted(zip(a, b), key=lambda _:(_[0]/_[1], -_[0]), reverse=True)
    dp = [-1] * h
    def f(h):
        best = INF
        for x, y in ab:
            if h-x <= 0:
                score = y
            else:
                if dp[h-x] == -1:
                    dp[h-x] = f(h-x)
                score = y + dp[h-x]
            if score < best:
                best = score
            else:
                break
        return best
    return f(h)

h, n = map(int, input().split())
a = [0] * n
b = [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())
print(solve(h, n, a, b))
N = int(input())
S = input()
n = list(map(int, str(S)))
count = 1
mas = []
for i in range(N-1):
    if n[i] == n[i + 1]:
        count += 1
    else:
        mas.append(count)
        count = 1
        if i == N-2:
            mas.append(1)
        
l = len(mas)
mas2 = []
for m in K:
    

    if l%2==0:
            for k in range(l//2):
                mas2.append(mas[2*k+1] + mas[2*k] + mas[2*k+2])
        else:
            for k in range(l/2-1):
                mas2.append(mas[2*k+1] + mas[2*k] + mas[2*k+2])
            mas.append(mas[l-2] + mas[l-1])
    
    else:
        else:
            mas2.append(mas[0] + mas[1])
            for k in range(1, l//2):
                mas2.append(mas[2*k-1] + mas[2*k] + mas[2*k+1])
        else:
            mas2.append(mas[0] + mas[1])
            for k in range(1, l//2-1):
                mas2.append(mas[2*k+1] + mas[2*k] + mas[2*k-1])
            mas.append(mas[l-2] + mas[l-1])

            
            
print(max(mas2))

### FIXED CODE ###

from itertools import accumulate

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

S = input()
n = list(map(int, str(S)))
count = 1
mas = []
for i in range(N-1):
    if n[i] == n[i + 1]:
        count += 1
        if i == N-2:
            mas.append(count)
    else:
        mas.append(count)
        count = 1
        if i == N-2:
            mas.append(1)
        

mas2 = []
if n[0] == 0:
    mas.insert(0, 0)
    
if n[N-1] == 0:
    mas.append(0)
    
l=len(mas)
mas2=[0] + list(accumulate(mas))
#for i in range(1, 1+len(mas)):
#    mas2.append(sum(mas[:i]))
    
if K >= (l-1)/2:
    print(N)
else:
    mas3 = []
    k = int(((l-1)/2)-K+1)
    for i in range(k):
        mas3.append(mas2[K*2 + 2*i+1]-mas2[0 + 2*i])
    print(max(mas3))
import numpy as np
from numba import jit
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())))
@jit
for j in range(1, min(k+1, 50)):
    tmp = np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        tmp[max(0, i - a[i])] += 1
        tmp[min(i + a[i] + 1, n)] -= 1
    tmp = np.cumsum(tmp)
    a = tmp[:n]
print(*a)

### FIXED CODE ###

import numpy as np
from numba import jit
n, k = map(int, input().split())
a = np.array(list(map(int, input().split())))
@jit
def imos(a):
    tmp = np.zeros(n+1, dtype=np.int64)
    for i in range(n):
        tmp[max(0, i - a[i])] += 1
        tmp[min(i + a[i] + 1, n)] -= 1
    tmp = np.cumsum(tmp)
    return tmp[:n]

for j in range(1, min(k+1, 50)):
    a = imos(a)
print(*a)
# -*- coding: utf-8 -*-

# 関数定義
def dfs(now_p, visited, comb_p, p_num):
    # N頂点と同じ数のルートを通ったら有効なパスとして1を返す
    if len(visited) == p_num - 1:
        #print('get the paass!!')
        return 1

    ans = 0

    # now_pの検索
    for tmp_p in comb_p:
        if tmp_p[0] == now_p and tmp_p[0] not in visited:
            # comb_pのtmp
            tmp_comb = comb_p[:]
            tmp_comb.remove(tmp_p)
            # 往復対象の削除
            tmp_p_r = [tmp_p[1], tmp_p[0]]
            tmp_comb.remove(tmp_p_r)
            # visitedのtmp
            tmp_visited = visited[:]
            tmp_visited.append(tmp_p[0])
            #print(*tmp_visited, sep='')
            # 次の頂点
            next_p = tmp_p[1]
            #print('next_p: ', tmp_p[1])
            # dfsの再起呼び出し
            ans += dfs(next_p, tmp_visited, tmp_comb, p_num)

    return ans

## 入力読み取り
N, M = map(int, input().split())
a_b = []
tmp = []
tmp_r = []

# 辺読み取り
for i in range(N):
    tmp = list(map(int, input().split()))
    tmp_r = [tmp[1], tmp[0]]
    a_b.append(tmp)
    a_b.append(tmp_r)

visited = []

# 再起関数の実施
pass_num = dfs(1, visited, a_b, N)
print(pass_num)

### FIXED CODE ###

# -*- coding: utf-8 -*-

# 関数定義
def dfs(now_p, visited, comb_p, p_num):
    # N頂点と同じ数のルートを通ったら有効なパスとして1を返す
    if len(visited) == p_num:
        return 1

    ans = 0

    # now_pの検索
    for tmp_p in comb_p:
        if tmp_p[0] == now_p and tmp_p[1] not in visited:
            # visitedのtmp
            tmp_visited = visited[:]
            tmp_visited.append(tmp_p[1])
            #print(*tmp_visited)
            # 次の頂点
            next_p = tmp_p[1]
            #print('next_p: ', next_p)
            # comb_pのtmp
            tmp_comb = comb_p[:]
            tmp_comb.remove(tmp_p)
            # 往復対象の削除
            tmp_p_r = [tmp_p[1], tmp_p[0]]
            tmp_comb.remove(tmp_p_r)
            #print(*tmp_comb)
            # dfsの再起呼び出し
            ans += dfs(next_p, tmp_visited, tmp_comb, p_num)

    return ans

## 入力読み取り
N, M = map(int, input().split())
a_b = []
tmp = []
tmp_r = []

# 辺読み取り
for i in range(M):
    tmp = list(map(int, input().split()))
    tmp_r = [tmp[1], tmp[0]]
    a_b.append(tmp)
    a_b.append(tmp_r)

visited = [1]

# 再起関数の実施
pass_num = dfs(1, visited, a_b, N)
print(pass_num)
# -*- coding: utf-8 -*-

def dfs(num, dem, k, cur_num, prd, p, q, a, n):

    #print num, dem, k, cur_num, prd
    #time.sleep(0.5)
    if num == 0:
        #print "result: " + str(result)
        return 1

    result = 0

    i = cur_num
    while prd * i <= a:
        #print i, num, dem, k, cur_num, prd
        if (n - k) * dem < num * i:
            break
        # if num * i < dem:
        #     i += 1
        #     continue

        result += dfs((num * i) - dem, dem * i, k + 1, i, prd * i, p, q, a, n)
        i += 1

    return result

def func():
    while True:

        p, q, a, n = map(int, raw_input().split())

        if p == 0 and q == 0 and a == 0 and n == 0:
            break

        print dfs(p, q, 0, 1, 1, p, q, a, n)
        
    return None

if __name__ == '__main__':
    func()
    

### FIXED CODE ###

# -*- coding: utf-8 -*-

def dfs(num, dem, k, cur_num, prd, p, q, a, n):

    #print num, dem, k, cur_num, prd
    #time.sleep(0.5)
    if num == 0:
        #print "result: " + str(result)
        return 1

    result = 0

    i = cur_num
    while prd * i <= a:
        #print i, num, dem, k, cur_num, prd
        if (n - k) * dem < num * i:
            break
        if num * i < dem:
            i += 1
            continue

        result += dfs((num * i) - dem, dem * i, k + 1, i, prd * i, p, q, a, n)
        i += 1

    return result

def func():
    while True:

        p, q, a, n = map(int, raw_input().split())

        if p == 0 and q == 0 and a == 0 and n == 0:
            break

        print dfs(p, q, 0, 1, 1, p, q, a, n)
        
    return None

if __name__ == '__main__':
    func()
print('NO' if int(''.join(map(int,input().split())))%4 else 'YES')

### FIXED CODE ###

a,b,c=map(int,input().split())
print('NO' if (b*10+c)%4 else 'YES')
A, B, N = map(int, input().split())

lo = 1
hi = N

def f(x):
    return int(A*x/B)-A*int(x/B)

ans = 0
if B-1<=N:
    ans = f(B-1)

while hi > lo :
    if f(lo) <= f(hi):
        mid = (lo + hi) // 2
        if f(mid)<=f(mid+1):
            lo = mid+1
        else:
            lo = mid
    else:
        mid = -(-(lo + hi) // 2)
        hi = mid

ans = max(ans,f(lo),f(N-1),f(B*N//B-1)+1

print(ans)

### FIXED CODE ###

a, b, n = map(int, input().split())
x = min(b-1, n)
ans = int((a*x)/b) - a*int(x/b)
print(ans)
N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[0]
ma=a[0]
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)

### FIXED CODE ###

N=int(input())
a=[int(i) for i in input(). split ()]
mi=a[0]
ma=a[0]
i=0
while i<N:
    if a[i]>ma:
        ma=a[i]
    if a[i]<mi:
        mi=a[i]
    i+=1
print (ma-mi)
import math

N, X = map(int, input().split())
x = list(map(int, input().split()))

min_distance = abs(x[0] - X)
for i in x: min_distance = math.gcd(abs(i - X), min_distance)

print(min_distance)


### FIXED CODE ###

import fractions

N, X = map(int, input().split())
x = list(map(int, input().split()))

min_distance = abs(x[0] - X)
for i in x: min_distance = fractions.gcd(abs(i - X), min_distance)

print(min_distance)
A,B = int(input())
print(max(A+B,A-B,A*B))

### FIXED CODE ###

A,B = map(int,input().split())
print(max(A+B,A-B,A*B))
from operator import itemgetter

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

needs = [2, 5, 5, 4, 5, 6, 3, 7, 6]
lst_use = tuple(needs[aa - 1] for aa in a)
num_use = tuple(sorted(tuple(zip(a, lst_use)), key=itemgetter(0), reverse=True))
# print(num_use)
dp = [0] * (n + 1)
# dp[j] : j本から構成できる桁数の最大値

for j in range(2, n + 1):
    for use in lst_use:
        if j - use >= 0:
            dp[j] = max(dp[j], dp[j - use] + 1)

for j in range(1, n + 1):
    if dp[j] == 0:
        dp[j] = -10
    else:
        break
# dp[j] == 0 となる点をdp[0]だけにすることで、
# if dp[now - use] == dp[now] - 1:
# で、最後0本にたどり着くようになる

# print(dp)
now = n
ans = ''

# dp[1] = -10
# dp[2] = -10
while now > 0:
    for number, use in num_use:
        if dp[now - use] == dp[now] - 1:
            ans += str(number)
            now -= use
            # print(ans)
            break
    else:
        break

assert now == 0, now

print(ans)

### FIXED CODE ###

def chmax(x, y):
    if x == '-':
        return y

    lx = len(x)
    ly = len(y)
    if lx < ly:
        return y
    elif lx == ly:
        if x < y: return y
        else: return x
    else:
        return x


N, M = map(int, input().split())
a = list(map(int, input().split()))

cnt = [N + 1, 2, 5, 5, 4, 5, 6, 3, 7, 6]
dp = ['-' for _ in range(N + 10 + 1)]
dp[0] = ''
# dp[j]: j 本使ってできる最大の数

for i in range(N + 1):
    # print(dp)
    if dp[i] == '-': continue
    for aa in a:
        dp[i + cnt[aa]] = chmax(dp[i + cnt[aa]], dp[i] + str(aa))

print(dp[N])
n, m = map(int,input().split())
c = [0 for i in range(n)]
for i in range(m)
    a, b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1
for i in len(c):
    print(c[i])

### FIXED CODE ###

n, m = map(int,input().split())
c = [0 for i in range(n)]
for i in range(m):
    a, b = map(int,input().split())
    c[a-1] += 1
    c[b-1] += 1
for i in range(n):
    print(c[i])
import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i
    print(j)
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)  


### FIXED CODE ###

import numpy as np

S = str(input())

import numpy as np

for i in range(1,int(np.floor(len(S)/2))):
    j = int(np.floor(len(S)/2)) - i

    first_str = S[:j]
    second_str = S[j:2*j]
    if first_str == second_str:
        num = 2*j
        break
    elif (first_str != second_str) & (j==1):
        num = 0
        break

print(num)
from itertools import accumulate
import numpy as np
N=int(input())-1
L=[26**(i+1) for i in range(10)]
sL=list(accumulate(L))
result=[]
k=0
for i in range(10):
    if N<=sL[i] and N>=26:
        N-=sL[i-1]
        k=i
        break
for m in range(k):
    time=0
    while N>=L[k-m-1]:
        N-=L[k-m-1]
        time+=1
    result.append(chr(time+97))
result.append(chr(N+97))
print(''.join(result))

### FIXED CODE ###

from itertools import accumulate
import numpy as np
N=int(input())
N-=1
L=[26**(i+1) for i in range(15)]
sL=list(accumulate(L))
result=[]
k=0
for i in range(15):
    if N+1<=sL[i] and N>=25:
        N-=sL[i-1]
        k=i
        break
for m in range(k):
    time=0
    while N>=L[k-m-1]:
        N-=L[k-m-1]
        time+=1
    result.append(chr(time+97))
result.append(chr(N+97))
print(''.join(result))
S = input()
#S = str(1817181712114)
ans = 0

for a in range(len(S) - 3):
	for b in range(a+1, len(S)):
		if int(S[a:b+1]) % 2019 == 0:
			ans += 1        
print(ans)

### FIXED CODE ###

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

if S <= W :
	print("unsafe")
else :
	print("safe")
n = int(raw_input())
d = ""
for i in range(n):
    p,q = map(str,raw_input().split())
    if p == "insert":
        d += q
    elif p == "find":
        r = d.find(q)
        if(r >= 0):
            return "yes"
        else:
            return "no"

### FIXED CODE ###

n = int(raw_input())
d = set()
for i in range(n):
    p,q = map(str,raw_input().split())
    if p == "insert":
        d.add(q)
    elif p == "find":
        if(q in d):
            print "yes"
        else:
            print "no"
N=int(input())
print("Yes" if N[0]==7 or N[1]==7 or N[2]==7 else "No") 

### FIXED CODE ###

N=str(input())
print("Yes" if N[0]=="7" or N[1]=="7" or N[2]=="7" else "No")
arr = []

for i in range(int(input())):
  command_line = input().split(" ")
  command = command_line[0]
  arg = ""
  if len(command_line) > 1: arg = command_line[1]

  if command == "insert":
    arr.insert(0, arg)
  if command == "delete":
    arr.remove(arg)
  if command == "deleteFirst":
    del arr[0]
  if command == "deleteLast":
    del arr[-1]

print(" ".join(arr))

### FIXED CODE ###

from collections import deque

q = deque()

for i in range(int(input())):
  command_line = input().split(" ")
  command = command_line[0]
  arg = ""
  if len(command_line) > 1: arg = command_line[1]

  if command == "insert":
    q.appendleft(arg)
  elif command == "delete":
    try:
      q.remove(arg)
    except ValueError:
      pass
  elif command == "deleteFirst":
    q.popleft()
  else:
    q.pop()

print(" ".join(q))
def main():
    M = int(input())
    ans = 0
    dc = [[int(i) for i in input().split()] for _ in range(M)]
    s = "".join(str(d)*c for d, c in dc)
    if len(s) == 1:
        print(0)
    while len(s) > 2:
        s = str(int(s[0]) + int(s[0+1])) + s[0+2:]
        ans += 1
    while len(s) > 1:
        s = str(int(s[0]) + int(s[1]))
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    M = int(input())
    ans = 0
    dc = [[int(i) for i in input().split()] for _ in range(M)]
    dc_sum = 0
    for i in range(M):
        d = dc[i][0]
        c = dc[i][1]
        dc_sum += d*c
        ans += c
    if dc_sum % 9 == 0:
        print(ans - 1 + dc_sum//9 - 1)
    else:
        print(ans - 1 + dc_sum//9)


if __name__ == '__main__':
    main()
n = int(input())
A = list(map(int, input().split()))
count = 0
while True:
    for i in range(n):
        if (A[i] % 2 == 1) or (A[i] == 0):
            break
        A[i] = A[i] // 2
        s += 1
print(count)


### FIXED CODE ###

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

def count(A, n):
    for i in range(n):
        if (A[i] % 2 == 1) or (A[i] == 0):
            return False
        A[i] = A[i] // 2
    return True

while True:
    if count(A, n):
        s += 1
    else:
        break
    
print(s)
n, p = map(int,input().split())

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()

num = {}
s, e, i = 0, 0, 2
while s == 0:
  while p%i == 0:
    p //= i
    e += 1
    if(p == 1):
      s = 1
  if(e > 0):
    num[i] = e
  i += 1
  e = 0
cnt = 1
for k, v in num.items():
  if(v >= n):
    cnt *= k ** (v//n)
print(cnt)

### FIXED CODE ###

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

def calc(n):
  num = {}
  e, i = 0, 2
  while i**2 <= n:
    while n%i == 0:
      n //= i
      e += 1
    if(e > 0):
      num[i] = e
    i += 1
    e = 0
  return num

if(N == 1):
  print(P)
  exit()
elif(P == 1):
  print(1)
  exit()
else:
  cnt = 1
  for k, v in calc(P).items():
    if(v >= N):
      cnt *= k ** (v//N)
  print(cnt)
print("Yes" if [c for c in input()].sort()<[c for c in input()].sort(reversed=1) else "No"


### FIXED CODE ###

a,b=input(), input()
aa=[A for A in a]
aa.sort()
bb=[B for B in b]
bb.sort(reverse=1)
print("No" if aa>=bb else "Yes")