Harryxun/stf_run huggingface dataset:
'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''
from math import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)

def myAnswer(A:int,B:int,C:int,D:int) -> int:
   divC = B//C - (A - 1)//C 
   divD = B//D - (A - 1)//D
   divCD = B//lcm(C,D) - (A - 1)//lcm(C,D) 
   # print(divC,divD,divCD)
   return (B - A + 1) - (divC + divD - divCD)

def modelAnswer():
   return
def main():
   A,B,C,D = map(int,input().split())
   print(myAnswer(A,B,C,D))

if __name__ == '__main__':
   main()

### FIXED CODE ###

'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

def myAnswer(A:int,B:int,C:int,D:int) -> int:
   divC = B//C - (A - 1)//C 
   divD = B//D - (A - 1)//D
   divCD = B//lcm(C,D) - (A - 1)//lcm(C,D) 
   # print(divC,divD,divCD)
   return (B - A + 1) - (divC + divD - divCD)

def modelAnswer():
   return
def main():
   A,B,C,D = map(int,input().split())
   print(myAnswer(A,B,C,D))

if __name__ == '__main__':
   main()
s=int(input())
t=s[::2]
u=s[1::2]
a=t.count(0)
b=u.count(0)
if a>=b:
  print(len(t)-a+b)
else:
  print(len(t)-b+a)

### FIXED CODE ###

s=input()
a=s[0]
cnt=0
for i in s[1:]:
    if i==a:
        cnt+=1
        if i=="0":
            a="1"
        else:
            a="0"
    else:
        a=i
print(cnt)
N = int(input())
A_B = [list(map(int,input().split())) for i in range(N)]
A_B = sorted(A_B,key=itemgetter(1))
#print(A_B)
s=0
for a_b in A_B:
  s+=a_b[0]
  lim = a_b[1]
  if s > lim:
    print("No")
    exit()
print("Yes")


### FIXED CODE ###

import sys
from operator import itemgetter
input = sys.stdin.readline
N = int(input())
A_B = [list(map(int,input().split())) for i in range(N)]
A_B = sorted(A_B,key=itemgetter(1))
#print(A_B)
s=0
for a_b in A_B:
  s+=a_b[0]
  lim = a_b[1]
  if s > lim:
    print("No")
    exit()
print("Yes")
import fractions
n = int(input())
a = list(map(int, input().split()))

this_gcd = max(a)
gcd_list = []

for i in a:
    this_gcd = fractions.gcd(this_gcd, i)

for I in range(len(a)):
    i = a[I]
    tmp = i // this_gcd
    key = 1
    for j in range(2, int(fractions.sqrt(tmp)) + 1):
        if tmp % j == 0:
            key = 0

    if key:
        del a[I]
        break

this_gcd = max(a)
for i in a:
    this_gcd = fractions.gcd(this_gcd, i)

print(this_gcd)

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int, input().split()))
if n <= 2:
    print(max(a))
else:
    gcd_left = [a[0]]
    gcd_right = [a[-1]]
    for i in range(1, n):
        gcd_left.append(fractions.gcd(a[i], gcd_left[-1]))
        gcd_right.append(fractions.gcd(a[n-i-1], gcd_right[-1]))
    gcd_right = gcd_right[::-1]
    # print(gcd_left, gcd_right)
    ans = max(gcd_left[-2], gcd_right[1])
    for i in range(n-2):
        ans = max(ans, fractions.gcd(gcd_right[i+2], gcd_left[i]))
    print(ans)
x, n = map(int, input().split())
p = list(map(int, input().split()))
l = sorted(p)
new = []
t = x in l

if n == 0: 
#t == False:
#re = x #n = 0でよかった。ここでは、listの中にxがなかったときにreにxを入れている。
else:
    for i in range(len(l)):
        TorF_1 = x + i + 1 in l
        TorF_2 = x - i - 1 in l
        if TorF_1 == False:
            re = x + i + 1
            break
        elif TorF_2 == False:
            re = x - i - 1
            break

print(re)


### FIXED CODE ###

x, n = map(int, input().split())
p = list(map(int, input().split()))
l = sorted(p)
new = []
t = x in l

