Harryxun/stf_run huggingface dataset:
a=input()
b=a.index
while "B" in a:
  if a.startswith("B"):
    a=a[1::]
  elif "B" in a:
    a=a[0:b("B")-1]+a[b("B")+1:]
print(a)

### FIXED CODE ###

a=input()
s=""
for i in a:
  if i=="B":
    s=s[:-1]
  else:
    s+=i
print(s)
a = int(input())
s = input()
if a < 3200, a >=2800:
  print(s)
else:
  print('red')

### FIXED CODE ###

a = int(input())
s = input()
if a >= 3200 and a < 5000:
  print(s)
elif a >= 2800 and a < 3200:
  print('red')
k = int(input())
a, b = map(int, input().split())

if k >= 2 and b - a >= k - 1:
  print("OK")
elif k == a or k == b:
  print("OK")
elif a < k  and k < b:
  print("OK")
print k == 1:
  print("OK")
else:
  print("NO")


### FIXED CODE ###

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

if b - a >= k - 1:
  print("OK")
elif  k == 1:
  print("OK")
elif b == k or a == k:
  print("OK")
elif b % k == 0 or a % k == 0:
  print("OK")
elif a < k and k < b:
  print("OK")
elif a != b and k == 2:
  print("OK")
elif b < k:
  print("NG")
elif a % k > b % k:
  print("OK")
else:
  print("NG")
