Harryxun/stf_run huggingface dataset:
def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  if x == 1:
    print(0, -1)
    exit()
  for i in range(1, 100):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()

### FIXED CODE ###

def main():
  from itertools import combinations
  x = int(input())
  ls = [0]
  a = 0
  b = 0
  if x == 1:
    print(0, -1)
    exit()
  for i in range(1, 200):
    ls.append(i**5)
    ls.append(-i**5)
  ls.sort()
  for b in ls:
    if x + b in ls:
      a = x + b  
      break
  if a < 0:
    print(-1*int(pow(-a, 0.2)), end=' ')
  else:
    print(int(pow(a, 0.2)), end=' ')
  if b < 0:
    print(-1*int(pow(-b, 0.2)), end=' ')
  else:
    print(int(pow(b, 0.2)), end=' ')
  


if __name__ == '__main__':
  main()
import sys
input = sys.stdin.readline

n,m,l = map(int,input().split())
town = [list(map(int,input().split())) for _ in range(m)]
q = int(input())
query = [list(map(int,input().split())) for _ in range(q)]

def warshall_floyd(d,n):
    for i in range(n):
        for j in range(n):
            for k in range(n):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])

inf = (l+1)*n
d = [[inf]*n for _ in range(n)]
for i in range(n):
    d[i][i] = 0
for a,b,c in town:
    a -= 1
    b -= 1
    d[a][b] = c
    d[b][a] = c
    
warshall_floyd(n,d)

d2 = [None]*n
for i,row in enumerate(d):
    d2[i] = [1 if val<=l else inf for val in row]
    d2[i][i] = 0

warshall_floyd(n,d2)
 
for s,t in query:
    s -= 1
    t -= 1
    count = (d2[s][t]%inf)-1
    print(count)

### FIXED CODE ###

import sys
input = sys.stdin.readline

N,M,L = map(int,input().split())
ABC = [list(map(int,input().split())) for _ in [0]*M]
Q = int(input())
ST = [list(map(int,input().split())) for _ in [0]*Q]


INF = (L+1)*N
d = [[INF]*N for _ in [0]*N]
for i in range(N):
    d[i][i] = 0
for a,b,c in ABC:
    a-=1;b-=1
    d[a][b] = c
    d[b][a] = c

def Warshall_Floyd(d,N=None):
    if N==None : N = len(d)
    for k in range(N):
        for i in range(N):
            for j in range(N):
                d[i][j] = min(d[i][j],d[i][k]+d[k][j])

Warshall_Floyd(d,N)

d2 = [None]*N
for i,row in enumerate(d):
    d2[i] = [1 if e<=L else INF for e in row]
    d2[i][i] = 0

Warshall_Floyd(d2,N)

for s,t in ST:
    s-=1;t-=1
    ans = (d2[s][t]%INF)-1
    print(ans)
n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

plus = []
minus = []
for i in a:
    if i > 0: plus.append(i)
    if i < 0: minus.append(-i)
plus.sort(reverse=True)
minus.sort(reverse=True)

ans = 1
if k == n:
    for x in a[:k]:
        ans = (ans * x) % mod
elif k > len(plus) + len(minus):
    ans = 0
elif n == len(plus):
    for x in plus[:k]:
        ans = (ans * x) % mod
elif n == len(minus):
    if k % 2 == 1:
        ans = -1
        minus.sort()
    for x in minus[:k]:
        ans = (ans * x) % mod
else:
    i, j = 0, 0
    while i + j < k:
        if i + j == k - 1:
            ans = (ans * plus[i]) % mod
            i += 1
        else:
            x_p = (plus[i] * plus[i + 1]) % mod if i < len(plus) - 1 else 1
            x_m = (minus[j] * minus[j + 1]) % mod if j < len(minus) - 1 else 1
            if x_p > x_m:
                ans = (ans * x_p) % mod
                i += 2
            else:
                ans = (ans * x_m) % mod
                j += 2
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
a = list(map(int, input().split()))
mod = 10 ** 9 + 7

