peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
l = [0] * 30
b = []
for i in range(n):
  x = a[i]
  t = ''
  j = 29
  while j >= 0:
    if x < 2**j:
      t += '0'
    else:
      x -= 2**j
      t += '1'
      l[j] += 1
    j -= 1
  b.append(t)
ans = []
for i in range(n):
  t = b[i]
  d = 0
  for j in range(30):
    k = l[j]
    if t[j] == '1':
      k += 1
    k %= 2
    d += k * 2**j
  ans.append(d)
print(*ans)
# Judge status: Wrong Answer
#pattern1:Only A-pizza/B-pizza
#pattern2:Only C-pizza
#pattern2:C-pizza & A or B-pizza

a,b,c,x,y = map(int, input().split())

price1 = x*a + y*b
price2 = max(x, y)*2*c
if x<=y:
  price3 = x*2*c
  price3 += (y-x)*b
else:
  price3 = y*2*c
  price3 += (y-x)*a

print(min(price1, price2, price3))
# Judge status: Accepted
import bisect
#二分探索をするライブラリ

n = int(input())
L = sorted(map(int,input().split()))
ans = 0

# c <= b <= a とする

for i in range(n-2):
    for j in range(i+1,n-1):
        a = L[n-1-i]
        b = L[n-1-j]
        
        if a-b < b:
            ans += (n-1-j) - bisect.bisect_left(L,a-b+1)
        
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

i = 0
per = True
while per == True:
    for index in range(n):
        num = a[index]
        ans = divmod(num, 2)
        if num == 0 or ans[1] != 0:
            per = False
            break
        a[index] = ans[0]
    i += 1
print(i)
# Judge status: Accepted
N = int(input())
nums = [int(input()) for _ in range(N)]
 
all_max = max(nums)
 
new_nums = list(nums)
new_nums.remove(all_max)
 
second_max = max(new_nums)  # max関数はfor文の中にいれずに、先に2番目の最大値をもとめておく
 
for i in range(N): #indexをまわしているので、iとおく
    if nums[i] == all_max: 
        print(second_max)
    else:
        print(all_max)
# Judge status: Accepted
from math import gcd
a, b = map(int, input().split())

gcd = gcd(a, b)
ans = 1
n = int(gcd**0.5) + 2
for i in range(2, n):
    if gcd%i == 0:
        ans += 1
        while gcd%i == 0:
            gcd //= i
    if gcd < i:
        break
if gcd >= n:
    ans += 1
if ans == 1 and gcd != 1:
    ans = 2
    
