Harryxun/stf_run huggingface dataset:
n = int(input())
A = [int(i) for i in input().split()]

s = [0]*60
for a in A:
    cnt = 0
    while a != 0:
        # print(cnt,a)
        if(a&1)==1:
            s[cnt+1] += 1
        cnt+=1
        a = a >> 1
ans = 0
for i in range(60):
    # print("a",2**(i-1)*s.get(i,0)*(n-s.get(i,0)))
    # print("b",s.get(i,0))
    # print("c",(n-s.get(i,0)))
    ans += (2**(i-1)*s[i]*(n-s[i])) % (10**9+7)
ans = ans % (10**9+7)
print(int(ans))
# print(s)


### FIXED CODE ###

n = int(input())
A = [int(i) for i in input().split()]

s = [0]*61
for a in range(n):
    for i in range(61):
        if(A[a]>>i&1)==1:
            s[i+1] += 1
ans = 0
for i in range(60):
    # print("a",2**(i-1)*s.get(i,0)*(n-s.get(i,0)))
    # print("b",s.get(i,0))
    # print("c",(n-s.get(i,0)))
    ans += 2**(i)*s[i+1]*(n-s[i+1])
ans = ans % (10**9+7)
print(int(ans))
# print(s)
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(10 ** 9)


def main():
    N = int(input())
    if N < 105:
        print(0)
        return

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

    cnt = 1
    for n in range(106, N + 1):
        d = make_divisors(n)
        if len(d) == 8:
            cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()


### FIXED CODE ###


N=int(input())
if N<105:
  print(0)
elif 105<=N<135:
  print(1)
elif 135<=N<165:
  print(2)
elif 165<=N<189:
  print(3)
elif 189<=N<195:
  print(4)
else:
  print(5)
a = int(input())
for i in range(3):
  if a[i] ==1:
  	a[i] ==9
  else:
    a[i] ==1
print(a)

### FIXED CODE ###

a = input()
b = []
for i in range(3):
  if a[i] =='1':
  	b.append('9')
  else:
    b.append('1')
print(''.join(b))
import bisect

def primetable(n):
  list = [True for _ in range(n + 1)]
  i = 2
  while i * i <= n:
    if list[i]:
      j = i + i
      while j <= n:
        list[j] = False
        j += i
    i += 1
  table = [i for i in range(n + 1) if list[i] and i >= 1]
  return table

prime = primetable(10 ** 5)
accume = [0] * (len(prime))
con = 0

for i,p in enumerate(prime):
  if p <= 2:
    continue
  q = (p + 1) // 2
  if q in prime:
    con += 1
  accume[i] = con

Q = int(input())

for i in range(Q):
  l,r = map(int,input().split())
  if l == 1:
    l += 1
  R = bisect.bisect_left(prime,r)
  L = bisect.bisect_left(prime,l)
  print(accume[R] - accume[L - 1])


### FIXED CODE ###

import sys
input = sys.stdin.readline

def isprime(x):
  if x <= 1:
    return False
  for i in range(2, int(x**0.5) + 1):
    if x % i == 0:
      return False
  return True


A = [0] * 10 ** 5
B = [0] * 10 ** 5
con = 0

for i in range(10 ** 5):
  if isprime(i):
    A[i] = 1
  if A[i] and A[(i + 1) // 2]:
    con += 1
  B[i] = con

Q = int(input())

for _ in range(Q):
  l, r = map(int, input().split())
  print(B[r] - B[l - 1])
import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

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

lo = 0
hi = max(A) + 1

def ceildiv(a, b):
	return (a + b - 1) // b

while lo < hi:
	tar = (lo + hi) // 2

	cuts = 0
	for v in A:
		x = ceildiv(v, tar)
		cuts += x - 1
		if cuts > K:
			lo = tar + 1
			break
	else:
		hi = tar

print(lo)


### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip('\r\n')

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

lo = 1
hi = max(A) + 1

def ceildiv(a, b):
	return (a + b - 1) // b

while lo < hi:
	tar = (lo + hi) // 2

	cuts = 0
	for v in A:
		x = ceildiv(v, tar)
		cuts += x - 1
		if cuts > K:
			lo = tar + 1
			break
	else:
		hi = tar

print(lo)
N = int(input())
a_lst = list(map(int, input().split()))

M = 0
ans_lst = [0] * N

t = 0
for i in range(N-1, -1, -1):
    t = sum(ans[i::i+1])
        
    if t % 2 != a_lst[i]:
        ans_lst[i] = 1
    


m = 0
for i in range(N):
    m += ans_lst[i]
    


print(m)
ans_str = ""
for i in range(N):
    if ans_lst[i] == 1:
        ans_str += str(i+1) + " "
print(ans_str)




### FIXED CODE ###


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

M = 0
ans_lst = [0] * N

for i in range(N-1, -1, -1):
    if sum(ans_lst[i::i+1]) % 2 != a_lst[i]:
        ans_lst[i] = 1
    

m = sum(ans_lst)    


print(m)
ans_str = ""
for i in range(N):
    if ans_lst[i] == 1:
        ans_str += str(i+1) + " "
print(ans_str)
import sys

A = [[0] * 3 for i in range(3)]

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))