plus = []
minus = []
for i in a:
    if i > 0: plus.append(i)
    if i < 0: minus.append(i)

ans = 1
if k > len(plus) + len(minus):
    ans = 0
elif len(minus) == 0:
    plus.sort(reverse=True)
    for i in range(k):
        ans = (ans * plus[i]) % mod
elif len(plus) == 0:
    if k % 2 == 0:
        minus.sort()
        for i in range(k):
            ans = (ans * minus[i]) % mod
    else:
        if n != len(minus):
            ans = 0
        else:
            minus.sort(reverse=True)
            for i in range(k):
                ans = (ans * minus[i]) % mod
elif k == len(plus) + len(minus) and (len(minus) % 2) == 1:
    if n != k:
        ans = 0
    else:
        for x in plus:
            ans = (ans * x) % mod
        for y in minus:
            ans = (ans * y) % mod
else:
    plus.sort(reverse=True)
    minus.sort()
    i, j = 0, 0
    if k % 2 == 1:
        ans = plus[0]
        i = 1
    while i + j < k:
        tmp_p = plus[i] * plus[i + 1] if i <= len(plus) - 2 else 1
        tmp_m = minus[j] * minus[j + 1] if j <= len(minus) - 2 else 1
        if tmp_p >= tmp_m:
            ans = (ans * (tmp_p % mod)) % mod
            i += 2
        else:
            ans = (ans * (tmp_m % mod)) % mod
            j += 2
print(ans)
from collections import deque, _heapq
N, K = map(int, input().split())
V = deque(map(int, input().split()))

class Money:
    def __init__(self):
        self.yen = 0
        self.red = []

    def value(self):
        return self.yen + sum(self.red)

    def add(self, yen):
        if yen >= 0:
            self.yen += yen
        else:
            self.red.append(yen)

    def remove(self, yen):
        if yen >= 0:
            self.yen -= yen
        else:
            self.red.remove(yen)

#mny = Money()
def get(cnt, mny, lstop, rstop):
    ans = mny.value()

    if cnt <= 0:
        return ans

    if len(V) > 0:

        if lstop == 0:
            w = V.popleft()
            mny.add(w)
            ans = max(ans, get(cnt-1, mny, lstop, rstop))
            mny.remove(w)
            V.appendleft(w)
        elif lstop > 0:
            lstop -= 1

        if rstop == 0:
            w = V.pop()
            mny.add(w)
            ans = max(ans, get(cnt-1, mny, -1, rstop))
            mny.remove(w)
            V.append(w)

    if len(mny.red) >= cnt-1:
        w = min(mny.red)
        mny.red.remove(w)

        V.appendleft(w)
        ans = max(ans, get(cnt-1, mny, -1, rstop))
        V.popleft()

        V.append(w)
        ans = max(ans, get(cnt-1, mny, lstop, -1))
        V.pop()

        mny.red.append(w)    

    return ans

print(get(K, Money(), 0, 0))


### FIXED CODE ###

from collections import deque, _heapq
N, K = map(int, input().split())
V = deque(map(int, input().split()))

class Money:
    def __init__(self):
        self.yen = 0
        self.red = []

    def value(self):
        return self.yen + sum(self.red)

    def add(self, yen):
        if yen >= 0:
            self.yen += yen
        else:
            self.red.append(yen)

    def remove(self, yen):
        if yen >= 0:
            self.yen -= yen
        else:
            self.red.remove(yen)

#mny = Money()
def get(cnt, mny, lstop, rstop):
    ans = mny.value()

    if cnt <= 0:
        return ans

    if len(V) > 0:

        if lstop == 0:
            w = V.popleft()
            mny.add(w)
            ans = max(ans, get(cnt-1, mny, lstop, rstop))
            mny.remove(w)
            V.appendleft(w)
        elif lstop > 0:
            lstop -= 1

        if rstop == 0:
            w = V.pop()
            mny.add(w)
            ans = max(ans, get(cnt-1, mny, -1, rstop))
            mny.remove(w)
            V.append(w)

    if len(mny.red) > 0:
        w = min(mny.red)
        mny.red.remove(w)

        V.appendleft(w)
        ans = max(ans, get(cnt-1, mny, -1, -1))
        V.popleft()

        mny.red.append(w)    

    return ans

