Harryxun/stf_run huggingface dataset:
import sys
sys.setrecursionlimit(100000)

N = int(input())
h = [int(i) for i in input().split()]

memo = {}

def f(i):
  if i == 0:
    return 0
  if i == 1:
    return abs(h[i - 1] - h[i])
  else:
    if i - 1 not in memo:
      memo[i - 1] = f(i - 1)
    if i - 2 not in memo:
      memo[i - 2] = f(i - 2)
    j1 = memo[i - 1] + abs(h[i - 1] - h[i])
    j2 = memo[i - 2] + abs(h[i - 2] - h[i])
    return j1 if j1 < j2 else j2

print(f(N - 1))


### FIXED CODE ###

N = int(input())
h = [int(i) for i in input().split()]

memo = []
for i in range(N):
  if i == 0:
    memo.append(0)
  elif i == 1:
    memo.append(memo[i - 1] + abs(h[i - 1] - h[i]))
  else:
    j1 = memo[i - 1] + abs(h[i - 1] - h[i])
    j2 = memo[i - 2] + abs(h[i - 2] - h[i])
    memo.append(j1 if j1 < j2 else j2)

print(memo[N - 1])
#!/usr/bin/env python3

# from numba import njit
from collections import Counter
# input = stdin.readline

# @njit
def solve(n,a):
  alphabetLst = {}
  for i in range(n):
... (17 lines) ...


def main():
  N = int(input())
  a = [input() for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()

### FIXED CODE ###

#!/usr/bin/env python3

# from numba import njit
from collections import Counter
# input = stdin.readline

# @njit
def solve(n,a):
  alphabetLst = {}
  for i in range(n):
    # i番目の文字列の中の文字を数える
    d = Counter(a[i])
    for c in (chr(ord("a") + i) for i in range(26)):
      if not c in d.keys():
        alphabetLst[c] = 0
      elif not c in alphabetLst.keys():
        alphabetLst[c] = d[c]
      elif d[c] < alphabetLst[c]:
        alphabetLst[c] = d[c]


  res = []
  for k,v in alphabetLst.items():
    res += [k]*v

  return "".join(res)

def main():
  N = int(input())
  a = [input() for _ in range(N)]
  print(solve(N,a))
  return

if __name__ == '__main__':
  main()
a = int(input())
b = int(input())
print((a+b),(a+b)*2)

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
print(a*b,(a+b)*2)
# coding: utf-8
# Your code here!

N=int(input())

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

init=l.pop(-1)

left=init
center=0

ans=[left]

def find(left):
    if len(l)==1:
        ans.append(l.pop(0))
        pass
    elif len(l)==0:
        pass
        
    else:
        right=l.pop(-1)
        for i in range(len(l)):
            if l[i]==left^right:
                center=l.pop(i)
                ans.append(center)
                ans.append(right)
                find(right)
                break
            else:
                break
            
find(left)

if len(ans)==N:
    if ans[0]==ans[1]^ans[-1] and ans[-1]==ans[0]^ans[1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")


### FIXED CODE ###

# coding: utf-8
# Your code here!
N=int(input())
A=list(map(int,input().split()))
B=list(set(A))

if len(B)==3:
    if B[0]^B[1]==B[2]:
        if A.count(B[0])==A.count(B[1]) and A.count(B[1])==A.count(B[2]):
            print("Yes")
            exit()
elif len(B)==2:
    if 2*A.count(B[0])==A.count(B[1]):
        print("Yes")
        exit()
elif len(B)==1:
    if B[0]==0:
        print("Yes")
        exit()

print("No")
import functools


def divise(n, divisor):
    if n == divisor:
        return n
    elif n % divisor == 0:
        return 0
    else:
        return n

number = int(input())
origin = [int(input()) for x in range(number)]

divised = origin

for i in range(2, max(origin)+1):
    divised = list(map(functools.partial(divise, divisor=i), divised))

for j in range(number):
    if divised[j] == 0:
        origin.pop(j)
    else:
        pass

print(len(origin))

### FIXED CODE ###

def is_prime(n):
    i = 2
    while i * i <= n:
        if n % i == 0:
            return False
        i += 1
    return True

count = 0

number = int(input())
for i in range(number):
    n = int(input())
    if is_prime(n):
        count = count + 1

print(count)
x, a, b = input().split()
x = int(x)
a = int(a)
b = int(b)

if x > a:
	x_a = x - a
else:
x_a = a - x

if x > b:
	x_b = x - b
else:
	x_b = b - x
	

if x_a > x_b:
	print("B")
else:
	print("A")

### FIXED CODE ###

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

if x > a:
	x_a = x - a
else:
	x_a = a - x

if x > b:
	x_b = x - b
else:
	x_b = b - x
	


if x_a > x_b:
	print("B")
else:
	print("A")
import math

N = int(input())
xy = [[0, 0] for _ in range(N)]
for a in xy:
    a[0], a[1] = map(int, input().split())
x = a[0]
y = a[1]

at = []
for i in range(N):
    for j in range(N):
        Da = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        at.append(Da)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)

### FIXED CODE ###

import math
N = int(input())
x = [0]*N
y = [0]*N
for i in range(N):
    x[i],y[i] = map(int,input().split())
at=[]
for i in range(N):
    for j in range(N):
        ea = math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)
        at.append(ea)
