Harryxun/stf_run huggingface dataset:
def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a


def divisor(a):
    res = set()
    for i in range(1, int(a * 0.5 + 1)):
        if a % i == 0:
            res.add(i)
            res.add(a // i)
    return sorted(res)


a, b, k = map(int, input().split())
ans = divisor(gcd(a, b))[-k]
print(ans)

### FIXED CODE ###

def gcd(a, b):
    while b > 0:
        a, b = b, a % b
    return a


def divisor(a):
    res = set()
    for i in range(1, int(a * 0.5 + 1) + 1):
        if a % i == 0:
            res.add(i)
            res.add(a // i)
    return sorted(res)


a, b, k = map(int, input().split())
ans = divisor(gcd(a, b))[-k]
print(ans)
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)


n, x = [int(_) for _ in input().split()]
x_list = [int(_) for _ in input().split()]

list = [abs(x_list[i] - x) for i in range(n)]

answer = gcd_list(list)
print(answer)


### FIXED CODE ###

from fractions import gcd
from functools import reduce


def gcd_list(numbers):
    return reduce(gcd, numbers)


n, x = [int(_) for _ in input().split()]
x_list = [int(_) for _ in input().split()]

list = [abs(x_list[i] - x) for i in range(n)]

answer = gcd_list(list)
print(answer)
N,M = map(int,input().split())
dp=[0]*(N+1)
path = [[] for _ in range[N]]
for i in range(M):
  x,y = map(int,input().split())
  path[x].append(y)
  dp[y]=-1
  
cur = []
for i in range(1,N+1):
  if dp[i]==0:
    cur.append(i)

while(cur):
  nxt = set()
  for x in cur:
    for y in path[x]:
      dp[y] = max(dp[y],dp[x]+1)
      nxt.add(y)
  cur = []
  for x in nxt:
    cur.append(y)
print(max(dp))
    
  
  
    

### FIXED CODE ###

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

path = [[] for _ in range(N)]
pin = [0]*N
for _ in range(M):
  ip,op = map(int,input().split())
  pin[op-1]+=1
  path[ip-1].append(op-1)

cur = []
for i in range(N):
  if pin[i]==0:
    cur.append(i)

ans = 0
while cur:
  ans += 1
  nxt = []
  for ip in cur:
    for op in path[ip]:
      pin[op] -= 1
      if pin[op]==0 and not(op in nxt):
        nxt.append(op)
  cur = [x for x in nxt]
print(ans-1)
def solve():
    N = int(input())
    X = input()
    X_10 = int(X,2)

    r = X.count("1")
    r0 = r-1
    r1 = r+1
    ans = []
    
    s0 = X_10 % r0 
    s1 = X_10 % r1 

    for i in range(N):
        if X[i] == '0':
            ans.append(f((s1 + pow(2,N-1-i,r1)) % r1))
        else:
            if r == 1:
                ans.append(0)
            else:
                ans.append(f((s0 - pow(2,N-1-i,r0)) % r0))
    
    print(*ans, sep='\n')

def f(N):
    cnt = 1
    while N != 0:
        N = N % popcount(N)
        cnt += 1
    
    return cnt

def popcount(N):
    b = bin(N)
    cnt = 0
    for i in range(2,len(b)):
        if b[i] == '1':
            cnt += 1

    return cnt

if __name__ == '__main__':
    solve()

### FIXED CODE ###

def solve():
    N = int(input())
    X = input()
    X_10 = int(X,2)

    r = X.count("1")
    r0 = r-1
    r1 = r+1
    ans = []
    
    s0 = X_10 % r0 if r != 1 else None
    s1 = X_10 % r1 

    for i in range(N):
        if X[i] == '0':
            ans.append(f((s1 + pow(2,N-1-i,r1)) % r1))
        else:
            if r0 == 0:
                ans.append(0)
            else:
                ans.append(f((s0 - pow(2,N-1-i,r0)) % r0))
    
    print(*ans, sep='\n')

def f(N):
    cnt = 1
    while N != 0:
        N = N % popcount(N)
        cnt += 1
    
    return cnt

def popcount(N):
    b = bin(N)
    cnt = 0
    for i in range(2,len(b)):
        if b[i] == '1':
            cnt += 1

    return cnt

if __name__ == '__main__':
    solve()
def solve(values: List[int], nb: int) -> Optional[int]:
    for _v in values:
        pass
    return nb


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    N = int(input())
    values = list(map(int, input().split()))
    result = solve(values, N)
    print(result)

print(0)

### FIXED CODE ###

#!/usr/bin/env python3
# vim: set fileencoding=utf-8

# pylint: disable=unused-import, invalid-name, missing-docstring, bad-continuation


"""Module docstring
"""

import functools
import heapq
import logging
import math
import random
import string
import sys
from argparse import ArgumentParser
from collections import defaultdict
from copy import deepcopy


def solve(values, nb):
    cost_to = [0] * nb
    cost_to[1] = abs(values[1] - values[0])
    for i in range(2, nb):
        cost_to[i] = min(
            cost_to[i - 2] + abs(values[i] - values[i - 2]),
            cost_to[i - 1] + abs(values[i] - values[i - 1]),
        )
    return cost_to[nb - 1]


def do_job():
    "Do the work"
    LOG.debug("Start working")
    # first line is number of test cases
    N = int(input())
    values = list(map(int, input().split()))
    result = solve(values, N)
    print(result)


def print_output(testcase, result) -> None:
    "Formats and print result"
    if result is None:
        result = "IMPOSSIBLE"
    print("Case #{}: {}".format(testcase + 1, result))


def configure_log(log_file=None) -> None:
    "Configure the log output"
    log_formatter = logging.Formatter(
        "%(asctime)s - %(filename)s:%(lineno)d - " "%(levelname)s - %(message)s"
    )
    if log_file:
        handler = logging.FileHandler(filename=log_file)
    else:
        handler = logging.StreamHandler(sys.stdout)
    handler.setFormatter(log_formatter)
    LOG.addHandler(handler)


LOG = None
# for interactive call: do not add multiple times the handler
if not LOG:
    LOG = logging.getLogger("template")
    configure_log()


def main(argv=None):
    "Program wrapper."
    if argv is None:
        argv = sys.argv[1:]
    parser = ArgumentParser()
    parser.add_argument(
        "-v",
        "--verbose",
        dest="verbose",
        action="store_true",
        default=False,
        help="run as verbose mode",
    )
    args = parser.parse_args(argv)
    if args.verbose:
        LOG.setLevel(logging.DEBUG)
    do_job()
    return 0


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    sys.exit(main())
from collections import deque
import sys
input = sys.stdin.readline

def bfs(graph, start):
    while graph != {}:
        start = min(graph.keys())
        queue = deque([])
        queue.append(start)
        pos = {}
        pos[start] = 0

        while queue:
            u = queue.popleft()
            if u not in graph:
                continue
            for v,d in graph[u].items():
                if v not in pos:
                    pos[v] = pos[u] + d
                    queue.append(v)
                elif pos[v] != pos[u] + d:
                    return False
            del graph[u]
            # print(queue)
        return True

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

graph = {}
for i in range(m):
    l,r,d = map(int, input().split())
    if l not in graph:
        graph[l] = {}
    graph[l][r] = d
    if r not in graph:
        graph[r] = {}
    graph[r][l] = -d

if bfs(graph, min(graph.keys())):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

from collections import deque
import sys
input = sys.stdin.readline

def bfs(graph, start):
    while graph != {}:
        start = min(graph.keys())
        queue = deque([])
        queue.append(start)
        pos = {}
        pos[start] = 0
        while queue:
            u = queue.popleft()
            for v,d in graph[u].items():
                if v not in pos:
                    pos[v] = pos[u] + d
                    if v in graph:
                        queue.append(v)
                elif pos[v] != pos[u] + d:
                    return False
            del graph[u]
            # print(queue)
    return True

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

graph = {}
for i in range(m):
    l,r,d = map(int, input().split())
    if l not in graph:
        graph[l] = {}
    graph[l][r] = d
    if r not in graph:
        graph[r] = {}
    graph[r][l] = -d

if m == 0 or bfs(graph, min(graph.keys())):
    print('Yes')
else:
    print('No')
# print(graph)
import sys

MOD = 10 ** 9 + 7

h, w, k = map(int, sys.stdin.readline().split())

def main():
    ok = []
    for i in range(2 ** (w - 1)):
        prev = False
        for j in range(w-1):
            if i >> j & 1:
                if prev:
                    break
                else:
                    prev = True
            else:
                prev = False
        else:
            ok.append(i)

    lcr = [(letter, 0) for letter in 'lcr']
    a = [dict(lcr) for _ in range(w)]
    for i in ok:
        j = 0
        while j < w:
            if i >> j & 1:
                a[j]['r'] += 1
                a[j+1]['l'] += 1
                j += 2
            else:
                a[j]['c'] += 1
                j += 1

    res = [0] * w
    res[0] = 1
    for _ in range(h):
        nex = [0] * w
        for j in range(w):
            if j == 0:
                nex[j] = res[j] * a[j]['c'] + res[j+1] * a[j]['r']
            elif j < w - 1:
                nex[j] = res[j-1] * a[j]['l'] + res[j] * a[j]['c'] + res[j+1] * a[j]['r']
            else:
                nex[j] = res[j-1] * a[j]['l'] + res[j] * a[j]['c']
        for j in range(w):
            nex[j] %= MOD
        res = nex
        
    return res[k-1]
    
if __name__ == '__main__':
    ans = main()
    print(ans)

### FIXED CODE ###

import sys

MOD = 10 ** 9 + 7

h, w, k = map(int, sys.stdin.readline().split())

def main():
    ok = []
    for i in range(2 ** (w - 1)):
        prev = False
        for j in range(w-1):
            if i >> j & 1:
                if prev:
                    break
                else:
                    prev = True
            else:
                prev = False
        else:
            ok.append(i)
        
    res = [0] * w
    res[0] = 1
    for _ in range(h):
        nex = [0] * w
        for i in ok:
            j = 0
            while j < w:
                if i >> j & 1:
                    nex[j] += res[j+1]
                    nex[j+1] += res[j] 
                    j += 2
                else:
                    nex[j] += res[j]
                    j += 1
        for j in range(w):
            nex[j] %= MOD
        res = nex
    
    return res[k-1]
    
if __name__ == '__main__':
    ans = main()
    print(ans)
def main():
    s = str(input())
    b_count = s.count('B')
    w_count = len(s) - b_count

    if b_count == len(s) or w_count == len(s):
        count = 0
    else:
        count = 0
        index = 0
        alp = s[index]

        while True:
            if b_count == 0 or w_count == 0:
                break
            else:
                if s[index] == 'B':
                    b_count -= 1
                else:
                    w_count -= 1

                if s[index] == alp:
                    index += 1
                    continue
                else:
                    count += 1
                    alp = s[index]
                    index += 1

        if not (b_count == 0 and w_count == 0):
            count += 1

    print(count)


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    s = str(input())
    b_count = s.count('B')
    w_count = len(s) - b_count

    if b_count == len(s) or w_count == len(s):
        count = 0
    else:
        count = 0
        index = 0
        alp = s[index]

        while True:
            if b_count == 0 or w_count == 0:
                break
            else:
                if s[index] == 'B':
                    b_count -= 1
                else:
                    w_count -= 1

                if s[index] == alp:
                    index += 1
                else:
                    count += 1
                    alp = s[index]
                    index += 1

        if not (b_count == 0 and w_count == 0):
            count += 1

    print(count)


if __name__ == '__main__':
    main()
n,m=map(int,input().split())
A=list(input().split())
c=[0,2,5,5,4,5,6,3,7,6]

dp=['']*(n+1)
dp[0]=''
for i in range(1,n+1):
    max=''
    for j in range(m):
        if (i-c[int(A[j])]!=0 and dp[i-c[int(A[j])]]!='') or (i-c[int(A[j])]==0):
            if len(dp[i-c[int(A[j])]]+A[j])>len(max):
                max=dp[i-c[int(A[j])]]+A[j]
            elif len(dp[i-c[int(A[j])]]+A[j])==len(max) and dp[i-c[int(A[j])]]+A[j]>max:
                max=dp[i-c[int(A[j])]]+A[j]
    dp[i]=max
    #print(dp)
print(dp[n])


### FIXED CODE ###

n,m=map(int,input().split())
A=list(input().split())
c=[0,2,5,5,4,5,6,3,7,6]

dp=['']*(n+1)
dp[0]=''
for i in range(1,n+1):
    max=''
    for j in range(m):
        if (i-c[int(A[j])]>0 and dp[i-c[int(A[j])]]!='') or (i-c[int(A[j])]==0):
            if len(dp[i-c[int(A[j])]]+A[j])>len(max):
                max=dp[i-c[int(A[j])]]+A[j]
            elif len(dp[i-c[int(A[j])]]+A[j])==len(max) and dp[i-c[int(A[j])]]+A[j]>max:
                max=dp[i-c[int(A[j])]]+A[j]
    dp[i]=max
print(dp[n])
If input() == 'ABC':
  print('ARC')
else:
  print('ABC')

### FIXED CODE ###

if input() == 'ABC':
  print('ARC')
else:
  print('ABC')
ini=map(int,raw_input().split())
a=map(int,raw_input().split())

sum=0

for i in range(ini[0]):
  if a{i]==0:
    pass
  else:
    if a[i]-a[i-1]>=ini[1]:
      sum+=ini[1]
    else:
      sum+= a[i]-a[i-1]

sum+=ini[1]

print sum

### FIXED CODE ###

ini=map(int,raw_input().split())
a=map(int,raw_input().split())

sum=0

for i in range(ini[0]):
  if a[i]==0:
    pass
  else:
    if a[i]-a[i-1]>=ini[1]:
      sum+=ini[1]
    else:
      sum+= a[i]-a[i-1]

sum+=ini[1]

print sum
A, B, Q = [int(s) for s in input().split()]

# 配列の中身は(x座標, 次のポイントへの距離)
shrines = []
temples = []

for _ in range(A):
    s = int(input())
    shrines.append((s, 10**10))

# jinjas のインデックス
# temples の各点との距離を求めるのに使う
ji = 0
for _ in range(B):
    tp, tc = int(input()), 10**10
    sp, sc = shrines[ji]

    while abs(tp - sp) < tc:
        tc = abs(tp - sp)

        if abs(tp - sp) < sc:
            shrines[ji] = (sp, abs(tp - sp))

        if ji + 1 < A:
            ji += 1
            sp, sc = shrines[ji]
        else:
            break

    temples.append((tp, tc))

road = sorted(temples + shrines, key=lambda x: x[0])


def search(x):
    global A, B

    l, r = 0, A + B
    while r - l > 1:
        m = (l + r) // 2
        mp, mc = road[m]

        if mp < x:
            l = m
        else:
            r = m

    p1, c1 = road[l]
    if l == A + B - 1 or A + B == 1:
        return abs(x - p1) + c1

    p2, c2 = road[l+1]
    return min(abs(x-p1) + c1, abs(x-p2) + c2)


for _ in range(Q):
    q = int(input())

    y = search(q)
    print(y)


### FIXED CODE ###

y, m, d = [int(s) for s in input().split('/')]

if y > 2019:
  print('TBD')
elif y < 2019:
  print('Heisei')
else: # y == 2019
  if m < 5:
    print('Heisei')
  else:
    print('TBD')
import sympy

n = int(input())

ans = 0

for i in range(1, n+1):
    c = sympy.divisor_count(i)
    ans += i * c

print(ans)


### FIXED CODE ###

n = int(input())

def s(n):
    return n * (n + 1) // 2

ans = 0

for i in range(1, n+1):
    tmp = n // i
    ans += i * s(tmp)

print(ans)
C=[input().split(),input().split()]
res='YES'
for i in range(3):
  if C[0][i]!=C[1][2-i]: res='NO'
print(res)

### FIXED CODE ###

C=[input(),input()]
res='YES'
for i in range(3):
  if C[0][i]!=C[1][2-i]: res='NO'
print(res)
A,B=map(int,input().split())
count=0
if i>=A and i<=B:
    array_i=list(map(int,str(i)))
    if array_i==reverse(array_i):
        count+=1
print(count)

### FIXED CODE ###

A,B=map(int,input().split())
count=0
for i in range(A,B+1):
        if str(i)==str(i)[::-1]:
            count+=1
print(count)
import sys
stdin=sys.stdin

ip=lambda: int(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()

a,b=ip()

print(max(0,a-2*b))

### FIXED CODE ###

import sys
stdin=sys.stdin

ip=lambda: int(sp())

lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()

a,b=lp()

print(max(0,a-2*b))
n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
print(l[0]+l[1]+l[2])

### FIXED CODE ###

n, k = map(int, input().split())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = 0
for i in range(k):
  ans +=l[i]
print(ans)
n,k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))