print(get(K, Money(), 0, 0))
m = input()
x=ord(m)
if x >= 97 and x <= 122:
    print("a")
else:
    print("A"

### FIXED CODE ###

m = input()
x = ord(m)
if x >= 97 and x <= 122:
    print("a")
else:
    print("A")
s = input()
hitachi = ""

for i in 5:
    hitachi += "hi"
    if s==hitachi:
        print("Yes")

print("No")

### FIXED CODE ###

s = input()
ans = "No"

if s=="hi" :
    ans="Yes"
if s=="hihi":
    ans="Yes"
if s=="hihihi":
    ans="Yes"
if s=="hihihihi":
    ans="Yes"
if s=="hihihihihi":
    ans="Yes"

print(ans)
N = int(input())
transporter = [0]*5
transporter_lag = [0]*5
for i in range(5):
    transporter[i] = int(input())
for i in range(1,5):
    if transporter[i] >= transporter[i-1]:
        transporter_lag[i] = 0
    else :
        transporter_lag[i] = math.ceil(transporter[i-1]/transporter[i]) - 1
if math.ceil(N/transporter[0]) <= 5:
    ans = 5+ sum(transporter_lag)
else :
    ans = math.ceil(N/transporter[0]) + sum(transporter_lag) + 4
print(ans)

### FIXED CODE ###

import math
N = int(input())
transporter = [0]*5
for i in range(5):
    transporter[i] = int(input())
min_trans = min(transporter)
ans = math.ceil(N/min_trans) - 1 + 5
print(ans)
import sys

class Node:
    def __init__(self, i):
        self.linked = list()
        self.id = i
        self.blocked = list()
        self.visited = False

line = sys.stdin.readline().strip()
n,m,k = map(int, line.split())
nodes = [] 
for i in range(n):
    nodes.append(Node(i))
for i in range(m):
    line = sys.stdin.readline().strip()
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    nodes[a].linked.append(b)
    nodes[b].linked.append(a)

for i in range(k):
    line = sys.stdin.readline().strip()
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    nodes[a].blocked.append(b)
    nodes[b].blocked.append(a)

start = 0
res = [-1] * n
while True:
    visited = [start]
    def deep_first(node):
        for one in node.linked:
            if not nodes[one].visited:
                visited.append(one)
                nodes[one].visited = True 
                #print(visited)
                deep_first(nodes[one])
    nodes[start].visited = True
    deep_first(nodes[start])           
    for one in visited:
        cands = 0
        for two in nodes[one].blocked:
            if two in visited:
                cands += 1
        res[one] = len(visited) - len(nodes[one].linked) - 1 - cands

    start = -1
    for i in range(1, n):
        if res[i] < 0:
            start = i
    if start == -1:
        break

print(" ".join(map(str, res)))

### FIXED CODE ###

import sys

line = sys.stdin.readline().strip()
n,m,k = map(int, line.split())
roots = [-1]*n
linked = [0]*n
def find_root(x):
    if roots[x] < 0:
        return x
    else:
        roots[x] = find_root(roots[x])
        return roots[x]
def unite(x, y):
    x = find_root(x)
    y = find_root(y)
    if (x==y):
        return
    if roots[x] > roots[y]:
        c, d = y,x
        x,y = c,d
    roots[x] += roots[y]
    roots[y] = x

for i in range(m):
    line = sys.stdin.readline().strip()
    a,b = map(int, line.split())
    c, d = a-1,b-1
    linked[c] += 1 
    linked[d] += 1
    unite(c,d)
#print(roots)
blacks = [[]for i in range(n)]
for i in range(k):
    line = sys.stdin.readline().strip()
    a,b = map(int, line.split())
    c,d = a-1, b-1
    blacks[c].append(d)
    blacks[d].append(c)
res = []
for i in range(n):
    r = -roots[find_root(i)] - 1 - linked[i]
    for one in blacks[i]:
        if find_root(one) == find_root(i):
            r -= 1
    res.append(r)
    
print (" ".join(map(str, res)))
n = int(raw_input())
if n < 10:
    print(n)
elif n >= 10 and n < 100:
    print(9)
elif n >=100 and n < 1000:
    print((n-100) + 10)
elif n >=1000 and n < 10000:
    print(909)
elif n >= 10000 and n < 100000:
    print((n-10000) + 910)
elif n == 100000:
    print(90909)

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if (c-(a-b)) > 0:
    print(c-(a-b))
else:
    print(0)
N = int(input())
lis = []
for n in range(N):
    com = input().split()
    if com[0] == "insert":
        lis.insert(0,int(com[1]))
    elif com[0] == "delete":
        lis.remove(int(com[1]))
    elif com[0] == "deleteFirst":
        del lis[0]
    else:
        lis.pop()
print(*lis)
    
    



### FIXED CODE ###

from collections import deque
N = int(input())
de = deque()
for n in range(N):
    com = input().split()
    if com[0] == "insert":
        de.appendleft(com[1])
    elif com[0] == "delete":
        try:
            de.remove(com[1])
        except:
            pass
    elif com[0] == "deleteFirst":
        de.popleft()
    else:
        de.pop()
print(*de)
from sys import stdin

N, M, *A = map(int, stdin.read().split())
req = {1: 2,
       2: 5,
       3: 5,
       4: 4,
       5: 5,
       6: 6,
       7: 3,
       8: 7,
       9: 6}

num = sorted([(a, req[a]) for a in A], key=lambda x: x[1])
k_min, n_min = num[0]
gt = sorted([(k, n-n_min) for k, n in num[1:] if k > k_min],
            key=lambda x: x[0], reverse=True)
lt = sorted([(k, n-n_min) for k, n in num[1:] if k < k_min],
            key=lambda x: x[0])
order = N // n_min
sum_rem = N - n_min*order

lst = []
for k, n in gt:
    m = sum_rem // n
    lst.extend([k]*m)
    sum_rem -= n*m
for k, n in lt:
    m = sum_rem // n
    lst.extend([k]*m)
    sum_rem -= n*m
lst.extend([k_min]*(order-len(lst)))


print(''.join(map(str, sorted(lst, reverse=True))))

### FIXED CODE ###

from sys import stdin

N, M, *A = map(int, stdin.read().split())
req = {1: 2,
       2: 5,
       3: 5,
       4: 4,
       5: 5,
       6: 6,
       7: 3,
       8: 7,
       9: 6}

B = sorted([(a, req[a]) for a in A], key=lambda x: x[0], reverse=True)
a_min, n_min = min(B, key=lambda x: x[1])
g = [(a, n-n_min) for a, n in B if a > a_min and n > n_min]
l = [(a, n-n_min) for a, n in B if a < a_min and n > n_min]
l.sort(key=lambda x: x[1], reverse=True)
C = g + l

def dp(rem, C):
    ret = None
    if rem == 0:
        ret = []
    elif rem > 0:
        for i in range(len(C)):
            a, m = C[i]
            nxt = dp(rem-m, C[i:])
            if nxt is not None:
                ret = [a] + nxt
                break
    return ret


i = 0
while True:
    quo = N // n_min - i
    rem = N % n_min + i * n_min
    lst = dp(rem, C)
    if lst is not None:
        lst = sorted(lst + [a_min] * (quo-len(lst)), reverse=True)
        print(''.join(map(str, lst)))
        break
    i += 1
n = int(input())
num_list=list(map(int,input().split()))
ans = 1
for i in n:
  ans = ans*num_list[i]
if ans <1000000000000000000:
  print(ans)
else:
  print("-1")

### FIXED CODE ###

n = int(input())
num_list=list(map(int,input().split()))
ans = 1
flg = True
if 0 in num_list:
  print("0")
else:
  for i in range(n):
    ans = ans*num_list[i]
  
    if ans > 10**18:
      print("-1")
      flg = False
      break
  if flg:
    print(ans)
n, T = map(int, input().split())
out = list()
for _ in range(n):
    c, t = map(int, input().split())
    if t > T: continue
    out.append((c, t))
print(min(out)[0]) if min(out)[0] < T else print("TLE")

### FIXED CODE ###

def LimitedTime(Array , T , N):
    MinC=1001
    for i in range (N):
            if Array[i][1]<=T:
               if Array[i][0]<MinC:
                   MinC=Array[i][0]
    if MinC==1001:
        return 'TLE'
    else:
        return MinC
                
                
                   
                   



TandN=list(map(int ,input().split()))
N=TandN[0]
T=TandN[1]
Array=[[int(j) for j in input().split()]for i in range(N)]
print(LimitedTime(Array , T ,N))
a = raw_input()
b = raw_input()
a = input(a)
b = input(b)
print a*b 2*a+2*b

### FIXED CODE ###

a, b = map(int, raw_input(). split())
print a * b, 2 * (a + b)
n,a=int(input()),list(map(int,input().split()));c=[0,0,0];x=[1.0/i for i in range(1,n+1)];dp=[[[-1]*(c[2]+2) for i in range(c[1]+c[2]+2)]for i in range(n+2)]
for i in a:c[i-1]+=1
for k in range(c[2]+1):
  for j in range(c[2]+c[1]-k+1):
    for i in range(n-k-j+1):
      if i+j+k>0:dp[i][j][k]=((dp[i-1][j][k]*i if i else 0)+(dp[i+1][j-1][k]*j if j else 0)+(dp[i][j+1][k-1]*k if k else 0)+n)*x[i+j+k-1]
print(dp[c[0]][c[1]][c[2]]+1)

### FIXED CODE ###

n,a=int(input()),map(int,input().split());c=[0]*3
for i in a:c[i-1]+=1
x,y,z=c;dp=[[[None]*(z+2) for i in range(n-x+2)]for i in range(n+2)];dp[0][0][0]=0
for k in range(z+1):
  for j in range(n-x-k+1):
    for i in range(n-k-j+1):
      if i+j+k:dp[i][j][k]=((dp[i-1][j][k]*i if i else 0)+(dp[i+1][j-1][k]*j if j else 0)+(dp[i][j+1][k-1]*k if k else 0)+n)/(i+j+k)
print(dp[x][y][z])
import math
N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = [-1]
b.extend(a)
b.extend([N+1])
ans = 1
import sympy as sym
def fibo(n):
    if n < 1:
        return 0
    else:
        x = sym.symbols('x',nonnegative=True,integer=True)
        Fib=1/sym.sqrt(5)*(((1+sym.sqrt(5))/2)**(n-1)-((1-sym.sqrt(5))/2)**(n-1))
        result=Fib.subs(x,n)
        result=sym.simplify(result) #式の整理
        return result

for i in range(M+1):
    dan = b[i+1]-1 - b[i]
    ans = ans*fibo(dan)%1000000007
print(ans)

### FIXED CODE ###

import math
N, M = map(int,input().split())
a = [int(input()) for i in range(M)]
b = [-1]+ a+ [N+1]
fib = [0,1]
for i in range(10**5):
    fib.append((fib[-1]+fib[-2])%1000000007)
ans = 1
for i in range(len(b)-1):
    ans= (ans*fib[b[i+1]-b[i]-1])%1000000007
print(ans)
from collections import Counter
n = int(input())
word_l = list()
for _ in range(n):
  word = ''.join(sort(list(input())))
  word_l.append(word)
  
word_counter = Counter(word_l)
print('{}'.format(sum(word_counter.values()) - n)


### FIXED CODE ###

from collections import Counter
n = int(input())
word_l = list()
for _ in range(n):
  word = ''.join(sorted(list(input())))
  word_l.append(word)
  
word_counter = Counter(word_l)
print('{}'.format(sum(map(lambda x: sum(range(x)), word_counter.values()))))
P, Q, R = int(input('P:')), int(input('Q:')), int(input('R:'))
print(P, Q, R)
print(min(P+Q, Q+R, R+P))

### FIXED CODE ###

P, Q, R =map(int ,input().split())
print(min(P+Q, Q+R, R+P))
n = int(input())
s = str(input())
if (s[:n/2] = s[n/2:]):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

N = int(input())
S = input()
print("Yes" if S[:N//2] == S[N//2:] else "No")
S = input()
sum01 = 0
sum10 = 0

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == '1':
      sum01 += 1
  if (i % 2) == 1:
    if S[i:i+1] == '0':
      sum01 += 1

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i+:i+1] == '0':
      sum10 += 1
  if (i % 2) == 1:
    if S[i:i+1] == '1':
      sum10 += 1
        
if sum01 > sum10:
  print(sum10)
else:
  print(sum01)


### FIXED CODE ###

S = input()
sumi = 0
sumii = 0

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == "1":
      sumi += 1
  if (i % 2) == 1:
    if S[i:i+1] == "0":
      sumi += 1

for i in range(len(S)):
  if (i % 2) == 0:
    if S[i:i+1] == "0":
      sumii += 1
  if (i % 2) == 1:
    if S[i:i+1] == "1":
      sumii += 1
        
if sumi > sumii:
  print(sumii)
else:
  print(sumi)
#coding:utf-8

# n, k = 5, 3
# ls = [-30,-10,10,20,50]

# n,k = 3,2
# ls=[10,20,30]

# n,k = 1,1
# ls = [0]

#n,k=8,5
#ls=[-9,-7,-4,-3,1,2,3,4]

first = -1
for i,point in enumerate(ls):
    if point >= 0:
        first = i
        break
size=k+1
ans = []
for i in range(size):
    if first-size+i+1>=0 and first+i-1< len(ls):
        temp = [0,ls[first-size+i+1],ls[first+i-1]]
        temp = [abs(min(temp)),abs(max(temp))]
        ans.append((2*min(temp)+max(temp)))
print (min(ans))


### FIXED CODE ###

#coding:utf-8
import numpy as np
n,k = map(int,input().split())
ls = list(map(int,input().split()))

# n, k = 5, 3
# ls = [-30,-10,10,20,50]
#
# n,k = 3,2
# ls=[10,20,30]

# n,k = 1,1
# ls = [0]

# n,k=8,5
# ls=[-9,-7,-4,-3,1,2,3,4]
if not (0 in ls):
    ls.append(0)
    k+=1
#print (ls)

ls = np.array(ls)
ls.sort()
#print (ls)

idx = np.where(ls==0)[0][0]
#print (idx,k)
#print (idx+k)
start = max(0,idx-k)
goal = min(idx+k,len(ls)-1)

#print (start,goal)
answer = []
for i in range(goal-(k-1)+1):
    #print (i,i+k-1)
    mi = min(abs(ls[i]),abs(ls[i+k-1]))
    ma = max(abs(ls[i]),abs(ls[i+k-1]))
    #print (mi,ma)
    answer.append(2*mi+ma)
print (min(answer))
# def set_max(ls):
#     if len(ls)>0:
#         return set([max(ls)])
#     else:
#         return set()
# def set_min(ls):
#     if len(ls)>0:
#         return set([min(ls)])
#     else:
#         return set()
#
#
# plus = list(filter(lambda n:n>=0, ls))
# minus = list(filter(lambda n:n<=0, ls))
#
# neighbor = set_max(minus) | set_min(plus)
#
# #print (neighbor)
# answer = []
# cnt = 0
# for i in range(n-k+1):
#     if len(set(ls[i:i+k])&neighbor)>0:
#
#         #print (ls[i:i+k])
#         #print (np.sign(ls[i]*ls[i+k-1]))
#         temp = [abs(ls[i]),abs(ls[i+k-1])]
#         if np.sign(ls[i]*ls[i+k-1])<0:
#
#             answer.append(2*min(temp)+max(temp))
#         else:
#             answer.append(max(temp))
#         cnt += 1
#         if cnt == k + 1:
#             break
# print (min(answer))

# first = -1
# for i,point in enumerate(ls):
#     if point >= 0:
#         first = i
#         break
# size=k+1
# ans = []
# for i in range(size):
#     if first-size+i+1>=0 and first+i-1< len(ls):
#         temp = [0,ls[first-size+i+1],ls[first+i-1]]
#         temp = [abs(min(temp)),abs(max(temp))]
#         ans.append((2*min(temp)+max(temp)))
# print (min(ans))
A, B, C = map(int, input.split())
if A+B >= C:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

A, B, C = map(int, input().split())
if A+B >= C:
  print("Yes")
else:
  print("No")
y,m,d = int(input().split("/"))

print(2018+"/"+m+"/"+d)

### FIXED CODE ###

s = input()
print(s.replace('2017','2018'))
import math
a, b, x = map(int, input().split())
if a*a*b == x:
    print(0)
    exit()
if x <= (a*a*b)/2:
    n = (2*x)/(a*b)
    s = (n**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
elif 
    n = (2*x) / (a**2) - b
    a = (a*n) / (b-n) + a
    s = (a**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))

### FIXED CODE ###

import math
a, b, x = map(int, input().split())
if a*a*b == x:
    print(0)
    exit()
if x <= (a*a*b)/2:
    n = (2*x)/(a*b)
    s = (n**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
else: 
    n = (2*x) / (a**2) - b
    a = (a*n) / (b-n) + a
    s = (a**2 + b**2)**0.5
    print(math.degrees(math.asin(b/s)))
import sympy as sym

A = sym.sequence(N*(N+1)/2,(n, 1, 100))
print([int(N) for in A])


### FIXED CODE ###

N = int(input())

print(int(N*(N+1)/2))
#!/usr/bin/env python
from typing import List, Dict


def get_all_values(N: int, v: int) -> List[int]:
    all_values = []

    current = v
    while current < N:
        all_values.append(current)
        current *= v

    return all_values


def get_min_number(memo: Dict[int, int], all_values: List[int], N: int) -> int:
    if N in memo:
        return memo[N]

    if N in all_values:
        return 1
    elif N < 6:
        return N
    else:
        min_number: int = min(
            [get_min_number(memo, all_values, N - v) + 1 for v in all_values if N - v >= 0]
        )
        memo[N] = min_number
        return min_number


def solve(N: int) -> int:
    # Get all values and sort in descent order
    all_values: List[int] = [1] + get_all_values(N, 6) + get_all_values(N, 9)
    sorted_all_values: List[int] = list(reversed(sorted(all_values)))

    # Recursively get minimum number
    memo: Dict[int, int] = {}
    ans = get_min_number(memo, sorted_all_values, N)

    return ans


def main():
    # Input
    N = int(input())

    # Solve
    ans = solve(N)

    # Answer
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python


def get_all_values(N, v):
    all_values = []

    current = v
    while current <= N:
        all_values.append(current)
        current *= v

    return all_values


def get_min_number(memo, all_values, N):
    if N in memo:
        return memo[N]

    if N in all_values:
        return 1
    elif N < 6:
        return N
    else:
        min_number = min(
            [get_min_number(memo, all_values, N - v) + 1 for v in all_values if N - v > 0]
        )
        memo[N] = min_number
        return min_number


def solve(N):
    # Get all values and sort in descent order
    all_values = [1] + get_all_values(N, 6) + get_all_values(N, 9)
    sorted_all_values = list(reversed(sorted(all_values)))

    # Recursively get minimum number
    memo = {}
    ans = get_min_number(memo, sorted_all_values, N)

    return ans


def main():
    # Input
    N = int(input())

    # Solve
    ans = solve(N)

    # Answer
    print(ans)


if __name__ == "__main__":
    main()