N = int(input())
for _ in range(N):
    b = int(input())
    if b in A1:
        for a in [i for i, x in enumerate(A1) if x == b]:
            A[0][a] = 1
    if b in A2:
        for a in [i for i, x in enumerate(A2) if x == b]:
            A[1][a] = 1
    if b in A3:
        for a in [i for i, x in enumerate(A3) if x == b]:
            A[2][a] = 1

for i in range(3):
    if sum(A[i][:]) == 3:
        print('Yes')
        sys.exit()

if A[0][0] == 1 and A[1][0] == 1 and A[2][0] == 1:
    print('Yes')
    sys.exit()
if A[0][1] == 1 and A[1][1] == 1 and A[2][1] == 1:
    print('Yes')
    sys.exit()
if A[0][2] == 1 and A[1][2] == 1 and A[2][2] == 1:
    print('Yes')
    sys.exit()

if A[0][0] == 1 and A[1][1] == 1 and A[2][2] == 1:
    print('Yes')
    sys.exit()

if A[0][2] == 1 and A[1][1] == 1 and A[3][0] == 1:
    print('Yes')
    sys.exit()

print('No')

### FIXED CODE ###

import sys

A = [[0] * 3 for i in range(3)]

A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))

N = int(input())
for _ in range(N):
    b = int(input())
    if b in A1:
        for a in [i for i, x in enumerate(A1) if x == b]:
            A[0][a] = 1
    if b in A2:
        for a in [i for i, x in enumerate(A2) if x == b]:
            A[1][a] = 1
    if b in A3:
        for a in [i for i, x in enumerate(A3) if x == b]:
            A[2][a] = 1

for i in range(3):
    if sum(A[i][:]) == 3:
        print('Yes')
        sys.exit()

if A[0][0] == 1 and A[1][0] == 1 and A[2][0] == 1:
    print('Yes')
    sys.exit()
if A[0][1] == 1 and A[1][1] == 1 and A[2][1] == 1:
    print('Yes')
    sys.exit()
if A[0][2] == 1 and A[1][2] == 1 and A[2][2] == 1:
    print('Yes')
    sys.exit()

if A[0][0] == 1 and A[1][1] == 1 and A[2][2] == 1:
    print('Yes')
    sys.exit()

if A[0][2] == 1 and A[1][1] == 1 and A[2][0] == 1:
    print('Yes')
    sys.exit()

print('No')
N = input()

if N % 2 == 0:
    print(N / 2)