for i in range(n):
    p[i] -= 1

v = [False] * n
roop = []

for i in range(n):
    if not v[i]:
        tmp = [i]
        while True:
            t = p[tmp[-1]]
            v[t] = True
            if tmp[0] == t:
                break
            else:
                tmp.append(t)
        roop.append(tmp)

s = []

for li in roop:
    s1 = 0
    for i in li:
        s1 += c[i]
    s.append(s1)

s2 = []

for li in roop:
    tmp = [0]
    for i in li:
        tmp.append(tmp[-1] + c[i])
    for i in li:
        tmp.append(tmp[-1] + c[i])
    s2.append(tmp)

v2 = [-1] * n

for i,li in enumerate(roop):
    for j in li:
        v2[j] = i

ans = -10**18

for i,li in enumerate(roop):
    t = -10**20
    if s[i] <= 0:
        for j in range(len(li)):
            for k1 in range(j+1, j + 1 + min(k, len(li))):
                t = max(t, s2[i][k1] - s2[i][j])
        ans = max(ans, t)
    else:
        cnt = k // len(li)
        if cnt == 0:
            for j in range(len(li)):
                for k1 in range(j+1, j + 1 + min(k, len(li))):
                    t = max(t, s2[i][k1] - s2[i][j])
                    print(j,k1,s2[i][k1] - s2[i][j])
            ans = min(ans, t)
        else:
            for j in range(len(li)):
                for k1 in range(j+1, j + 1 + len(li)):
                    t = max(t, s2[i][k1] - s2[i][j] + s[i] * (k - (k1 - j)) // len(li))
            ans = max(ans, t)

print(ans)


### FIXED CODE ###

n,k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))