a = [int(i) for i in input().split()]
print(len(set(a))

### FIXED CODE ###

a = [int(i) for i in input().split()]
print(len(set(a)))
import math

def isprime(number):
    for i in range(2, round(math.sqrt(number)) + 1):
        if number % i == 0:
            return False
    return True

A, B = map(int, input().split())
count = 1
N = math.gcd(A, B)

for i in range(2, N + 1):
    if N % i == 0:
        if isprime(i):
            count += 1
print(str(count))


### FIXED CODE ###

from fractions import gcd
def f(n):
    tmp = n
    cnt = 0
    i = 2
    while i <= n**0.5 + 1:
        if tmp < i:
            break
        if tmp % i == 0:
            cnt += 1
            while tmp % i == 0:
                tmp //= i
        i += 1
    if tmp != 1:
        cnt += 1
    return cnt

A, B = map(int, input().split())
g = gcd(A, B)
ans = f(g) + 1
print(ans)
n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[xy[i][0] for i in range(n)]
y=[xy[i][1] for i in range(n)]

for i in range(n-k):
    x=[xy[i][0] for i in range(n-i)]
    y=[xy[i][1] for i in range(n-i)]
    xl = min(x)
    xr = max(x)
    yl = min(y)
    yr = max(y)

    xr2 = sorted(x)[-2]
    xl2 = sorted(x)[1]
    yr2 = sorted(y)[-2]
    yl2 = sorted(y)[1]

    res1 = (xl2-xl)*(yr-yl)
    res2 = (xr-xr2)*(yr-yl)
    res3 = (yl2-yl)*(xr-xl)
    res4 = (yr-yr2)*(xr-xl)
    if max(res1,res2,res3,res4) ==res1:
        xy.pop(x.index(xl))
    elif max(res1,res2,res3,res4) ==res2:
        xy.pop(x.index(xr))
    elif max(res1,res2,res3,res4) ==res3:
        xy.pop(x.index(yl))
    elif max(res1,res2,res3,res4) ==res4:
        xy.pop(x.index(yr))

x=[xy[i][0] for i in range(k)]
y=[xy[i][1] for i in range(k)]
xl = min(x)
xr = max(x)
yl = min(y)
yr = max(y)
print((xr-xl)*(yr-yl))

### FIXED CODE ###

n,k=map(int,input().split())
xy=[list(map(int,input().split())) for _ in range(n)]
x=[xy[i][0] for i in range(n)]
y=[xy[i][1] for i in range(n)]
res = 10**20
for i in range(n):
    xl = xy[i][0]
    for j in range(n):
        xr = xy[j][0]
        if xr<xl:continue
        for p in range(n):
            yl = xy[p][1]
            for q in range(n):
                yr = xy[q][1]
                if yr<yl:continue
                tres = 0
                for sxy in xy:
                    if sxy[0] >= xl and sxy[0] <= xr and sxy[1] >= yl and sxy[1] <= yr:
                        tres += 1
                if tres >= k:
                    res = min(res,(xr-xl)*(yr-yl))
print(res)
N = int(input().strip())

xyh = []
for _ in range(N):
  x, y, h = map(int, input().strip().split())
  if h != 0:
    xyh.append((x, y, h))

for k in range(N):
  for i in range(101):
    for j in range(101):
      H = xyh[k][2] + abs(i-xyh[k][0]) + abs(j-xyh[k][1])
      is_h = True
      for _xyh in xyh:
        if H != _xyh[2] + abs(i-_xyh[0]) + abs(j-_xyh[1]):
          is_h = False
          break
      if is_h:
        mx, my, mh = i, j, H

print(mx, my, mh)


### FIXED CODE ###

N = int(input().strip())
xyh = []
for _ in range(N):
  x, y, h = map(int, input().strip().split())
  xyh.append((x, y, h))

for i in range(101):
  for j in range(101):
    for k in range(N):
      if xyh[k][2] != 0:
        H = xyh[k][2] + abs(i-xyh[k][0]) + abs(j-xyh[k][1])
        break
    is_h = True
    for k in range(N):
      if max(0, H-abs(i-xyh[k][0])-abs(j-xyh[k][1])) != xyh[k][2]:
        is_h = False
        break
    if is_h:
      print(i, j, H)
import math

nk = list(map(int, list(input().split())))

n = nk[0]
k = nk[1]

countSplit = 1
countPut = n - k + 1

for i in range(k):
    if i == 0:
        print(n - k + 1)
    elif i <= n - k:
        """
        countSplit = math.factorial(k - 1) // math.factorial(k - 1 - i)
        countPut = math.factorial(n - k + 1) // math.factorial(n - k - i)
        """
        countSplit = int(countSplit * (k - i) / i)
        countPut = int(countPut * (n - k + 1 - i) / (i + 1))

        print((countPut * countSplit) % (10 ** 9 + 7))

    else:
        print(0)

### FIXED CODE ###

import math

nk = list(map(int, list(input().split())))

n = nk[0]
k = nk[1]

countSplit = 1
countPut = n - k + 1

for i in range(k):
    if i == 0:
        print(n - k + 1)
    elif i <= n - k:

        countSplit = math.factorial(k - 1) // math.factorial(k - 1 - i) // math.factorial(i)
        countPut = math.factorial(n - k + 1) // math.factorial(n - k - i) // math.factorial(i + 1)
        """
        countSplit = int(countSplit * (k - i) / i)
        countPut = int(countPut * (n - k + 1 - i) / (i + 1))
        """
        print((countPut * countSplit) % (10 ** 9 + 7))

    else:
        print(0)
from itertools import groupby
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
N, K = tuple(li())
S = stdin.readline()
# use window
l, r = 0, 0
cnt = 0
r_iter = groupby(S)
l_iter = groupby(S)
r_next = next(r_iter)
l_next = next(l_iter)
while r < N:
    # print(l, r)
    if K > 0:
        if r_next[0] == '1':
            r += len(list(r_next[1]))
            r_next = next(r_iter)
            cnt = max(cnt, r - l)
            K -= 1
        elif r_next[0] == "0":
            pass
        r += len(list(r_next[1]))
        r_next = next(r_iter)
    elif K == 0 and r_next[0] == "1":
        r += len(list(r_next[1]))
        r_next = next(r_iter)
    else:
        if l_next[0] == "0":
            K += 1
        l += len(list(l_next[1]))
        l_next = next(l_iter)
if K > 0:
    cnt = max(cnt, r-l)
print(cnt)


### FIXED CODE ###


from itertools import groupby
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**5) 
 
def ii(): return int(stdin.readline())
def li(): return map(int, stdin.readline().split())
N, K = tuple(li())
S = stdin.readline() + "2"
# use window
l, r = 0, 0
cnt = 0
r_iter = groupby(S)
l_iter = groupby(S)
r_next = next(r_iter)
l_next = next(l_iter)
while r < N:
    # print(l, r, K)
    if K > 0:
        if r_next[0] == '1' and r > 0:
            K -= 1
        r += len(list(r_next[1]))
        r_next = next(r_iter)
        cnt = max(cnt, r - l)
    elif K == 0 and r_next[0] == "1":
        cnt = max(cnt, r - l)
        r += len(list(r_next[1]))
        r_next = next(r_iter)
        cnt = max(cnt, r - l)
    else:
        if l_next[0] == "0":
            K += 1
        l += len(list(l_next[1]))
        l_next = next(l_iter)
# print(l,r,K)
if r_next[0] == '1':
    cnt = max(cnt, r-l)