else:
    print(N // 2 + 1)

### FIXED CODE ###

N = int(input())

if N % 2 == 0:
    print(int(N / 2))
else:
    print(int(N // 2 + 1))
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
if sum(sorted([int(x) for x in input().split()]) > 2*sorted([int(x) for x in input().split()][-1]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
Llist = [int(x) for x in input().split()]
Llist.sort()
Llist.reverse()
if sum(Llist) > 2*Llist[0]:
    print("Yes")
else:
    print("No")
a,b=int(input().split())
if a>10:
    print('b')
else
    print(b-(100＊(10-b))
          
 


### FIXED CODE ###

a,b=map(int,input().split())
if a>9:
  print(b)
else:
  print(b+(100*(10-a)))
N = input()
K = int(input())
def Anger(n, k):
  d = int(n[0])
  if k == 1:
    S = d + 9 * (len(n) - 1)
    return S
  else:
    S = (d - 1) * (9 ** (k-1))
    for j in range(k-1):
      S *= len(n) - j - 1
      S //= j + 1
    T = 9 ** k
    for j in range(k):
      T *= len(n) - j - 1
      T //= j + 1
    return S + T + Anger(n[1:], k - 1)
    
print(Anger(N, K))

### FIXED CODE ###

N = input()
K = int(input())
def Anger(n, k):
  d = int(n[0])
  if len(n) < k:
    return 0
  else:
    if k == 1:
      if d == 0 and len(n) != 1:
        return Anger(n[1:], k)
      elif d == 0 and len(n) == 1:
        return 0
      else:
        if len(n) != 1:
          S = d + 9 * (len(n) - 1)
          return S
        else:
          return d
    else:
      if d == 0:
        return Anger(n[1:], k)
      else:
        S = (d - 1) * (9 ** (k-1))
        for j in range(k-1):
          S *= len(n) - j - 1
          S //= j + 1
        T = 9 ** k
        for j in range(k):
          T *= len(n) - j - 1
          T //= j + 1
        return S + T + Anger(n[1:], k - 1)
    
print(Anger(N, K))
n=int(input())
def gcd(a,b):
  if b==0:
    return a
  return gcd(b,a%b)
ans=0
for i in range(1,K+1):
  for j in range(1,K+1):
    for k in range(1,K+1):
      ans+=gcd(i,gcd(j,k))
print(ans)



### FIXED CODE ###

K=int(input())
def gcd(a,b):
    res=0
    while b!=0:
        res=a%b
        a=b
        b=res
    return a

ans=0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            t=gcd(i,gcd(j,k))
            ans+=t
print(ans)
import math
N = int(input())
A = N/1.08 
B = (N+1)/1.08 

if math.ceil(A) < math.ceil(B):
  print(ceil(A))
else:
  print(':(')


### FIXED CODE ###

import math
N = int(input())
A = N/1.08 
B = (N+1)/1.08 

if math.ceil(N/1.08) < math.ceil((N+1)/1.08 ):
  print(math.ceil(N/1.08))
else:
  print(':(')
import numpy as np
from numpy.random import *

def quicksort(array):
    if len(array) < 2:
        return array # ?????¬??±??????
    else:
        pivot = array[0] # ?????°??±??????
        # ???????????????????°???????????????????????????¨?????????
        less = [i for i in array[1:] if i <= pivot]

        # ????????????????????§??????????????????????????¨?????????
        greater = [i for i in array[1:] if i > pivot]

        return quicksort(less) + [pivot] + quicksort(greater)


array = randint(0, 1000, 10) 
sorted_array = quicksort(array)
print(sorted_array[2])
print(sorted_array[1])
print(sorted_array[0])

### FIXED CODE ###

array = []
for _ in range(10):
    array.append(int(input()))

sorted_array = sorted(array,reverse=True)
for i in range(3):
    print(sorted_array[i])
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L - N) )

### FIXED CODE ###

L = list(map(int,input().split()))
ans = 0
min_L = min(L)
L.remove(min_L)
cnt = min_L
sorted_L = sorted(L)
for i in sorted_L:
    ans += abs(i - cnt )
    cnt = i
print(ans)
h, a = map(int, input(),split())
count = 0

while h > 0:
  count += 1
  h = h - a
 
print(count)

### FIXED CODE ###

h, a = map(int, input().split())
count = 0

while h > 0:
  count += 1
  h = h - a
 
print(count)
if X < A:
    print(0)

elif A <= X:
    print(10)

else:
    pass

### FIXED CODE ###

c = input()
l = c.split()

x = int(l[0])
a = int(l[1])

if x < a:
    print(0)

elif a <= x:
    print(10)
#!/usr/local/bin/python3
# coding: utf-8
n = input()
hairu = input()
kita = hairu.split(" ")
seki = 1

try:
    for c in kita:
        if seki > 10**18:
            print("-1")
            break
        else:
            seki = seki * int(c)
            if seki > 10**18:
                print("-1")
            else:
                print(seki)
except:
    print("-1")




### FIXED CODE ###

#!/usr/local/bin/python3
# coding: utf-8
hairu = input()
kita = hairu.split(" ")
a = int(kita[0])
b = int(kita[1])

print(a*b)
n,m = map(int,input().split())
a = list(range(m+2))
a[0] = 0
a[m+1] = n+1
ans = 1
for i in range(m):
  a[i+1] = int(input())
for i in range(m+1):
  if a[i]+1 == a[i+1] and i != 0 and i != m:
    ans = 0
    break
  else:
    x = a[i+1]-a[i]-2
    if x == 0 or x == 1:
      ans = ans%1000000007
    elif x == 2:
      ans = ans*2%1000000007
    else:
      ans = ans * int(1/(5**0.5) * (((1+(5**0.5))/2)**x - ((1-(5**0.5))/2)**x)) %1000000007

print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
b = [] 
for i in range(n+1):
  if i == 0 or i == 1:
    b.append(1)
  else:
    b.append(b[i-2]+b[i-1])

ans = 1
if m != 0:
  a = list(range(m))
  for i in range(m):
    a[i] = int(input())
    if i == 0:
      ans = ans*b[a[i]-1]%1000000007
    else:
      if a[i] == a[i-1]+1:
        ans = 0
      else:
        ans = ans*b[a[i]-a[i-1]-2]%1000000007
  ans = ans*b[n-a[m-1]-1]%1000000007
  print(ans)
else:
  print(b[n]%1000000007)
x = int(imput())
print(x**3)


### FIXED CODE ###

x = int(input())
print(x**3)
code="""
using System;
using System.Numerics;
class Test{
  static void Main(){
    BigInteger x=BigInteger.Parse(Console.ReadLine());
    Console.WriteLine(x*x*x);
  }
}
"""

import os,tempfile
(_,filename)=tempfile.mkstemp()

f=open(filename,"w")
f.write(code)
f.close()

os.system("dmcs {} -r:System.Numerics -out:a.exe".format(filename))
os.system("./a.exe")

### FIXED CODE ###

code="""
#include <iostream>
using namespace std;
int main()
{
  int x; cin>>x;
  cout<<x*x*x<<endl;
}
"""

import os,tempfile
(_,filename)=tempfile.mkstemp(".cpp")

f=open(filename,"w")
f.write(code)
f.close()

os.system("g++ -std=c++0x {} -o ./a.out".format(filename))
os.system("./a.out")
X,N = list(map(int,input().split()))
if N == 0:
    print(X)
else:
    P = list(map(int,input().split()))
    A = []
    B = []
    for i in range(101):
        if i not in P and i <= X:
            A.append(i)
        elif i not in P and i > X:
            B.append(i)
    A = sorted(A,reverse=True)
    B = sorted(B)
    a = X - A[0]
    b = B[0] - X
    if a <= b:
        print(A[0])
    else:
        print(B[0])

### FIXED CODE ###

X,N = list(map(int,input().split()))
if N == 0:
    print(X)
else:
    P = list(map(int,input().split()))
    for i in range(100):
        if not X - i in P:
            a = X - i
            break
        if not X + i in P:
            a = X + i
            break
    print(a)
def resolve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    for _ in range(min(k,100)):
        dp = [0] * (n + 1)
        for index, i in enumerate(a):
            dp[max(0, index - i)] += 1
            dp[min(n, index + i + 1)] -= 1
        a[0] = dp[0]
        for i in range(1, n):
            a[i] = a[i - 1] + dp[i]
    print(*a)


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

s=input();print(s[:3])
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
  array = np.zeros(s)
  array[2] = 1
  array[3] = 1
  for i in range(4, s):
    array[i] = (array[i-1] + array[i-3]) % mod
  print(array[s])

### FIXED CODE ###

s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(int(array[s]))
N = int(input())
v = list(map(int,input().split()))
v.sort()

for i in range(N-1):
    v[i+1] = (v[i]+v[i+1]) / 2

print(v[n-1])

### FIXED CODE ###

N = int(input())
v = list(map(int,input().split()))
v.sort()

for i in range(N-1):
    v[i+1] = (v[i]+v[i+1]) / 2

print(v[N-1])
a = list(map(int, input()))
print(sum(range(1, 5 + 1)) - sum(a))

### FIXED CODE ###

a = list(map(int, input().split()))
print(sum(range(1, 5 + 1)) - sum(a))
def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g








def gcd_core(a, b):
    if b == 0:
        return a
    else:
        return gcd_core(b, a % b)


def gcd(arr):
    g = gcd_core(arr[0], arr[1])
    for i in range(2, len(arr)):
        g = gcd_core(g, arr[i])
    return g

n = int(input())

a = list(map(int,input().split()))
b = a[1:-1]
m = max(b)
base = 0

for i in range(n):
    base += abs(a[i])

kouho1 = base
if a[0] > 0:
    kouho1 -=a[0]*2
kouho2 = base

if a[-1] > 0:
    kouho2 -= a[-1]*2

kouho3 = base
if m < 0:
    kouho3 += m*2


l = [kouho1,kouho2,kouho3]
print(max(l))




### FIXED CODE ###

import numpy as np
n = int(input())
arr = list(map(int,input().split()))

odd = 0

for a in arr:
    if a < 0:
        odd += 1

if odd %2 == 0:
    print(np.sum(np.abs(arr)))
else:
    # print(np.sum(np.abs(arr)))
    # print(np.min(np.abs(arr)))
    print(np.sum(np.abs(arr))-2*np.min(np.abs(arr)))
a = []
for _ in range(int(input())):
    a.append(input())
a.reverse()
print(" ".join(a))

### FIXED CODE ###

input()
print(" ".join(reversed(input().split())))
#include <bits/stdc++.h>
using namespace std;

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int long long
#define ppi pair<int, int>
#define endl "\n"
#define nl cout << "\n"
#define deb(x) cout << #x << " " << x << endl;

const int N = 1010;
const int mod = 1e9 + 7;
int H, W;
char grid[N][N];

// dp[i][j] = #Ways to reach from (i, j) to (H, W)
int dp[N][N];

int Top_Down(int x = 1, int y = 1) {
    // Base Case
    if(x == H && y == W) return (dp[x][y] = 1);
    // Choice
    if(dp[x][y] != -1) return dp[x][y];
    int ways = 0;
    if(x <= H && grid[x+1][y] == '.') ways += Top_Down(x+1, y)%(mod);
    if(y <= W && grid[x][y+1] == '.') ways += Top_Down(x, y+1)%(mod);
    return (dp[x][y]=ways%(mod));
}

int32_t main() {
    IOS;
    memset(dp, -1, sizeof(dp));
    cin >> H >> W;
    for(int i = 1; i <= H; ++i) 
        for(int j = 1; j <= W; ++j) {
            cin >> grid[i][j];
        }
    //
    for(int i = 1; i <= H; ++i){
        for(int j = 1; j <= W; ++j)
            if((i == H and j == W) and grid[i][j]=='.') dp[i][j] = 1;
    }
    cout << Top_Down()%(mod) << endl;
    // for(int i = 1; i <= H; ++i){
    //     for(int j = 1; j <= W; ++j) cout << dp[i][j] << " ";
    //     cout << endl;
    // }
}

### FIXED CODE ###

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

grid = []

for i in range(n):
  temp = list(input())
  grid.append(temp)
  
#dp[n][m]
mod = 10**9+7
dp = [[0 for i in range(m)] for j in range(n)]
dp[0][0] = 1

for i in range(n):
  for j in range(m):
    if grid[i][j]=='#':
      continue
    if i>0:
      dp[i][j] += dp[i-1][j]%mod
    if j>0:
      dp[i][j] +=dp[i][j-1]%mod
      
print(dp[n-1][m-1]%mod)
N = int(input())
T, A = map(int, input().split())
diff =50000000
num = 0
for i in range(N):
    H = int(input())
    if abs(T - H*0.006 - A) < diff:
        num = i + 1

### FIXED CODE ###

n = int(input())
t, a = map(int, input().split())
e = [int(i) for i in input().split()]

temp = []
for i in e:
    temp.append(abs(t - i * 0.006 - a))
    
print(temp.index(min(temp)) + 1)
from functools import reduce
from fractions import gcd
import math

A, B, C, D = map(int, input().split())
X = C//math.gcd(C, D)*(D//math.gcd(C, D))*math.gcd(C, D)

print(B-A-(B//C-(-(-A//C))+B//D-(-(-A//D))-(B//X-(-(-A//X)))))

### FIXED CODE ###

from functools import reduce
from fractions import gcd

A, B, C, D = map(int, input().split())
X = C//gcd(C, D)*(D//gcd(C, D))*gcd(C, D)

print(B-A-(B//C-(-(-A//C))+B//D-(-(-A//D))-(B//X-(-(-A//X)))))
import sys
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
hantei = [[0 for _ in range(h)] for _ in range(w)]
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            if i < h-1:
                if s[i+1][j] == "#":
                    hantei[i][j] = 1
                    hantei[i+1][j] = 1
            if j < w-1:
                if s[i][j+1] == "#":
                    hantei[i][j] = 1
                    hantei[i][j+1] = 1

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            if hantei[i][j] == 0:
                print("No")
                sys.exit()

print("Yes")

### FIXED CODE ###

import sys
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]
hantei = [[0 for _ in range(w)] for _ in range(h)]
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            if i < h-1:
                if s[i+1][j] == "#":
                    hantei[i][j] = 1
                    hantei[i+1][j] = 1
            if j < w-1:
                if s[i][j+1] == "#":
                    hantei[i][j] = 1
                    hantei[i][j+1] = 1

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            if hantei[i][j] == 0:
                print("No")
                sys.exit()

print("Yes")
s=input()
ind =0
len_s=len(s)
s = s+ "zzzzzzzzzz"

A = "dreamer"
B= "dream"
C= "erase"
D="eraser"

flag =True
while(1):
    if(s[ind] =="d"):
        if(s[ind + 5] =="d"):
            if(s[ind:ind+5]!=B):
                flag = False
                break
            else:
                ind+=5
        else:
            if(s[ind+5]!='e'):
                flag=False
                break
            if(s[ind+7] == "a"):
                if(s[ind:ind+5]!=B):
                    flag = False
                    break
                else:
                    ind+=5

            else(s[ind:ind+7] !=A):
                flag = false
                break
            else:
                ind+=7
    elif(s[ind]=="e"):
        if(s[ind+5]=="r"):
            if(s[ind:ind+6]!=D):
                flag = False
                break
            else:
                ind+=6

        else:
            if(s[ind:ind +5] !=C):
                flag =False
                break
            else:
                ind+=5
    else:
        flag=False
        break
    if(ind == len_s):
        break
    if(ind > len(s)):
        flag=False
        break
if(flag):
    print("YES")
else:
    print("NO")



### FIXED CODE ###

s=input()
ind =0
len_s=len(s)
s = s+ "AAAAAAAAA"

A = "dreamer"
B= "dream"
C= "erase"
D="eraser"

flag =True
while(1):
    if(s[ind] =="d"):
        if(s[ind + 5] =="d"):
            if(s[ind:ind+5]!=B):
                flag = False
                break
            else:
                ind+=5
        else:
            if(s[ind+5]!='e' and s[ind+5]!='A'):
                flag=False
                break
            if(s[ind+7] == "a" or ind + 7 >len_s):
                if(s[ind:ind+5]!=B):
                    flag = False
                    break
                else:
                    ind+=5

            else:
                if(s[ind:ind+7] !=A):
                    flag = False
                    break
                else:
                    ind+=7
    elif(s[ind]=="e"):
        if(s[ind+5]=="r"):
            if(s[ind:ind+6]!=D):
                flag = False
                break
            else:
                ind+=6

        else:
            if(s[ind:ind +5] !=C):
                flag =False
                break
            else:
                ind+=5
    else:
        flag=False
        break
    if(ind == len_s):
        break
    if(ind > len_s):
        flag=False
        break
if(flag):
    print("YES")
else:
    print("NO")
a,b,k = map(int, input().split())
li = list(range(a,b+1))
li_low = li[:k]
li_high = li[-k:]
li_ans = sorted(list(set(li_low + li_high)))
for i in range(len(li_ans)):
    print(li_ans[i])

### FIXED CODE ###

a,b,k = map(int,input().split())
if (b-a+1) <= 2*k:
    for k in range(a,b+1):
        print(k)
else:
    for i in range(a,a+k):
        print(i)
    for j in range(b-k+1,b+1):
        print(j)
from numpy import*
f=lambda:map(int,input().split())
N,W=f()
T=zeros(W+1,int)
exec('w,v=f();T[w:]=maximum(T[w:],T[:-w]+v);'*N)
print(T[-1])

### FIXED CODE ###

import numpy as np
N,W=map(int,input().split())
dp=np.full(10**5+1,W+1)
dp[0]=0
for i in range(N):
    w,v=map(int,input().split())
    dp[v:]=np.minimum(dp[:-v]+w,dp[v:])
print(np.max(np.where(dp<=W)))