if t == False:
    re = x #n = 0でよかった。ここでは、listの中にxがなかったときにreにxを入れている。
else:
    for i in range(len(l)):
        TorF_1 = x + i + 1 in l
        TorF_2 = x - i - 1 in l
        if TorF_2 == False:
            re = x - i - 1
            break

        elif TorF_1 == False:
            re = x + i + 1
            break
    
print(re)
n,m = list(map(int,input().split()))
ab = [list(map(int,input().split())) for i in range(m)]

*p, = range(n)
rank = [1]*n
def root(x):
    if x == p[x]:
        return x
    p[x] = y = root(p[x])
    return y
def unite(x, y):
    px = root(x); py = root(y)
    if px == py:
        return 0
    rx = rank[px]; ry = rank[py]
    if ry < rx:
        p[py] = px
    elif rx < ry:
        p[px] = py
    else:
        p[py] = px
        rank[px] += 1
    return 1
 
for a,b in ab:
    unite(a,b)

print( len(set(p)) - 1 )


### FIXED CODE ###

n,m = list(map(int,input().split()))
ab = [list(map(int,input().split())) for i in range(m)]

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(n)
 
for a,b in ab:
    uf.union(a-1,b-1)

print( uf.group_count() - 1 )
# -*- coding: utf-8 -*-
"""
Contents   : AtCoder Grand Contest 024 B問題 WA
Author     : Kitaura Hiromi
LastUpdate : 20180520
Since      : 20180520
"""
N = int(input())
p = [int(input()) for i in range(N)]
q = [0 for i in range(N)]
for i in range(N):
    q[p[i]-1] = i

cnt = 1
seq = []
for i in range(N-1):
    if q[i+1] - q[i] > 0:
        cnt += 1
    else:
        seq.append(cnt)
        cnt = 1