da = 0
for ag in at:
    da += ag
avg = da * math.factorial(N - 1) / math.factorial(N)
print(avg)
N=int(input())
d4=0
d2=0
for a in input().split():
    if a%4==0:
        d4+=1
    elif a%2==0:
        d2+=1

if 2*d4+d2>=N:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N=int(input())
d4=0
d2=0
for a in input().split():
    if int(a)%4==0:
        d4+=1
    elif int(a)%2==0:
        d2+=1


if N%2==1 and d2==0 and (N-1)//2<=d4:
    print('Yes')
elif 2*d4+d2>=N:
    print('Yes')
else:
    print('No')
k=int(input())
l=[]
p=[]
for i in range(1,10):
  l.append(111*i)
for i in l:
  if i-k>=0:
    p.aapend(i)
print(min(p))  
  
  

### FIXED CODE ###

k=int(input())
l=[]
p=[]
for i in range(1,10):
  l.append(111*i)
for i in l:
  if i-k>=0:
    p.append(i)
print(min(p))
n = int(input())
vs = [[] for i in range(n)]
out = [0]*n

for i in range(n-1):
    a, b = [int(i)-1 for i in input().split()]
    vs[a].append([b,i+1])
    vs[b].append([a,i+1])

def coloring(index,defColor):
    i=0
    for v in vs[index]:
        if i==defColor:
           i+=1
        out[v[1]]=i
        vs[v[0]].remove([index,v[1]])
        coloring(v[0],i)
        i+=1
    out[0] = max(out[0],i-1)

coloring(0,-1)
for i in range(n):
    print(out[i]+1)

### FIXED CODE ###

n = int(input())
vs = [[] for i in range(n)]
out = [0]*n

for i in range(n-1):
    a, b = [int(i)-1 for i in input().split()]
    vs[a].append([b,i+1])
    vs[b].append([a,i+1])

nex = [[0,-1]]

def coloring(index,defColor):
    i=0
    for v in vs[index]:
        if i==defColor:
           i+=1
        out[v[1]]=i
        vs[v[0]].remove([index,v[1]])
        nex.append([v[0],i])
        i+=1
    out[0] = max(out[0],i-1)

while nex.__len__()>0:
    c,d = nex.pop()
    coloring(c,d)

for i in range(n):
    print(out[i]+1)
import math
src = [input() for _ in range(5)]
k_li = []
v_li = []
sum = 0
for s in src:
    if int(s[-1]) != 0:
        k_li.append(int(s[-1]))
        v_li.append(int(s))
    else:
        sum += int(s)
m = min(k_li)
flag = False
for k,v in zip(k_li,v_li):
    if k == m and flag == False:
        sum += v
        flag = True
    else:
        sum += math.ceil(v/10)*10
print(sum)

### FIXED CODE ###

import math
src = [input() for _ in range(5)]
k_li = []
v_li = []
sum = 0
for s in src:
    if int(s[-1]) != 0:
        k_li.append(int(s[-1]))
        v_li.append(int(s))
    else:
        sum += int(s)
flag = False
if len(k_li)>0:
    m = min(k_li)
    for k,v in zip(k_li,v_li):
        if k == m and flag == False:
            sum += v
            flag = True
        else:
            sum += math.ceil(v/10)*10
print(sum)
import sys
n = int(input())
a = list(map(int, input().split(' ')))

a.sort()
if n%2 == 0:
    for i in range(n-1):
        if i%2 == 0:
            if a[i] == a[i+1]:
                continue
            else:
                print(0)
                sys.exit()
        else:
            if a[i]+2 == a[i+1]:
                continue
            else:
                print(0)
                sys.exit()
    print(int(2**(n/2)))