for i in range(n):
    p[i] -= 1

v = [False] * n
roop = []

for i in range(n):
    if not v[i]:
        tmp = [i]
        while True:
            t = p[tmp[-1]]
            v[t] = True
            if tmp[0] == t:
                break
            else:
                tmp.append(t)
        roop.append(tmp)

s = []

for li in roop:
    s1 = 0
    for i in li:
        s1 += c[i]
    s.append(s1)

s2 = []

for li in roop:
    tmp = [0]
    for i in li:
        tmp.append(tmp[-1] + c[i])
    for i in li:
        tmp.append(tmp[-1] + c[i])
    s2.append(tmp)

v2 = [-1] * n

for i,li in enumerate(roop):
    for j in li:
        v2[j] = i

ans = -10**20

for i,li in enumerate(roop):
    t = -10**20
    if s[i] <= 0:
        for j in range(len(li)):
            for k1 in range(j+1, j + 1 + min(k, len(li))):
                t = max(t, s2[i][k1] - s2[i][j])
        ans = max(ans, t)
    else:
        for cnt in range(min(len(li), k)+1):
            for j in range(len(li)):
                if k >= cnt:
                    t = max(t, s2[i][cnt+j] - s2[i][j] + s[i] * ((k - cnt) // len(li)))
        ans = max(ans, t)

print(ans)
n = int(input())
h = list(map(int, input().split()))
h.append(inf)
ans = []
x = 0
for i in range(n):
  ans.append(0)
  while h[i] - h[i + 1] >= 0:
    ans[x] += 1
    i += 1
  x += 1
print(max(ans))


### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
i = 0
count = 0
ans = []
while i < n - 1:
  if h[i] < h[i + 1]:
    ans.append(count)
    count = 0
  else:
    count += 1
  i += 1
ans.append(count)
print(max(ans))
n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)

for i in a:
    if i = b[-1]:
        print(b[-2])
    else:
        print(b[-1])


### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]

b = sorted(a)

for i in a:
    if i == b[-1]:
        print(b[-2])
    else:
        print(b[-1])
a,b,c = map(int,input().split())
print(max(a-b,c)

### FIXED CODE ###

a,b,c = map(int,input().split())
print(c-min(a-b,c))
import math

x1, y1, x2, y2 = map(int, input().split())

### FIXED CODE ###

import math

x1, y1, x2, y2 = map(float, input().split())
distance = math.sqrt((x2-x1)**2 + (y2-y1)**2)
print(distance)
N, X, M = map(int, input().split())

rec = []
s = set()
rec.append(X)
s.add(X)
r = X
idx == -1
idx1 = -1
for i in range(N+1):
    r = (r**2)%M
    if(r not in s):
        rec.append(r)
        s.add(r)
    else:
        rec.append(r)
        idx = i+1
        break
    
for i in range(len(rec)):
    if(rec[i] == rec[idx]):
        idx1 = i
        break

if(idx == -1 and idx1 == -1):
    print(sum(rec))
elif(idx1 != idx):       
    ans = sum(rec[:idx1])
    ans += sum(rec[idx1:idx])*((N-idx1)//(idx-idx1))+sum(rec[idx1:(idx1+(N-idx1)%(idx-idx1))])
    print(ans)
else:
    ans = sum(rec[:idx1])
    ans += rec[idx]*(N-idx1)
    print(ans)

### FIXED CODE ###

N, X, M = map(int, input().split())

rec = []
s = set()
rec.append(X)
s.add(X)
r = X
idx = -1
idx1 = -1
for i in range(N+1):
    r = (r**2)%M
    if(r not in s):
        rec.append(r)
        s.add(r)
    else:
        rec.append(r)
        idx = i+1
        break
    
for i in range(len(rec)):
    if(rec[i] == rec[idx]):
        idx1 = i
        break

if(idx == -1 or idx1 == -1):
    print(sum(rec[:N]))
elif(idx1 != idx):       
    ans = sum(rec[:idx1])
    ans += sum(rec[idx1:idx])*((N-idx1)//(idx-idx1))+sum(rec[idx1:(idx1+(N-idx1)%(idx-idx1))])
    print(ans)
else:
    ans = sum(rec[:idx1])
    ans += rec[idx]*(N-idx1)
    print(ans)
def P_Number(a , b):

    ans = 0

    for i in range(a, b + 1):
        rev = str(i[::-1])
        if i == int(rev):
            ans += 1

    return ans

def main():
    a , b = map(int , input().split())
    print(P_Number(a , b))


if __name__ == '__main__':
    main()

### FIXED CODE ###

def P_Number(a , b):

    ans = 0

    for i in range(a, b + 1):
        rev = str(i)
        if str(i) == rev[::-1]:
            ans += 1

    return ans

def main():
    a , b = map(int , input().split())
    print(P_Number(a , b))


if __name__ == '__main__':
    main()
import math
a, b = map(int, input().split())
mean = (a + b) / 2
print(int(math.ceil(mean))

### FIXED CODE ###

import math
a, b = map(int, input().split())
mean = (a + b) / 2.0
print(math.ceil(mean))
s=input()
t=''
while s!='':
  if s[:5]=='dream':
    if s[5:10]=='erase':
      s=s[5:]
      continue
    elif s[5:7]='er':
      s=s[7:]
      continue
  elif s[:5]=='erase':
    if s[5]=='r':
      s=s[6:]
    else:
      s=s[5:]
      
  else:
    break
    
if s=='':
  print('YES')
  
else:
  print('NO')

### FIXED CODE ###

s=input()
t=''
while s!='':
  if len(s)<=4:
    break
  elif s[:5]=='dream':
    if len(s)>=10 and s[5:10]=='erase':
      s=s[5:]
      continue
    elif len(s)>=7 and s[5:7]=='er':
      s=s[7:]
      continue
    else:
      s=s[5:]
      continue
  elif s[:5]=='erase':
    if len(s)>=6 and s[5]=='r':
      s=s[6:]
      continue
    else:
      s=s[5:]
      continue
  
  elif s[:5]!='dream' and s[:5]!='erase':
    break
      
    
if s=='':
  print('YES')
  
else:
  print('NO')
N = int(input())
A = list(map(int,input(). split ()))
if 0 in A:
print(0)
return
prod = 1
for a in A:
prod *= a
if prod > 1000000000000000000:
print(-1)
return
print(prod)


### FIXED CODE ###

n=int(input())
a=list(map(int, input().split( )))
if 0 in a:
  print(0)
  
else:
    c=1
    for i in a:
        c= c*i
        if c> 10**18:
            c=-1
            break
    print(c)
h,w = map(int,input().split())
s = [input() for _ in range(w)]
l = []
for i in range(1,h-1):
    for j in range(1,w-1):
        if s[i][j] == "#":
            if s[i+1][j] == "#" or s[i-1][j] == "#" or s[i][j+1] == "#" or s[i][j-1] == "#":
                l.append(0)
            else:
                l.append(1)

if sum(l) == 0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

H,W = map(int,input().split())
S = ["."*(W+2)]+["."+input()+"." for h in range(H)]+["."*(W+2)]

for h in range(1,H+1):
  for w in range(1,W+1):
    if S[h][w]=="#" and S[h-1][w]=="." and S[h+1][w]=="." and S[h][w-1]=="." and S[h][w+1]==".":
      print("No")
      exit()
      
print("Yes")
a,b=int(input().split())
if a<b:
    print("a<b")
elif a=b:
    print("a=b")
else:
    print("a>b")

### FIXED CODE ###

a,b=map(int,input().split())
if a > b:
  print("a > b")
elif a < b:
  print("a < b")
else:
  print("a == b")