print(cnt)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if (end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
  	ans *= num_way(end-start)
  	print(ans%1000000007)
  

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
from collections import deque

def num_way(stair):
  memo = ["EMPTY"]*(stair+1)
  def _fib(stair):
    if stair == 1 or stair == 0:
      return 1
    elif stair == 2:
      return 2
    elif memo[stair] != "EMPTY":
      return memo[stair]
    else:
      memo[stair] = _fib(stair-1)+_fib(stair-2)
      return memo[stair]
  return _fib(stair)

N, M = map(int,input().split())
a = deque([0])
path_poss = 1
ans = 1
for m in range(M):
  start = a.popleft()
  buff = int(input())
  end = buff-1
  if (end-start) <= -1:
    path_poss = 0
    break
  a.append(buff+1)
  ans *= num_way(end-start)
  ans %= 1000000007

if path_poss == 0:
  print(0)
else:
  start = a.popleft()
  end = N
  if(end-start) <= -1:
    path_poss = 0
  if path_poss == 0:
    print(0)
  else:
    ans *= num_way(end-start)
    print(ans%1000000007)
a,b,c = map(int,input().split())
acnt = 0
bcnt = 0
ccnt = 0
cnt = 0
if a == b and a== c and a%2 == 0:
    print(-1)
    exit()
while a%2 == 0 and b%2 == 0 and c%2 == 0:
    cnt += 1
    acnt = (b+c)//2
    bcnt = (a+c)//2
    ccnt = (a+b)//2
    a = acnt
    b = bcnt 
    c = ccnt
print(cnt)

### FIXED CODE ###

a = list(map(str,input().split()))
ans = []

for i in range(3):
    tmp = list(map(str,a[i]))
    b = tmp[0]
    b = chr(ord(b)-32)
    ans.append(b)

print("".join(ans))
n = int(input())

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

soredx = sorted(x)

migi = soredx[int(n/2-1)]
hidari = soredx[int(n/2)]

for i in range(n):
    if(migi<x[i]):
        print(migi)
    else:
        print(hidari)


### FIXED CODE ###

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

if a+b >= x and a <= x:
    print("YES")
else:
    print("NO")
s = list(input())

n = int(len(s)/2)
c = 0

if s[1] == s[0]:
  c +=1
  if s[0] == 0:
    s[1] = 1
  elif s[0] == 1:
    s[1] = 0

for i in range(n):
  if s[0] != s[2*i]:
    c += 1
  if s[1] != s[2*i+1]:
    c += 1

print(c)

### FIXED CODE ###

s = list(map(int,input()))

n = int(len(s)/2)

a = [0]*len(s)
b = [0]*len(s)

for i in range(n):
  a[2*i] = 0
  a[2*i+1] = 1
  b[2*i] = 1
  b[2*i+1] = 0

if len(s)%2 ==1:
  a[len(s)-1] = 0
  b[len(s)-1] = 1 


an = 0
bn = 0

for j in range(len(s)):
  if a[j] != s[j]:
    an += 1
  if b[j] != s[j]:
    bn += 1

print(min(an, bn))
a,b= map(int,raw_input().split())
d=a/b
r=a%b
f=float(a/b)
print %d,%d,%d,%(d,r,f)

### FIXED CODE ###

a,b= map(int,raw_input().split())
d=a/b
r=a%b
f=float(a)/float(b)
print "%d %d %f" % (d,r,f)
if x < a:
    print(0)
else:
    print(10)

### FIXED CODE ###

x, a = input().split()
if x < a:
    print(0)
else:
    print(10)
a, b = map(int, input().split())
n = 0
 while ( n < (b-1)/(a-1) ):
  n = n + 1

print(n)

### FIXED CODE ###

a, b = map(int, input().split())
n = 0
while b > n*(a-1) + 1:
  n = n + 1
else:
  print(n)
n, m = map(int, input().split())
a = [0]
b = [0]
for i in range(1, m+1):
    ta, tb = map(int, input().split())
    a.append(ta)
    b.append(tb)
dir = [[] for _ in range(m+1)]
for i in range(1, m+1):
    dir[a[i]].append(b[i])
    dir[b[i]].append(a[i])
ans = [0 for i in range(n+1)]
flag = [0 for i in range(n+1)]
flag[1] = 1
que = [1]
while len(que) != 0:
    #print('que: ', len(que), que)
    now = que.pop()
    flag[now] = 1
    for to in dir[now]:
        if flag[to] != 1 or not (to in que):
            que.append(to)
            flag[to] != 1
            ans[to] = now
"""         print(to)
        ans[to] = now
        flag[to] = 1
        for toto in dir[to]:
            if flag[toto] != 1:
                que.append(toto) """
print('Yes')
for i in range(2,n+1):
    print(ans[i])

### FIXED CODE ###

from collections import deque
n, m = map(int, input().split())
dir = [[] for _ in range(n+1)]

for i in range(m):
    ta, tb = map(int, input().split())
    dir[ta].append(tb)
    dir[tb].append(ta)

ans = [0]*(n+1)
flag = [False]*(n+1)
flag[1] = True
que = deque([1])
while que:
    #print('que: ', len(que), que)
    now = que.popleft()
    for to in dir[now]:
        if flag[to]:
            continue
        que.append(to)
        flag[to] = True
        ans[to] = now

print('Yes')
for i in range(2,n+1):
    print(ans[i])
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, K = map(int, raw_input().split())
R = [0] * (10**5) 

for i in xrange(N):
     ia, ib = map(int, raw_input().split())
     R[ia] += ib

k = 0
c = 0
while k < K:
    c += 1
    k += R[c]
print c    

### FIXED CODE ###

# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, K = map(int, raw_input().split())
R = [0] * (10**5+10) 

for i in xrange(N):
     ia, ib = map(int, raw_input().split())
     R[ia] += ib

k = 0
c = 0
while k < K:
    c += 1
    k += R[c]
print c
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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 LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    H,W,h,w = LI()
    if W%w != 0:
        s = [0]+[100000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        for i in range(H):
            print(*a)
    elif H%h != 0:
        H,W,h,w = W,H,w,h
        s = [0]+[100000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        ans = [[a[i]]*W for i in range(H)]
        for i in range(H):
            print(*ans[i])
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()


### FIXED CODE ###

#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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 LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    H,W,h,w = LI()
    if W%w != 0:
        s = [0]+[100000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        for i in range(H):
            print(*a)
    elif H%h != 0:
        H,W,h,w = W,H,w,h
        s = [0]+[100000]*(w-1)
        for i in range(W-w+1):
            s.append(s[-w]-1)
        a = [s[i]-s[i-1] for i in range(1,W+1)]
        print("Yes")
        ans = [[a[i]]*H for i in range(W)]
        for i in range(W):
            print(*ans[i])
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()
a = input()
print(a + a * a + a * a * a)

### FIXED CODE ###

a = int(input())
print(a + a * a + a * a * a)
N,M = map(int, input().split())
a_list = [int(input()) for _ in range(M)]

MOD = 10**9+7

dp = [0] * (N+1)
dp[1] = 0
dp[2] = 1
dp[3] = 2
for i in range(3, N+1):
    dp[i] = dp[i-1] + dp[i-2]

res = 1
bef = -1
for a in a_list:
    res *= dp[a-bef]
    res %= MOD
    bef = a

res *= dp[N-bef+1]
res %= MOD

print(res)

    

### FIXED CODE ###

N,M = map(int, input().split())
a_list = [int(input()) for _ in range(M)]

MOD = 10**9+7

dp = [0] * (10**5 + 3)
dp[1] = 0
dp[2] = 1
dp[3] = 2
for i in range(3, len(dp)):
    dp[i] = dp[i-1] + dp[i-2] 

res = 1
bef = -1
if M > 0:
    for a in a_list:
        res *= dp[a-bef]
        res %= MOD
        bef = a
res *= dp[N-bef+1]
res %= MOD

print(res)
3 4 240
60 90 120
80 150 80 150

### FIXED CODE ###

def delete_head_zeros(n):
	n = str(n)
	l = len(n)
	if "." in n:
		l = n.find(".")
	head_zeros = 0
	for i in range(l - 1):
		if n[i] == "0":
			head_zeros += 1
		else:
			break

	return n[head_zeros:]

# compare a, b
# a, b: int or string
def bigint_compare(a, b):
	a = delete_head_zeros(a)
	b = delete_head_zeros(b)
	if len(a) > len(b):
		return 1
	elif len(a) < len(b):
		return -1
	else:
		if a > b:
			return 1
		elif a < b:
			return -1
		else:
			return 0

# calculate a + b
# a, b: int or string
def bigint_plus(a, b):
	a = str(a)
	b = str(b)

	d = max([len(a), len(b)])
	a = '0' * (d - len(a)) + a
	b = '0' * (d - len(b)) + b

	ans = ""
	carry = 0
	for i in range(d):
		s = int(a[-i-1]) + int(b[-i-1]) + carry
		carry = s // 10
		ans = str(s % 10) + ans
	else:
		if carry:
			ans = str(carry) + ans

	return ans

# calculate a - b
# a, b: int or string
def bigint_minus(a, b): 
	a = str(a)
	b = str(b)
	M = []
	m = []
	sign = ""

	if len(a) > len(b) or (len(a) == len(b) and a >= b):
		[M, m] = [a, b]
	else:
		[M, m] = [b, a]
		sign = "-"
	m = '0' * (len(M) - len(m)) + m

	ans = ""
	borrow = 0
	for i in range(len(M)):
		s = int(M[-i-1]) - int(m[-i-1]) - borrow
		if s < 0:
			borrow = 1
			s += 10
		else:
			borrow = 0
		ans = str(s) + ans

	return sign + delete_head_zeros(ans)

# calculate a * b
# a, b: int or string
def bigint_multiply(a, b):
	a = str(a)
	b = str(b)

	md = []
	carry = 0
	for j in range(len(b)):
		mj = ""
		for i in range(len(a)):
			m = int(a[-i-1]) * int(b[-j-1]) + carry
			carry = m // 10
			mj = str(m % 10) + mj
		else:
			if carry:
				mj = str(carry) + mj
		md.append(mj)

	ans = 0
	for k in range(len(md)):
		ans = bigint_plus(md[k] + "0" * k, ans)

	return ans


# calculate a / b to d digits after decimal point
# a, b, d: int or string
def bigint_divide(a, b, d = 0):
	a = str(a)
	b = str(b)
	d = int(d)
	if d < 0:
		d = 0

	ans = ""
	r = ""
	for i in range(len(a) + d):
		q = 0
		if i < len(a):
			r += a[i]
		elif i == len(a):
			ans += "."
			r += "0"
		else:
			r += "0"

		if bigint_compare(r, b) == -1:
			ans += str(q)
		else:
			while bigint_compare(r, b) >= 0:
				r = bigint_minus(r, b)
				q += 1
			ans += str(q)

	return delete_head_zeros(ans)


a, b, x = [n for n in input().split(" ")]
c1 = bigint_divide(b, x)

if int(a) == 0:
  c2 = 0
else:
  c2 = bigint_divide(bigint_minus(a, 1), x)

if int(a) == 0:
  print(bigint_plus(bigint_minus(c1, c2), 1))
else:
  print(bigint_minus(c1, c2))
import sys


def primes(n):
    f = []
    for i in range(n + 1):
        if i > 2 and i % 2 == 0:
            f.append(0)
        else:
            f.append(1)
    i = 3
    while i * i <= n:
        if f[i] == 1:
            j = i * i
            while j <= n:
                f[j] = 0
                j += i + i
        i += 2
    return f[2:]


if __name__ == "__main__":
    ps = primes(100)
    for i in sys.stdin:
        print(i,sum(ps[:i-1]))

### FIXED CODE ###

import sys

f = [1, 0, 0, 0, 1, 0] * (1000000 // 6 + 1)
f = [0, 0, 1, 1] + f[3:-2]

i = 5
while i < 1000:
    if f[i] == 1:
        j = i * i
        while j <= 1000000:
            f[j] = 0
            j += i + i
    i += 2

for n in sys.stdin:
    i = int(n)
    print(sum(f[:i + 1]))
N = 50
big = 10 ** 16

K = int(input())

if K <= 50 * 50:
    a = [49] * 50
    a[0] += K * 50
else:
    a = [0] * 50
    index = 0 
    for i in range(K // big):
        a[i] = big
    a[i] = K % big
print(N)
print(" ".join(map(str, a)))

### FIXED CODE ###

K = int(input())
N = 50
a = [0] * 50

if K <= 50:
    for i in range(K):
        a[i] = 50
else:
    m = (K - 1) // 50
    base = 100 + m
    r = K % 50
    big = base - r
    small = big - 50 - r

    for i in range(r):
        a[i] = big
    for i in range(r, N, 1):
        a[i] = small

print(N)
print(" ".join(map(str, a)))
N = int(input())
h = [int(i) for i in input().split()]

memo = [float("inf")] * N
memo[0], memo[1] = 0, abs(h[1] - h[0])


def frog(ith):
    if memo[ith] != float("inf"):
        return memo[ith]
    memo[ith] = min(
        frog(ith - 1) + abs(h[ith] - h[ith - 1]),
        frog(ith - 2) + abs(h[ith] - h[ith - 2]),
    )
    return memo[ith]


print(frog(N - 1))


### FIXED CODE ###

N = int(input())
h = [int(i) for i in input().split()]
dp = []
for i in range(N):
    if i == 0:
        dp.append(0)
        continue
    if i == 1:
        dp.append(abs(h[1] - h[0]))
        continue
    dp.append(min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2])))
print(dp[-1])
from fractions import gcd
import sys
sys.setrecursionlimit(10**7) 

N,A,B,K=map(int,input().split())
mod = 998244353
#x!のmodP逆元を求めるx^-1=x^(p-2)
table=[1]
a=1
for i in range(1,N+1):
    a=(a*pow(i,mod-2,mod))%mod
    table.append(a)

num=1
for i in range(1,N+1):
    num = (num*i) %mod


number =0
for i in range(N):
    if (K-A*i)%B==0 and K-A*i>=0:
        j=(K-A*i)//B
        t = (num*num)%mod
        t = (t*table[i])%mod
        t = (t*table[j])%mod
        t = (t*table[N-i])%mod
        t = (t*table[N-j])%mod
        number = (number+t)%mod
print(number)

### FIXED CODE ###

N,A,B,K=map(int,input().split())
mod = 998244353
#x!のmodP逆元を求めるx^-1=x^(p-2)
table=[1]
a=1
for i in range(1,N+1):
    a=(a*pow(i,mod-2,mod))%mod
    table.append(a)

num=1
for i in range(1,N+1):
    num = (num*i) %mod


number =0
for i in range(N+1):
    if (K-A*i)%B==0 and K-A*i>=0:
        j=(K-A*i)//B
        if 0<=j<=N:
            t = (num*num)%mod
            t = (t*table[i])%mod
            t = (t*table[j])%mod
            t = (t*table[N-i])%mod
            t = (t*table[N-j])%mod
            number = (number+t)%mod
print(number)
import itertools
import numpy as np
def readInt():
    return list(map(int,input().split()))
n, k = readInt()
ans = 0
l = [int(x) for x in range(n+1)]
for i in range(k,n+2):
    # print(i, ".")
    c_l = list(itertools.combinations(np.mod(l,10**9+7),i))
    a = []
    for j in range(len(c_l)):
        # print(sum(c_l[j]))
        a.append(sum(c_l[j]))
        # print(a)
    # print(a)
    # print(set(a))
    # print(c_l)
    ans += np.mod(len(set(a)),10**9+7)
print(ans)

### FIXED CODE ###

import itertools
def readInt():
    return list(map(int,input().split()))
n, k = readInt()
ans = 0
# l = [int(x) for x in range(n+1)]
for i in range(k,n+2):
    smallest = (i-1)*i /2
    largest = n*(n+1)/2 - (n-i)*(n-i+1)/2
    ans += int(largest - smallest + 1)
    ans %= 10**9 + 7
print(ans)
import os
import math

def main():
    lst = [0,0,0,0,0,0]
    for i in range(0, int(input())):
        temp = float(input())
        if temp < 165:
            lst[0] += 1
        elif temp < 170:
            lst[1] += 1
        elif temp < 175:
            lst[2] += 1
        elif temp < 180:
            lst[3] += 1
        elif temp < 185:
            lst[4] += 1
        else:
            lst[5] += 1
    for i in range(0,6):
        print("{}:".format(i+1), end="")
        for j in range(0,lst[i]):
            print("*", end = "")
        print()

main()

### FIXED CODE ###

import os
import math

def main():
    lst = [0,0,0,0,0,0]
    for i in range(0, int(input())):
        temp = float(input())
        if temp < 165:
            lst[0] += 1
        elif temp < 170:
            lst[1] += 1
        elif temp < 175:
            lst[2] += 1
        elif temp < 180:
            lst[3] += 1
        elif temp < 185:
            lst[4] += 1
        else:
            lst[5] += 1
    for i in range(0,6):
        print("{}:".format(i+1), end="")
        for j in range(0,lst[i]):
            print("*", end = "")
        print()

main()
N, K = map(int, input().split())
lis = list(map(int, input().split()))
count = 0
for i in range(1, N + 1):
    if lis[i] >= K:
        count += 1
print(count) 

### FIXED CODE ###

N, K = map(int, input().split())
lis = list(map(int, input().split()))
count = 0
for i in range(N):
    if lis[i] >= K:
        count += 1
print(count)