max_cnt = max(seq)
print(N - max_cnt)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Contents   : AtCoder Grand Contest 024 B問題 WA
Author     : Kitaura Hiromi
LastUpdate : 20180520
Since      : 20180520
"""
N = int(input())
p = [int(input()) for i in range(N)]
q = [0 for i in range(N)]
for i in range(N):
    q[p[i]-1] = i

cnt = 1
max_cnt = 1
for i in range(N-1):
    if q[i+1] > q[i]:
        cnt += 1
    else:
        max_cnt = max(max_cnt, cnt)
        cnt = 1
max_cnt = max(max_cnt, cnt)
print(N - max_cnt)
import sys

N = int(input())
D = list(map(int,input().split()))
mod = 998244353 

D.sort()
T = [0 for _ in range(N)]

for i in range(N):
    T[D[i]] += 1

i = 0
ans = 1
if T[i] != 1:
    print(0)
    sys.exit()
pre = T[i]
i += 1
while T[i] != 0:
    ans *= pow(pre,T[i],mod)
    ans %= mod
    pre = T[i]
    i += 1

while i < N:
    if T[i] > 0:
        print(0)
        sys.exit()
    i += 1

ans %= mod
print(ans)

### FIXED CODE ###


N = int(input())
D = list(map(int,input().split()))
mod = 998244353 
flg = True

if D[0] != 0:
    flg = False
    
D.sort()
T = [0 for _ in range(N + 1)]

for i in range(N):
    T[D[i]] += 1

i = 0
ans = 1
if T[i] != 1:
    flg = False

pre = T[i]
i += 1
while T[i] != 0:
    ans *= pow(pre,T[i])
    ans %= mod
    pre = T[i]
    i += 1

while i < N:
    if T[i] > 0:
        flg = False
    i += 1

ans %= mod
if flg:
    print(ans)
else:
    print(0)
K,N=map(int,input().split())
A=list(map(int,input().split()))
x=[]
y=[]
for i in A:
  if i>10:
    a=20-i
    y.append(a)
  else:
    x.append(i)
if len(A)==1:
  if A[0]>=10:
    print(20-A[0])
  else:
    print(A[0])
else:
  ans=max(x)+max(y)
  print(ans)

### FIXED CODE ###

K,N=map(int,input().split())
A=list(map(int,input().split()))
sa=[]
sa.append(int(K-A[-1]+A[0]))
for i in range(1,N):
  tmp=A[i]-A[i-1]
  sa.append(tmp)
ans=K-max(sa)
print(ans)
def prime_factorize(n):
    a = []
    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
 
N,M=map(int,input().split())
primes0=prime_factorize(M)
keys=list(set(primes0))
primes={}
for i in range(len(keys)):
  k=keys[i]
  primes[k]=0
  for j in range(len(primes0)):
    if primes0[j]==k:
      primes[k]+=1
 
def cmb(n, k, mod, fac, ifac): #calc nCk under mod
    if n < k or n < 0 or k < 0:
        return 0
    else: 
        k = min(k, n-k)
        return fac[n] * ifac[k] * ifac[n-k] % mod
 
def make_tables(mod, n): #Make factorial and inverse tables under mod 
    fac = [1, 1] # factorial table
    ifac = [1, 1] #factorial of inverse table
    inverse = [0, 1] #inverse
 
    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
fac,ifac=make_tables(mod,N*3)
ans=1
for i in range(len(keys)):
  ans*=cmb(N+primes[keys[i]]-1, primes[keys[i]], mod, fac, ifac)
  ans%=mod
print(ans)

### FIXED CODE ###

def prime_factorize(n):
    a = []
    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
 
N,M=map(int,input().split())
primes0=prime_factorize(M)
keys=list(set(primes0))
primes={}
for i in range(len(keys)):
  k=keys[i]
  primes[k]=0
  for j in range(len(primes0)):
    if primes0[j]==k:
      primes[k]+=1
 
def cmb(n, k, mod, fac, ifac): #calc nCk under mod
    if n < k or n < 0 or k < 0:
        return 0
    else: 
        k = min(k, n-k)
        return fac[n] * ifac[k] * ifac[n-k] % mod
 
def make_tables(mod, n): #Make factorial and inverse tables under mod 
    fac = [1, 1] # factorial table
    ifac = [1, 1] #factorial of inverse table
    inverse = [0, 1] #inverse
 
    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
fac,ifac=make_tables(mod,N*10)
ans=1
for i in range(len(keys)):
  ans*=cmb(N+primes[keys[i]]-1, primes[keys[i]], mod, fac, ifac)
  ans%=mod
print(ans)
class Node:
    def __init__(self, id):
        self.id = id
        self.node1 = 0
        self.node2 = 0
        self.val = 0

    def set_node(self, node):
        if self.node1 == 0:
            self.node1 = node
        else:
            self.node2 = node


def add_val(node, val):
    global tree
    if node.id == 0:
        return
    node.val += val
    add_val(tree[node.node1], val)
    add_val(tree[node.node2], val)


n, q = map(int, input().split())
tree = [Node(id) for id in range(n + 1)]

for i in range(n - 1):
    a, b = map(int, input().split())
    tree[a].set_node(b)

for i in range(q):
    p, x = map(int, input().split())
    add_val(tree[p], x)

print(*[tree[i].val for i in range(1, n + 1)])


### FIXED CODE ###

import sys

input = sys.stdin.readline


class Node:
    def __init__(self, parent_id=None):
        self.val = 0
        self.parent_id = parent_id


n, q = map(int, input().split())
tree = [Node() for _ in range(n)]

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

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

for i in range(1, n):
    tree[i].val += tree[tree[i].parent_id].val

print(*[node.val for node in tree])
s = input()

if s == "SUN":
  print("7")
elif s == "MON":
  print("6")
elif s == "TUE":
  print("5")
elif s == "WED":
  print("4")
elif s == "THU":
  print("3")
elif s == "FRI":
  print("2")
else
  print("1")

### FIXED CODE ###

s = input()

if s == "SUN":
  print("7")
elif s == "MON":
  print("6")
elif s == "TUE":
  print("5")
elif s == "WED":
  print("4")
elif s == "THU":
  print("3")
elif s == "FRI":
  print("2")
else:
  print("1")
while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    
    if op == '?':
        break
        
        
    if op == '+':
        print(a + b)
        
    if op == '-':
        print(a - b)
        
    if op == '*':
        print(a * b)
        
    if op == '/':
        print(a / b)

       break

### FIXED CODE ###

while True:
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    
    if op == '?':
        break
        
        
    if op == '+':
        print(a + b)
        
    if op == '-':
        print(a - b)
        
    if op == '*':
        print(a * b)
        
    if op == '/':
        print(a // b)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
S = np.frombuffer(b'-'+readline().rstrip(),'S1')
Q = int(readline())
query = map(int,read().split())

isD = S == b'D'
isM = S == b'M'
isC = S == b'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

for K in query:
    x = cumD.copy(); x[K:] -= cumD[:-K]
    x *= isM
    x[K+1:] -= isD[1:-K] * (cumM[K:-1] - cumM[:-K-1])
    print(x.cumsum() * isC).sum()

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
S = np.frombuffer(readline().rstrip(),'S1')
Q = int(readline())
query = map(int,read().split())

isD = S == b'D'
isM = S == b'M'
isC = S == b'C'

cumD = isD.cumsum(dtype=np.int64)
cumM = isM.cumsum(dtype=np.int64)

def F(K):
    """
    ・Cごとに数える。
    ・そのためには(i-K,i] 内のDMの個数を調べる（負インデックスには関係ない文字があると思っておく）
    ・区間内のDの個数、Mの個数が取得できれば、差分が取得できるので最後に累積和
    """
    # (i-K,i]内のDの個数、Mの個数
    D = cumD.copy(); D[K:] -= cumD[:-K]
    M = cumM.copy(); M[K:] -= cumM[:-K]
    # 最後がMのとき、Dの個数分増える
    DM = isM * D
    # 左端のDを捨てるとき、Mの個数分減る
    DM[K:] -= isD[:-K] * M[K-1:-1]
    np.cumsum(DM,out=DM)
    # Cごとに集計
    return DM[isC].sum()

print('\n'.join(str(F(K)) for K in query))
a,b,c=map(int,input().split())
cnt=0
for i in range(min(a,b)):
  if i%a==0 && j%a==0:
    cnt+=1
  if cnt==c:
    print(i)
    break

### FIXED CODE ###

a,b,k=map(int,input().split())
ret=0;
for i in reversed(range(min(a,b)+1)):
  if a%i==0 and b%i==0:
    ret+=1
  if ret==k:
    print(i)
    break
s = input().split()
a, b, c = s[0], s[1], s[2]
if b.startswith(a[-1:]) and c.stratswith(b[-1:]):
  print("YES")
else:
  print("NO")

### FIXED CODE ###

s = input().split()
a, b, c = s[0], s[1], s[2]
if b.startswith(a[-1:]) and c.startswith(b[-1:]):
  print("YES")
else:
  print("NO")
def f(horizontal_flag):
    if horizontal_flag[0]:
        if horizontal_flag[1]:
            return 3
        else:
            return 1
    else:
        return 2

if N == 1:
    print(3)    
else:
    if A[0] == A[1]:
        counter = 6
        initial_num = 2
        horizontal_flag = [0,1]
    else:
        counter = 3
        initial_num = 1
        horizontal_flag = [0,1]


    for i in range(initial_num,N):
        if i == N-1:
            if horizontal_flag[1] == 2:
                horizontal_flag[1] = 1
                counter *= f(horizontal_flag)
            else:
                horizontal_flag[1] = 0
                counter *= f(horizontal_flag)
        elif A[i] == A[i+1]:
            horizontal_flag[1] = 2
        else:
            if horizontal_flag[1] == 2:
                horizontal_flag[1] = 1
                counter *= f(horizontal_flag)
            else:
                horizontal_flag[1] = 0
                counter *= f(horizontal_flag)
            horizontal_flag[0] = horizontal_flag[1]
    print(counter % 1000000007)

### FIXED CODE ###

N = int(input())
A = input()
B = input()

def f(horizontal_flag):
    if horizontal_flag[0]:
        if horizontal_flag[1]:
            return 3
        else:
            return 1
    else:
        return 2

if N == 1:
    print(3)    
else:
    if A[0] == A[1]:
        counter = 6
        initial_num = 2
        horizontal_flag = [1,0]
    else:
        counter = 3
        initial_num = 1
        horizontal_flag = [0,0]

    for i in range(initial_num,N):
        if i == N-1:
            if horizontal_flag[1] == 2:
                horizontal_flag[1] = 1
                counter *= f(horizontal_flag)
            else:
                horizontal_flag[1] = 0
                counter *= f(horizontal_flag)
        elif A[i] == A[i+1]:
            horizontal_flag[1] = 2
        else:
            if horizontal_flag[1] == 2:
                horizontal_flag[1] = 1
                counter *= f(horizontal_flag)
            else:
                horizontal_flag[1] = 0
                counter *= f(horizontal_flag)
            horizontal_flag[0] = horizontal_flag[1]
    print(counter % 1000000007)
S = input()
 
keyence = "keyence"
 
isKey = False
for i in range(len(S) + 1):
    for j in range(i, len(S) + 1):
        rest_str = S[:i] + S[j:]
        if rest_str == keyence:
            isKey = True
            break
if isKey:
  pirnt('YES')
else:
  print('NO')

### FIXED CODE ###

S = input()
keyence = 'keyence'
n = False
for i in range(len(S) + 1):
    for j in range(i, len(S) + 1):
        rest_str = S[:i] + S[j:]
        if rest_str == keyence:
            n = True
            break
    if n:
        break
if n:
	print("YES")
else:
    print("NO")
S = input()
T = 'abcdefghijklmnopqrstuvwxyz'
print(sorted(list(set(T) - set(S)))[0])

### FIXED CODE ###

S = input()
T = 'abcdefghijklmnopqrstuvwxyz'
diff = sorted(list(set(T) - set(S)))
if diff:
    print(diff[0])
else:
    print('None')
N = int(input())
H = list(map(int, input().split()))
max_count = 0
for i in range(0, N-1):
  tmp_count = 0
  for j in range(i, N-1):
  	if H[j] >= H[j+1]:
      tmp_count=tmp_count+1

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
tmp = 0
s = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    tmp += 1
    s = max(s, tmp)
  else:
    tmp = 0
    
print(s)
n = int(input())
l = [int(input()) for i in range(n)]
l1=sorted(l)
a = l1[n//2]
b = l1[n//2+1]
if a == b:
  for i in range(n):
    print(a)
else:
  for i in l:
    if i <= a:
      print(b)
    else:
      print(a)
  

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
l1=sorted(l)
a = l1[n//2-1]
b = l1[n//2]
if a == b:
  for i in range(n):
    print(a)
else:
  for i in l:
    if i <= a:
      print(b)
    else:
      print(a)
# シンプルに左から探索するだけ
N = int(input())
A = [int(i) for i in input().split()]

L = [i+1 for i in range(3)]

cnt = 0
k = 0
for j in A:
  if j == L[k]:
    k += 1
  else:
    cnt += 1 

if k == 0:
  print(-1)
else:
  print(cnt)

### FIXED CODE ###

# シンプルに左から探索するだけ
N = int(input())
A = [int(i) for i in input().split()]

L = [i+1 for i in range(N)]

cnt = 0
k = 0
for j in A:
  if j == L[k]:
    k += 1
  else:
    cnt += 1 

if k == 0:
  print(-1)
else:
  print(cnt)
a, b, c, d = map(int,input().split())
    while True:
    c -= b
    if c <= 0:
        print("Yes")
        break

    a -= d
    if a <= 0:
        print("No")
        break

### FIXED CODE ###

a, b, c, d = map(int,input().split())
while True:
    c -= b
    if c <= 0:
        print("Yes")
        break

    a -= d
    if a <= 0:
        print("No")
        break
s = list(input())
numbers = 0
for i in s:
  if s[i] == 1:
    numbers +=1

print(numbers)

### FIXED CODE ###

s = list(input())
numbers = 0
for i in s:
  if i ==  "1":
    numbers += 1

print(numbers)
from sys import stdin
import math

N, X = [int(k) for k in stdin.readline().rstrip().split()]
x = [int(k) for k in stdin.readline().rstrip().split()]
y = [abs(k - X) for k in x]
C = y[0]
for l in range(N):
    C = math.gcd(C, y[l])
print(C)

### FIXED CODE ###

from sys import stdin
import fractions

N, X = [int(k) for k in stdin.readline().rstrip().split()]
x = [int(k) for k in stdin.readline().rstrip().split()]
y = [abs(k - X) for k in x]
C = y[0]
for l in range(N):
    C = fractions.gcd(C, y[l])
print(C)
import sys

week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
today = input()

for i, day in enumerate(week):
  if day == today:
    print(7 - i)
	sys.exit()

### FIXED CODE ###

import sys

week = ["SUN","MON","TUE","WED","THU","FRI","SAT"]
today = input()

for i, day in enumerate(week):
	if day == today:
		print(7 - i)
		sys.exit()
a = [int(input()) for i in range(5)]
k = int(input())
print("Yay!" if e-a<= k else ":(")

### FIXED CODE ###

a,b,c,d,e,k= int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
print("Yay!" if e-a<= k else ":(")
N = int(input())
l = list(map(int, input().split())
         
L = [i for i in l if i % 2 == 0]

K = [i for i in L if i % 3 != 0]

J = [i for i in K if i % 5 != 0]
         
if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")

### FIXED CODE ###

N = int(input())
l = list(map(int, input().split()))

L = [i for i in l if i % 2 == 0]
K = [i for i in L if i % 3 != 0]
J = [i for i in K if i % 5 != 0]

if len(J) == 0:
		print("APPROVED")
else:
        print("DENIED")
import math

a,b = map(int,input().split())
print(a * b // math.gcd(a, b))



### FIXED CODE ###

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

for i in range(1,10000000):
    c = a * i
    if c % b == 0:
        print(c)
        break
abcde,fghihgf,edcba

### FIXED CODE ###

s=input().split(",")
print(*s,sep=" ")
#!/usr/bin/env python3
import sys
import itertools
import collections
from queue import Queue
import functools
import math
INF = 10**9


def solve(N: int, K: int, x: "List[int]"):
    x_neg = ([-xx for xx in x if xx < 0]+[0])[::-1]
    x_pos = [0] + [xx for xx in x if xx >= 0]

    # 左先を考える
    # print(x_neg)
    # print(x_pos)
    left = [x_neg[i]*2 + x_pos[K-i] for i in range(len(x_neg))
            if K-i < len(x_pos)]
    if len(left) > 0:
        ansleft = min(left)
    else:
        ansleft = INF

    # 右先
    right = [x_pos[i]*2 + x_neg[K-i] for i in range(len(x_pos))
             if K-i < len(x_neg)]
    if len(right) > 0:
        ansright = min(right)
    else:
        ansright = INF
    # print(left)
    # print(right)
    print(min(ansright, ansleft))

    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
    K = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, x)


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import itertools
import collections
from queue import Queue
import functools
import math
INF = 10**9


def solve(N: int, K: int, x: "List[int]"):
    x_neg = ([-xx for xx in x if xx < 0]+[0])[::-1]
    x_pos = [0] + [xx for xx in x if xx >= 0]

    # 左先を考える
    left = [x_neg[i]*2 + x_pos[K-i] for i in range(len(x_neg))
            if 0 <= K-i and K-i < len(x_pos)]
    if len(left) > 0:
        ansleft = min(left)
    else:
        ansleft = INF

    # 右先
    right = [x_pos[i]*2 + x_neg[K-i] for i in range(len(x_pos))
             if 0 <= K-i and K-i < len(x_neg)]
    if len(right) > 0:
        ansright = min(right)
    else:
        ansright = INF
    # print(left)
    # print(right)
    print(min(ansright, ansleft))

    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
    K = int(next(tokens))  # type: int
    x = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, x)


if __name__ == '__main__':
    main()
l = list(input().split())
print(' 'a.join(map(str,sorted(l))))

### FIXED CODE ###

l = list(input().split())
print(' '.join(map(str,sorted(l))))