print(ans)
# Judge status: Wrong Answer
def divisors(n) -> list:
    res = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            res.append(i)
            if i != n // i:
                res.append(n // i)
    #res = sorted(res)
    return res
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 0
idx = 1

for i in a:
    if i != idx:
        ans += 1
    else:
        idx += 1

if ans == n:
    print(-1)
else:
    print(ans)
# Judge status: Accepted
from collections import Counter

_ = input()
a = [int(i) for i in input().split()]

ans = 0
for k, v in Counter(a).items():
    if k < v:
        ans += v - k
    elif v < k:
        ans += v
else:
    print(ans)
# Judge status: Accepted
N,H=map(int,input().split())

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

amax=max(a)
n=0
total=0
b.sort(reverse=True)
for i in range(N):
  if b[i] > amax:
    n+=1
    total+=b[i]
  else:
    break

if H <= total:
  for i in range(n):
    H-=b[i]
    if H <= 0:
      print(i+1)
      break
else:
  print(n+int((H-total-1)/amax)+1)
# Judge status: Accepted
X, N = map(int, input().split())
p = list(map(int, input().split()))
k = 0
ans = 0
c = True

while c:
    if (X - k) not in p:
        ans = X -  k
        c = False
        break
    elif (X + k) not in p:
        ans = X + k
        c = False
        break
    else:
        k += 1
        
print(ans)
# Judge status: Wrong Answer
N, X = map(int, input().split())
L = list(map(int, input().split()))
D = 0
count = 0
for i in range(1,N+1):
  if D>X:
    break
  else:
    D+=L[i-1]
  count+=1
print(count)
# Judge status: Accepted
List = list(map(int, input().split()))
res = 0
for i in range(len(List)):
  if List[i] == 0:
    res = i+1
  else:
    pass
print(res)
# Judge status: Wrong Answer
import sys
import os

def file_input():
    f = open('ARC080/input.txt', 'r')
    sys.stdin = f

def main():
    #ile_input()
    N=int(input())
    a_li=list(map(int, input().split()))

    # four=0
    odd=0
    for i in a_li:
        if i%4==0:
            odd-=1
        if i%2!=0:
            odd+=1
    else:
        if odd<=1:
            print('Yes')
        else:
            print('No')

if __name__ == '__main__':
    main()
# Judge status: Accepted
from itertools import groupby
N, K = map(int, input().split())
R, S, P = map(int, input().split())
D = {"r":P, "s":R, "p":S}
T = list(input())
c = 0
for i in range(K):
  gr = groupby(T[i::K])  
  for key, group in gr:
    l = len(list(group))
    d = D[key]
    c += d*((l+1)//2)
print(c)
# Judge status: Accepted
import collections
N = int(input())
S=[]
for i in range(N):
    S.append(input())
c = collections.Counter(S)
print('AC x {}'.format(c['AC']))
print('WA x {}'.format(c['WA']))
print('TLE x {}'.format(c['TLE']))
print('RE x {}'.format(c['RE']))
# Judge status: Accepted
N=int(input())
S=input()
B=[]
W=[]
i=0
while i<N:
    if S[i]=='#':
        B.append(i)
    else:
        W.append(i)
    i+=1

X=len(B)
Y=len(W)
ans=0
i=j=0
while i<X and j<Y:
    if B[i]<W[j]:
        i+=1
        j+=1
        ans+=1
    else:
        j+=1
print(ans)
# Judge status: Accepted
N=int(input())
A,B = map(int, input().split())
i=1
while 1:
    K=N*i
    if A <= K and K <= B:
        print('OK')
        break
    if K>B:
        print('NG')
        break
    i+=1
# Judge status: Accepted
N,M=map(int,input().split())

if N==1 and M==1:
    result=1

elif N==1:
    result=M-2

elif M==1:
    result=N-2

else:
    result=(M-2)*(N-2)

print(result)
# Judge status: Accepted
n = int(input())
w = [input() for i in range(n)]
ans = 'Yes'
if len(w)!= len(set(w)):
    ans = 'No'
else:
    for i in range(1,n):
        if w[i][0]!=w[i-1][-1]:
            ans = 'No'
            break
print(ans)
# Judge status: Wrong Answer
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
lst = input().split()
# %%
one = lst[0][0]
two = lst[0][1]
three = lst[0][2]


# %%
one_two = one == two
two_three = two == three
three_one = three == one




# %%
if any([one_two, two_three, three_one]):
    print('Yes')
else:
    print('No')


# %%
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
acount=0
bcount=0
ans=0

for i in range(n):
  bcount=0
  acount+=a[i]
  for j in range(i,n):
    bcount+=b[j]
    if ans<acount+bcount:
      ans=acount+bcount
print(ans)
# Judge status: Wrong Answer
n,a,b = map(int,input().split())

d = b - a
if d % 2 == 0:
  print(d//2)
else:
  ans = min(a,n-b)+d//2
  if d == 1:
    ans += 1
  print(ans)
# Judge status: Accepted
n, k, s = [int(v) for v in input().split()]

result = [s] * k

if s == 10 ** 9:
    result += [1] * (n - k)
else:
    result += [10 ** 9] * (n - k)

print(' '.join(map(str, result)))
# Judge status: Accepted
a, b = map(int, input().split())
if a >= 13:
    print(b)
elif 6 <= a <= 12:
    print(b//2)
else:
    print(0)
# Judge status: Wrong Answer
n, q = map(int, input().split())
s = input()
lst = [0] * n
for i in range(1, n):
  lst[i] = lst[i-1]
  if lst[i-1:i+1] == 'AC':
    lst[i] += 1

for i in range(q):
  l, r = map(int, input().split())
  print(lst[r-1] - lst[l-1])
# Judge status: Accepted
N=int(input())
s=[int(x) for x in input().split()]

ans=0
for i in range(N-1):
    if s[i]>s[i+1]:
        ans+=(s[i]-s[i+1])
        s[i+1]=s[i+1]+(s[i]-s[i+1])
print(ans)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))

c_4=0
even=0
odd=0

for i in l:
  if i%4==0:
    c_4+=1
  elif i%2==0:
    even+=1
  else:
    odd+=1
  
if even==0 and odd-1 <= c_4:
  ans="Yes"
else:
  ans="No"
  
if even>0 and odd <= c_4:
  ans="Yes"
elif even>0:
  ans="No"

print(ans)
# Judge status: Accepted
s = input()
t = input()

found_s = False
for i in range(len(s) - len(t), -1, -1):
    for c1, c2 in zip(s[i:i+len(t)], t):
        if c1 == '?' or c1 == c2:
            continue
        else:
            break
    else:
        found_s = True
        s = s[:i] + t + s[i+len(t):]
        break

if found_s:
    print(s.replace('?', 'a'))
else:
    print("UNRESTORABLE")
# Judge status: Wrong Answer
a = int(input())
if a == 3 or a == 5 or a == 7:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
A,B,C=map(int,input().split())
answer= False
if A==B or A==C or B==C:
  answer=True
if A==B and A==C and B==C:
  answer=False
print('Yes' if answer else 'No')
# Judge status: Accepted
a,b = map(int,input().split())
print(-1 if a % b == 0 else a)
# Judge status: Accepted
N = int(input())
d = list(map(int, input().split()))

d.sort()

half = int(N/2)
print(d[half]-d[half-1])
# Judge status: Accepted
import math
a = list(map(int, input().split()))
if sum(list(map(lambda x:x%2, a))) == 3:
    b = a.pop(a.index(max(a)))
    print(a[0]*a[1]*(math.ceil(b/2) - math.floor(b/2)))
else:
    print(0)
# Judge status: Accepted
n, k = map(int, input().split())
mod = 10 ** 9 + 7

ans = 0
c = 0   #combination
l = 0
h = 0
for i in range(1, n+2): #O(n)
    l += i - 1
    h += n + 1 - i
    c = (h - l + 1) % mod
    if i >= k:
        ans = (ans + c) % mod
    else:
        pass
print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()


def main():
    N = int(input())
    S = [int(input()) for _ in range(N)]
    S.sort()
    ans = sum(S)
    if ans % 10 != 0:
        print(ans)
        return
    subtract = 0
    for s in S:
        if s % 10 != 0:
            subtract = s
            break
    if subtract != 0:
        print(ans - subtract)
    else:
        print(0)


if __name__ == "__main__":
    main()
# Judge status: Accepted
S = input()
ans = 0
flag = False #繰り上がりありならTrue
flag2 = False #前が5ならTrue
for k in range(len(S)):
  n = int(S[-k-1])
  if flag2:
    if n < 5:
      flag = False
    else:
      flag = True
  if flag:
    n += 1
  if n == 5:
    ans += 5
    flag2 = True
    flag = False
  elif n < 5:
    ans += n
    flag2 = False
    flag = False
  else:
    ans += 10-n
    flag2 = False
    flag = True
if flag:
  ans += 1
print(ans)
# Judge status: Wrong Answer
def answer(n, a, b):
    if a > b: return 0
    if n < 2: return 0
    n = n-2
    small = a*n
    big = b*n
    return big - small + 1

n, a, b = map(int, input().split())
print(answer(n, a, b))
# Judge status: Wrong Answer
S = input()
tmp=0
ans=0
for s in S:
  if s in 'ACGT':
    tmp+=1
  else:
    ans = max(ans,tmp)
    tmp=0
print(ans)
# Judge status: Accepted
n=int(input())
d=list(map(int,input().split()))
ans=1 if d[0]<1 else 0
d.sort()
cnt=[0]*(d[-1]+1)
for i in range(n):
  cnt[d[i]]+=1
if cnt[0]!=1:ans=0
mod=998244353
for i in d[1:]:
  ans*=cnt[i-1]
  ans%=mod
print(ans)
# Judge status: Accepted
n = int(input())
C = list(input())
l, r, c = 0, n-1, 0
while l < r:
    if C[l] == 'W' and C[r] == 'R':
        l += 1
        r -= 1
        c += 1
    elif C[l] != 'W': l += 1
    elif C[r] != 'R': r -= 1
print(c)
# Judge status: Accepted
c = [list(map(int,input().split())) for _ in range(3)]
#print(LIST)
# a1 = 0 とする
a,b= [0,0,0],[0,0,0]
for i in range(3):
    b[i] = c[0][i] - a[0]
for j in range(1,3):
    a[j] = c[j][0] - b[0]
for i in range(1,3):
    for j in range(1,3):
        #print(a,b)
        if c[j][i] == a[j] + b[i]:
            pass
        else:
            print('No')
            exit()
print('Yes')
# Judge status: Accepted
import itertools

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

gnum = 0
for key, elems in itertools.groupby(S):
    gnum += 1

k = K
while gnum > 1 and K > 0:
    if gnum != 2:
        gnum -= 2
    else:
        gnum -= 1
    K -= 1

if gnum == 1:
    print(N - 1)
else:
    print(N - gnum)
# Judge status: Wrong Answer
# 03
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


N, M, K = LI()

for i in range(N):
    for j in range(M):
        if i*(M-j) + j*(N-i) == K:
            print('Yes')
            exit()

print('No')
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = []
tmp = 0
for i in range(n):
    tmp ^= a[i]

for i in range(n):
    ans.append(tmp ^ a[i])

print(*ans)
# Judge status: Accepted
def main():
    rice_cookie, participants = map(int, input().split(" "))
    if not rice_cookie % participants:
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
n = int(input())
a = [0] + [int(input()) for i in range(n)]
cnt = 1
next_a = a[1]
while cnt <= 10**5:
    next_a = a[next_a]
    cnt += 1
    if next_a == 2:
        break

if cnt <= 10**5:
    print(cnt)
else:
    print(-1)
# Judge status: Accepted
n = int(input())
l = [input().split()+[i+1] for i in range(n)]
l = sorted(l, key = lambda x:(x[0],-int(x[1])))
for i in l:
    print(i[2])
# Judge status: Accepted
print('Yes' if len(set(list(map(int,input().split()))))==2 else 'No')
# Judge status: Accepted
n = int(input())
a = [0 for i in range(10000)]
for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            w = (x+y+z)**2-z*x-z*y-x*y
            if w <= 10000:
                a[w-1] += 1
for i in range(n):
    print(a[i])
# Judge status: Accepted
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = inpl()
b = inpl()
res = 0
for x,y in zip(a,b):
    if x > y:
        res += x-y
    elif x < y:
        res -= (y-x)//2
# print(res)
print('No' if res > 0 else 'Yes')
# Judge status: Accepted
n,m = map(int, input().split())

ans = 0
if n*2 <= m:
  ans += n
  m -= n*2
else:
  ans += m//2
  m %= 2

if m >= 4:
  ans += m // 4
  
print(ans)
# Judge status: Wrong Answer
S = input()

new_S = ''

for i, s in enumerate(S):
  if s == '?' and i > 0:
    s = 'D' if new_S[i - 1] == 'P' else 'P'
  new_S += s
  temp = s

print(new_S)
# Judge status: Accepted
import sys
l = list(map(int,input().split()))

for i in range(3):
    if l[i] == sum(l[:i]+l[i+1:]):
        print('Yes')
        sys.exit()
print('No')
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
import math
def main():
    a, b, x = map(int, input().split())
    theta = None
    if 2*x <= a*a*b:
        theta = math.atan((a*b*b)/(2*x))
    else:
        theta = math.atan(2*(a*a*b-x)/(a**3))
        print("ok")
    print(math.degrees(theta))

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
N = int(input())
if N % 10 or N/10 == 9:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N,K = [int(hoge) for hoge in input().split()]
A = [int(hoge) for hoge in input().split()]
I = A.index(1)
R_Start = I - I%(K-1) + K #実質的なスタート
print(I//(K-1) + 1 + (N-R_Start+1)//(K-1))
#[AAA][AAA][AAA][AAA][BAAA]
#[AAA][AAA][AAA][AAA][ABAA]
#[AAA][AAA][AAA][AAA][AABA]
#[AAA][AAA][AAA][AAA][AAAB]
# Judge status: Wrong Answer
def calculate_area(a, b, h):
    return int((a + b)*h/2)
# Judge status: Accepted
n, a, b, c, d = map(lambda x:int(x)-1,input().split())
n += 1
S = input()

ok = True
overtake = False

if c < d:
    overtake = True
    
for i in range(a,d):
    if S[i] == "#" and S[i+1] == "#":
        ok = False

for i in range(b,min(d+1,n-1)):
    if S[i] == "." and S[i-1] == "." and S[i+1] == ".":
        overtake = True
        
if ok and overtake:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
s = input()
s_sort = ''.join(sorted(s))

t = input()
t_sort = ''.join(sorted(t, reverse=True))

if s_sort < t_sort:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from bisect import bisect_left
N = int(input())
a = list(map(int,input().split()))
a.sort()
x = a[-1]
print(x, a[bisect_left(a, x//2, hi=N-2)])
# Judge status: Accepted
# coding: utf-8
import bisect
import math
N, c, k = map(int,input().split())
T = []
for i in range(N):
    T.append(int(input()))
T.sort()
i=0
#print(T)
ans = 0
while True:
    t=bisect.bisect_right(T, T[i]+k)
    #print("i="+str(i))
    if t >= i+c:
        i += c
    else:
        i = t
    ans += 1
    #print(i, ans)
    if i >= N:
        break
print(ans)
# Judge status: Wrong Answer
def gcd2(a,b):
    x, y = max(a, b), min(a, b)
    if x % y == 0:
        return y
    else:
        while x % y != 0:
            x, y = y, x % y
        return x


K = int(input())
s = [gcd2(a, b) for a in range(1, K+1) for b in range(a+1, K+1)]
t = [2 * gcd2(a, b) for a in range(1, K+1) for b in s]
n = [gcd2(a, b) for a in range(1, K+1) for b in range(1, K+1)]
print(sum(t)+sum(n))
# Judge status: Accepted
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()
l = li()

l.sort()

ans = 0
from bisect import bisect_left
for i in range(len(l)-2):
    for j in range(i+1,len(l)-1):
        ab = l[i] + l[j]
        r = bisect_left(l, ab)
        ll = j+1
        ans += max(0, r-ll)

print(ans)
# Judge status: Accepted
n,x=map(int,input().split())
l=list(map(int,input().split()))
fly=0
count=1
for i in range(100):
  fly+=l[i]
  if fly<=x:
    count+=1
  else:
    break
print(count)
# Judge status: Accepted
def resolve():
    N, K = map(int, input().split())
    C = [0] * N
    for i in range(K):
        input()
        A = list(map(int, input().split()))
        for a in A:
            C[a-1] += 1

    print(C.count(0))

if __name__ == '__main__':
    resolve()
# Judge status: Wrong Answer
a, b = map(int, input().split())
x = 0
a_count = 0

for i in range(499500):
    x += i
    a_count += 1
    if a <= x:
        break

print(x - a)
# Judge status: Accepted
import sys

n = int(input())
a = int(input())

amari = n % 500

print("Yes") if amari <= a else print("No")
# Judge status: Accepted
K, X = map(int, input().split(" "))
print(' '.join([str(k) for k in range(X - K + 1, X + K)]))
# Judge status: Accepted
A, B = map(int, input().split())

a = A + B
if 23 < a:
    a = a - 24
    
print(a)
# Judge status: Accepted
def n2a(num):
  if num <= 26:
    return chr(ord("a")+num-1)
  elif num % 26 == 0:
    return n2a(num//26 - 1) + chr(ord("z"))
  else:
    return n2a(num//26) + chr(ord("a")-1 + num%26)
    


N = int(input())

print(n2a(N))
# Judge status: Accepted
N = int(input())

def f(n):
    ans = 0
    for s in str(n):
        ans += int(s)
    return ans

ans = float("INF")
for i in range(1, N):
    j = N-i
    ans = min(ans, f(i) + f(j))
    
print(ans)
# Judge status: Accepted
n = int(input())

print(n // 2 + n % 2)
# Judge status: Accepted
data = input().rstrip().split(" ")
people = int(data[0])
kind = int(data[1])
ans = [i+1 for i in range(people)]
for j in range(kind):
    empty = input()
    have = input().rstrip().split(" ")
    for k in have:
        if int(k) in ans:
            delete = ans.index(int(k))
            del ans[delete]
print(len(ans))
# Judge status: Wrong Answer
import math

n, k = map(int, input().split(" "))
r, s, p = map(int, input().split(" "))
t = input()

w = {"r": p, "s": r, "p": s}

li = [0 for _ in range(n)]
for i in range(len(t)):
    wp = w[t[i]]
    if not (i - k >= 0 and li[i - k] == wp):
        li[i] = wp

print(sum(li))
# Judge status: Accepted
n=int(input())
s=list(input())
l=[[0,s.count('.')]]
for i in range(n):
    if s[i]=='.':
        l.append([l[-1][0],l[-1][1]-1])
    else:
        l.append([l[-1][0]+1,l[-1][1]])

ans=10**10
for i in range(n+1):
    ans=min(ans,sum(l[i]))

print(ans)
# Judge status: Wrong Answer
a = int(input())
s = input()
if len(s) > a:
  print(s[:a+1]+"...")
else:
  print(s)
# Judge status: Accepted
import math
import itertools


def distance(start, end):
    return math.sqrt(sum((x - y) ** 2 for x, y in zip(start, end)))


N, D = map(int, input().split())
Xs = []
for _ in range(N):
    Xs.append(list(map(int, input().split())))

ans = 0
for p, q in itertools.combinations(Xs, 2):
    d = distance(p, q)
    if math.floor(d) == math.ceil(d):
        ans += 1
print(ans)
# Judge status: Accepted
S = input()
a = "No"
for i in range(1, 11):
    if S == "hi"*i:
        a = "Yes"
print(a)
# Judge status: Accepted
#ABC044B
n=input()
a=[]
for i in range(len(n)):
     a.append(n[i])
sum_=0
for i2 in range(len(a)):
    sum_=sum_+a.count(a[i2])%2

if sum_ == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
print("AB"+("C"if int(input())<1000else"D"))
# Judge status: Accepted
a,b,c,k = map(int,input().split())

if k <= a:
    print(k)
elif k <= a + b:
    print(a)
else:
    print(a-(k-a-b))
# Judge status: Accepted
n = int(input())
cnts = []
i = 0
while i*(i+1)//2 <= n:
    i += 1
    cnts.append(i)

rm = sum(cnts) - n
for i in cnts:
    if i == rm:continue
    print(i)
# Judge status: Accepted
x = int(input())

table = [False] * -~x
table[1] = True
for i in range(2, 32):
    j = i * i
    while j <= x:
        table[j] = True
        j *= i

print(max(i for i in range(x + 1) if table[i]))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    d,n=map(int, input().split())
    if n!=100:
        print(100**d*n)
    elif n==100:
        print(100**d*101)
resolve()
# Judge status: Accepted
n = int(input())

import math
x = math.ceil(n/1000)*1000-n
print (x)
# Judge status: Wrong Answer
a,b,c,d = map(int,input().split())
print(0 if c >= b else b-c)
# Judge status: Accepted
x = int(input())

for i in range(3,361):
    xk = x*i
    if xk%360 == 0:
        print(i)
        exit()
# Judge status: Wrong Answer
from collections import deque

s = deque(input())
t = deque(input())
n=len(s)

yes = False
for _ in range(n-1):
    if s == t:
        yes = True
        break
    s.rotate()

print('Yes' if yes else 'No')
# Judge status: Accepted
n = int(input())
x = list(map(int, input().strip().split()))
sum=0
minsum=0
for i in range(0,n):
    minsum += x[i]
for i in range(0,n-1):
    minsum-=x[i]
    sum += x[i]*minsum
    if(sum>10**9+7):
        sum%=(10**9+7)
print(sum)
# Judge status: Accepted
from collections import Counter
n=int(input())
a=[int(input()) for _ in range(n)]
ans=0
C=Counter(a)
#print(C)
for k,v in C.items():
    if v%2==1:
        ans+=1
print(ans)
# Judge status: Accepted
a, b = map(int, input().split())

if a == 1:
  if b == 1:
    print('Draw')
  else:
    print('Alice')
else:
  if b == 1:
    print('Bob')
  elif a > b:
    print('Alice')
  elif a == b:
    print('Draw')
  else:
    print('Bob')
# Judge status: Wrong Answer
def sum_from_1(n):
    return n * (n + 1) // 2


def main():
    x = int(input())
    straight = 0
    while True:
        if x < sum_from_1(straight):
            straight -= 1
            break
        straight += 1
    answer = straight + (x - sum_from_1(straight))
    print(answer)


if __name__ == '__main__':
    main()
# Judge status: Accepted
N,X,Y=list(map(int,input().split()))
A=[0 for i in range(N)]
for i in range(1,N):
    for j in range(i+1,N+1):
        A[int(min(j-i,abs(X-i)+abs(Y-j)+1))]+=1  
del A[0]
print(*A,sep=('\n'))
# Judge status: Wrong Answer
X=[int(input()) for i in range(5)]
Y=[]
for x in X:
  Y.append(-(-x//10)*10-x)
print(sum(Y)+sum(Y)-(max(Y)))
# Judge status: Accepted
from math import pi
r=int(input())
print(2*r*pi)
# Judge status: Wrong Answer
a, b = map(int, input().split())
c = list(map(int, input().split()))
d = sum(c)
print(a-d)
# Judge status: Accepted
a=input()
b=a.replace("?","D")
print(b)
# Judge status: Accepted
import sys
input = sys.stdin.readline

def main():
    sx,sy,tx,ty = map(int,input().split())
    dx = tx-sx
    dy = ty-sy
    
    ans = ["R"*dx + "U"*dy + "L"*dx + "D"*dy+"D"+"R"*(dx+1)+"U"*(dy+1)+"L"+"U"+"L"*(dx+1)+"D"*(dy+1)+"R"]
    
    print(*ans)
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
x = int(input())
max_val = 1
for i in range(1, x):
    for j in range(2, x):   
        val = i ** j
        if val > x:
            break
        elif val > max_val:
            max_val = val
print(max_val)