else:
    if a[0] == 0:
        for i in range(1, n-1):
            if i%2 == 1:
                if a[i] == a[i+1]:
                    continue
                else:
                    print(0)
                    sys.exit()
            else:
                if a[i]+2 == a[i+1]:
                    continue
                else:
                    print(0)
                    sys.exit()
        print(int(2**((n-1)/2)))    
    else:
        print(0)
        sys.exit()

### FIXED CODE ###

import sys
n = int(input())
a = list(map(int, input().split(' ')))

a.sort()
if n%2 == 0:
    for i in range(n-1):
        if i%2 == 0:
            if a[i] == a[i+1]:
                continue
            else:
                print(0)
                sys.exit()
        else:
            if a[i]+2 == a[i+1]:
                continue
            else:
                print(0)
                sys.exit()
    result = 2 ** (n//2)
    print(result % (10**9+7))
else:
    if a[0] == 0:
        for i in range(1, n-1):
            if i%2 == 1:
                if a[i] == a[i+1]:
                    continue
                else:
                    print(0)
                    sys.exit()
            else:
                if a[i]+2 == a[i+1]:
                    continue
                else:
                    print(0)
                    sys.exit()
        result = 2**((n-1)//2)
        print(result %(10**9+7))
    else:
        print(0)
        sys.exit()
X,Y = map(int,input().split())
MOD = 10**9+7

if (X+Y)%3:
    print(0)
    exit()
n = (X+Y)//3
r = X-n
if not 0 <= r <= n:
    print(0)

MAXN = n
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
def comb(n,r):
    ret = 1
    for i in range(r):
        ret *= n-i
        ret *= inv[i+1]
        ret %= MOD
    return ret

print(comb(n,r))

### FIXED CODE ###

X,Y = map(int,input().split())
if X>Y:
    X,Y = Y,X
if(X+Y)%3:
    print(0)
    exit()
n = (X+Y)//3
if X < n:
    print(0)
    exit()

MOD = 10**9+7
r = X-n

maxn = n+5
fac = [1,1] + [0]*maxn
finv = [1,1] + [0]*maxn
inv = [0,1] + [0]*maxn
for i in range(2,maxn+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def ncr(n,r):
    if n < r: return 0
    if n < 0 or r < 0: return 0
    return fac[n] * (finv[r] * finv[n-r] % MOD) % MOD

print(ncr(n,r))
S = input()
K = int(input())
n = 0
for i in range(len(S)):
    if S[i] != "1":
        break
    else:
        n += 1

if K < n:
    print(S[n])
else:
    print(S[n])

### FIXED CODE ###

S = list(input())
K = int(input())
n = 0
for i in range(len(S)):
    if S[i] != "1":
        n = i +1
        break

if K < n:
    print(1)
else:
    print(int(S[n-1]))
n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
    c += 1
print(c)

### FIXED CODE ###

n, r = map(int, input().split())
i = r
c = 1
while i <= n:
	i *= r
	c += 1
print(c)
n, m = map(int,input().split())
outlist = [int(input()) for i in range(m)]

def Fib(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = (a + b) % 1000000007, a % 1000000007
    return(a)

def stepcount(x,y):
    if y-x <= 1:
        return 1
    else:
        return Fib(y-x)

answer = Fib(outlist[0]-1)

for i in range(m-1):
    answer *= stepcount(outlist[i]+1,outlist[i+1]-1)
    answer = answer % 1000000007

answer = (answer * stepcount(outlist[m-1]+1, n)) % 1000000007

for i in range(m-1):
    if outlist[i+1] - outlist[i] == 1:
        answer = 0

print(answer)

### FIXED CODE ###

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


def Fib(num):
    a, b = 1, 0
    for _ in range(num):
        a, b = (a + b) % 1000000007, a % 1000000007
    return (a)


def stepcount(x, y):
    if y - x <= 1:
        return 1
    else:
        return Fib(y - x)

if m != 0:
    answer = Fib(outlist[0] - 1)

    for i in range(m - 1):
        answer *= stepcount(outlist[i] + 1, outlist[i + 1] - 1)
        answer = answer % 1000000007

    answer = (answer * stepcount(outlist[m - 1] + 1, n)) % 1000000007

    for i in range(m - 1):
        if outlist[i + 1] - outlist[i] == 1:
            answer = 0
else:
    answer = Fib(n)

print(answer)
a, b, c = map(int, input().split())
for i in range(1, 101):
  if a%i + b%i < 1:
	c -= 1
    if c < 1:
      print(i)
	  break 
  

### FIXED CODE ###

#! /usr/bin/env python3
a, b, c = map(int, input().split())
t = []
for i in range(1, 101):
    if a%i + b%i < 1: t += [i]
print(t[-c])
from collections import Counter
N = int(input())
a_list = list(map(int,input().split()))

l = len(set(a_list))

def check():
    counter = Counter(a_list)
    if l == 1:
        if a_list[0] == 0:
            return True
        return False
    if l == 2:
        if Counter[0] == 3/N:
            return True
        return False
    if l == 3:
        x,y,z = set(a_list)
        if int(bin(x^y^z), 0) == 0 and set(list(counter.values()))==set([3/N]):
            return True
        return False
    return False

if check():
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from collections import Counter
N = int(input())
a_list = list(map(int,input().split()))

l = len(set(a_list))

def check():
    counter = Counter(a_list)
    if l == 1:
        if a_list[0] == 0:
            return True
        return False
    if l == 2:
        if counter[0] == N/3:
            return True
        return False
    if l == 3:
        x,y,z = set(a_list)
        if int(bin(x^y^z), 0) == 0 and set(list(counter.values()))==set([N/3]):
            return True
        return False
    return False

if check():
    print("Yes")
else:
    print("No")
n = int(raw_input().split())

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

p = map(lambda x : x % 2, a)
if p.count(1)%2 == 0 :
    print "YES"
else :
    print "NO"

### FIXED CODE ###

n = int(raw_input())
 
a = list(map(int, raw_input().split()))
 
p = map(lambda x : x % 2, a)
if p.count(1)%2 == 0 :
    print "YES"
else :
    print "NO"
# Nの倍数の数を格納する辞書
baisuu = {i:0 for i in range(1,N+1)}
M=0
out_list=[]

a=listA

half=N//2

for i,ai in enumerate(a):
    now_index=N-i
    if now_index > half:
        if ai==1:
            soinsuu = factorization(now_index)
            out_list.append(now_index)
            M+=1
            for so in soinsuu:
                baisuu[so]+=1
    else:
        if baisuu[now_index]%2!=int(ai):
            out_list.append(now_index)
            M+=1
            soinsuu = factorization(now_index)
            for so in soinsuu:
                baisuu[so]+=1

print(M)
if M>0:
    out_list=sorted(out_list)
    print(" ".join(list(map(str, out_list))))

### FIXED CODE ###

N=int(input())
a = list(map(int,input().split()))[::-1]

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)

    # divisors.sort()
    return divisors

# Nの倍数の数を格納する辞書
baisuu = {i:0 for i in range(1,N+1)}
M=0
out_list=[]

half=N//2

for i,ai in enumerate(a):
    now_index=N-i
    if now_index > half:
        if ai==1:
            soinsuu = make_divisors(now_index)
            out_list.append(now_index)
            M+=1
            for so in soinsuu:
                baisuu[so]+=1
    else:
        if baisuu[now_index]%2!=ai:
            out_list.append(now_index)
            M+=1
            soinsuu = make_divisors(now_index)
            for so in soinsuu:
                baisuu[so]+=1

print(M)
if M>0:
    out_list=sorted(out_list)
    print(" ".join(list(map(str, out_list))))
S = input()
akb = 'AKIHABAR'
if len(S) <= len(akb)+1:
  i = 0
  for a in akb:
    if S[i] == a: i+=1
    elif S[i] != a and a == 'A': continue
    else:
      print('NO')
      exit()
  print('YES')
else:
  print('NO')



### FIXED CODE ###

S = input()
akb = 'AKIHABAR'
if len(S) <= len(akb)+1:
  i = 0
  for a in akb:
    if i >= len(S):
      print('NO')
      exit()
    if S[i] == a: i+=1
    elif S[i] != a and a == 'A': continue
    else:
      print('NO')
      exit()
  print('YES')
else:
  print('NO')
a,b,t=list(map(int,input()))
print(t*(b//a))


### FIXED CODE ###

a,b,t=list(map(int,input().split()))
print((t//a)*b)
int a, b, c
a, b, c = c, a, b
print(a, b, c)


### FIXED CODE ###

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

    dp = [0] * (1 << n)
    for i in [i >> 1 for i, x in enumerate(input()) if x == '1']:
        dp[1 << i] = 1

    npow = 1 << n

    for i in range(n - 1):
        _dp = [0] * npow
        for j in [i >> 1 for i, x in enumerate(input()) if x == '1']:
            jpow = 1 << j
            for mask,val in enumerate(dp):
                if not mask & jpow:
                    _dp[mask + jpow] += val
        for mask in range(npow):
            _dp[mask] %= MOD
        dp = _dp

    print(sum(dp) % MOD)

main()

### FIXED CODE ###

range = xrange
input = raw_input
MOD = 10**9+7
 
n = int(input())

dp = [0] * (1 << n)
for i in [i for i, x in enumerate(input().split()) if x == '1']:
    dp[1 << i] = 1

npow = 1 << n

for i in range(n - 1):
    _dp = [0] * npow
    for j in [i for i, x in enumerate(input().split()) if x == '1']:
        jpow = 1 << j
        mask = 0
        while mask < npow:
            _dp[mask + jpow] += dp[mask]
            mask += 1 + ((mask+1) & jpow)
    for mask in range(npow):
        _dp[mask] %= MOD
    dp = _dp
 
print(sum(dp) % MOD)
while 1:
    m, n = map(int, raw_input().split())
    if m == 0:
        break
    MAX = 10**7
    p= [0]*(MAX+1)
    i = m
    cnt = 0
    while 1:
        if not p[i]:
            if cnt == n:
                break
            for j in xrange(i, MAX, i):
                p[j] = 1
            cnt += 1
        i += 1
    print i

### FIXED CODE ###

import math
MAX = 7400000
prime = [1]*MAX
prime[0] = prime[1] = 0
res = []
sq = int(math.sqrt(MAX))
for i in xrange(2, sq+1):
    q = len(res)
    if prime[i]:
        res.append(i)
        for j in xrange(i*i, MAX, i):
            prime[j] = 0
    prime[i] = q
for i in xrange(sq+1, MAX):
    q = len(res)
    if prime[i]:
        res.append(i)
    prime[i] = q

def solve(m, n):
    # [m,m*m)
    sat = [0]*(m*m)
    for i in xrange(m, m*m):
        if not sat[i]:
            if n == 0:
                return i
            n -= 1
            for j in xrange(i, m*m, i):
                sat[j] = 1
    # [m*m,\inf)
    idx = prime[m*m]
    return res[idx+n]
while 1:
    m, n = map(int, raw_input().split())
    if m==0:
        break
    print solve(m, n)
one = []
ten = []

menu = [int(input()) for i in range(5)]

for i in range(5):
    one.append(menu[i] % 10)
    ten.append(menu[i] // 10)

for i in range(5):
    if one[i] == 0:
        one[i] = 100

one_min = min(one)

for i in range(5):
    if one[i] == 100:
        one[i] = 0

for i in range(5):
    if one_min == one[i]:
        one_min_idx = i

total = 0

for i in range(5):
    if one_min_idx != i:
        if one[i] == 0:
            total += ten[i] * 10
        else:
            total += ten[i] * 10 + 10

total += menu[one_min_idx]

print(total)


### FIXED CODE ###

one = []

menu = [int(input()) for i in range(5)]

for i in range(5):
    one.append(10 - menu[i] % 10)

for i in range(5):
    if one[i] == 10:
        one[i] = 0

total = 0
cnt = 0
for i in range(5):
    if cnt == 0 and one[i] == max(one):
        total += menu[i]
        cnt = 1
    else:
        total += menu[i]
        total += one[i]

print(total)
A,B= [int(x) for x in input().split()]

if A <= 5:
    print(0)
elif 6<= a <= 12:
    print(int(B/2))
else:
    print(B)




### FIXED CODE ###

A,B= [int(x) for x in input().split()]

if A <= 5:
    print(0)
elif 6<= A <= 12:
    print(int(B/2))
else:
    print(B)
# import numpy as np
class UnionFind:
    def __init__(self, n):
        # self.parent = np.array([-1] * n)
        # self.size = np.array([1] * n)
        self.parent = [-1] * n
        self.size = [1] * n
    def find(self, x):
        if self.parent[x] == -1:
            return x
        else:
            # a = self.find(self.parent[x])
            # self.parent[x] = a
            # return a
            return self.find(self.parent[x])
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            self.parent[x] = y
            self.size[y] += self.size[x]
    def get_size(self, x):
        return self.size[self.find(x)]
    def printout(self):
        print(self.parent)
        print(self.size)

N, M, K = map(int, input().split())
uf = UnionFind(N)

ab = [[int(i)-1 for i in input().split()] for j in range(M)]
cd = [[int(i)-1 for i in input().split()] for j in range(K)]

for a, b in ab:
    uf.union(a, b) #RE

ans =[uf.get_size(i)-1 for i in range(N)]

for a, b in ab:
    ans[a] -= 1
    ans[b] -= 1

for c, d in cd:
    if uf.find(c) == uf.find(d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans)

### FIXED CODE ###

import sys #追加
sys.setrecursionlimit(500*500) #追加

class UnionFind:
    def __init__(self, n):
        self.parent = [-1] * n
        self.size = [1] * n
    def find(self, x):
        if self.parent[x] == -1:
            return x
        else:
            a = self.find(self.parent[x])
            self.parent[x] = a
            return a
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            self.parent[x] = y
            self.size[y] += self.size[x]
    def get_size(self, x):
        return self.size[self.find(x)]
    def printout(self):
        print(self.parent)
        print(self.size)

N, M, K = map(int, input().split())
uf = UnionFind(N)

ab = [[int(i)-1 for i in input().split()] for j in range(M)]
cd = [[int(i)-1 for i in input().split()] for j in range(K)]

for a, b in ab:
    uf.union(a, b) #RE

ans =[uf.get_size(i)-1 for i in range(N)]

for a, b in ab:
    ans[a] -= 1
    ans[b] -= 1

for c, d in cd:
    if uf.find(c) == uf.find(d):
        ans[c] -= 1
        ans[d] -= 1

print(*ans)
S = raw_input()

S = int(S)

m = S / 60
h = m / 60
s = S - 60 * (m + s * 60) 

print h:m:s

### FIXED CODE ###

S = raw_input()
 
S = int(S)
 
h = S / 60 / 60
m = S / 60 % 60
s = S % 60 % 60
 
print "%d:%d:%d" %(h, m, s)
n = input()
print(10 ** n)

### FIXED CODE ###

a = int(input())
print(a ** 3)
#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

def calcGroup(s):
  whiteCount = 0
  blackCount = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if s[i] = "":
        pass
      elif s[i] = "W":
        whiteCount += 1
      elif s[i] = "B":
        blackCount += 1
      else:
        raise ValueError
    prev = s[i]
  return whiteCount,blackCount

# @njit
def solve(s):
  # white,black = calcGroup(s)
  return min(calcGroup(s))



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()


### FIXED CODE ###

#!/usr/bin/env python3

# from numba import njit

# input = stdin.readline

def calcGroup(s):
  whiteCount = 0
  blackCount = 0
  prev = ""
  for i in range(len(s)):
    if s[i] == prev:
      pass
    else:
      if s[i] == "W":
        whiteCount += 1
      elif s[i] == "B":
        blackCount += 1
      else:
        raise ValueError
    prev = s[i]
  return whiteCount,blackCount

# @njit
def solve(s):
  white,black = calcGroup(s)
  if abs(white-black) == 0:
    return (white-1)*2+1
  else:
    return min(white,black)*2



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()
def s():
 import sys
 r=sys.stdin.readline
 for e in iter(r,'0 0'):
  N,M=map(int,e.split())
  k,p=1,0
  S=[int(r()) for _ in[0]*N]
  for d in[int(r())for _ in[0]*M]:
   p+=d if N<=p+d else d+S[p+d]
   if N<=p+1:break
   k+=1
  print(k)
if'__main__'==__name__:s()


### FIXED CODE ###

import sys
r=sys.stdin.readline
for e in iter(r,'0 0\n'):
 N,M=map(int,e.split())
 k,p=1,0
 S=[int(r())for _ in[0]*N]
 for d in[int(r())for _ in[0]*M]:
  p+=d;
  if p<N:p+=S[p]
  if N<=p+1:break
  k+=1
 print(k)
A,B = map(int,input().split())


ans = 0
for i in range(A,B+1):
  num = map(int,list(str(i)))
  if num[1]==num[5] and num[2]==num[4]:
    ans += 1
    

### FIXED CODE ###

A,B = map(int,input().split())


ans = 0
for i in range(A,B+1):
  num = list(map(int,list(str(i))))
  if num[0]==num[4] and num[1]==num[3]:
    ans += 1


    
print(ans)