Harryxun/stf_run huggingface dataset:
x ** 3

### FIXED CODE ###

x = int(raw_input())
print x ** 3
import random

D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in range(D)]

plus=0
minus=0
data=[[1 for i in range(D)] for j in range(26)]
ans=[0]*D
for i in range(D):
    t=(i+1)%D+1
    ans[i]=t
    plus+=s[i][t-1]
    if i!=0:
        for j in range(26):
            data[j][i]=data[j][i-1]+1
    data[t-1][i]=0
    minus+=sum(c[j]*data[j][i] for j in range(26))

eval=plus-minus
count=2000000
check=[]
while count:
    d=random.randint(2,D)
    q=random.randint(1,26)
    if ans[d-1]==q:
        continue
    if c[ans[d-1]-1]*data[ans[d-1]-1][d-2]>c[q-1]*data[q-1][d-2] or s[d-1][q-1]>s[d-1][ans[d-1]-1]:
        testplus=plus+s[d-1][q-1]-s[d-1][ans[d-1]-1]
        testminus=minus
        pre=ans[d-1]
        #print("pre",pre)

        day=0
        for j in range(d-1,D):
            if data[q-1][j]!=0:
                if j==d-1:
                    testminus+=day*c[q-1]-data[q-1][d-1]*c[q-1]
                else:
                    testminus+=(day+1-data[q-1][j])*c[q-1]
                    day+=1
            else:
                break

        day=0
        for j in range(d-1,D):
            if j==d-1:
                if j==0:
                    day=1
                    testminus+=c[pre-1]*day
                else:
                    day=1+data[pre-1][j-1]
                    testminus+=c[pre-1]*day
            elif data[pre-1][j]!=0:
                testminus+=(day+1-data[pre-1][j])*c[pre-1]
                day+=1
            else:
                break

        if testplus-testminus>eval:
            eval=testplus-testminus
            plus=testplus
            minus=testminus
            ans[d-1]=q
            for j in range(d-1,D):
                if data[q-1][j]!=0:
                    if j==d-1:
                        data[q-1][d-1]=0
                    else:
                        data[q-1][j]=data[q-1][j-1]+1
                else:
                    break

            for j in range(d-1,D):
                if j==d-1:
                    if j==0:
                        data[pre-1][j]=1
                    else:
                        data[pre-1][j]=1+data[pre-1][j-1]
                elif data[pre-1][j]!=0:
                    data[pre-1][j]=data[pre-1][j-1]+1
                else:
                    break
    else:
        continue

    count-=1
#print(eval)
for i in range(D):
    print(ans[i])


### FIXED CODE ###

import random

D=int(input())
c=list(map(int,input().split()))
s=[list(map(int,input().split())) for i in range(D)]

ans=[random.randint(1,26) for i in range(D)]
res=0
for i in range(D):
    res+=s[i][ans[i]-1]

last=[0]*26
for i in range(D):
    last[ans[i]-1]=i+1
    minus=sum(c[j]*(i+1-last[j]) for j in range(26))
    res-=minus

for i in range(D):
    print(ans[i])
inputs = []
while 1:
  tmp = input()
  if tmp:
    inputs.append(tmp)
  else:
    break
k = inputs.pop(5)
if inputs[-1] - inputs[0] > k:
  print('Yay!')
else:
  print(':(')

### FIXED CODE ###

a,b,c,d,e,k=int(input()),int(input()),int(input()),int(input()),int(input()),int(input())
if e-a > k:
  print(':(')
else:
  print('Yay!')
class unionfind():
    def __init__(self,n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rnk = [0]*(n+1)
    def find_root(self,x):
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]
    def unite(self,x,y):
        x = self.find_root(x)
        y = self.find_root(y)
        if x == y:
            return
        elif self.rnk[x] > self.rnk[y]:
            self.root[x] += self.rnk[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rnk[x] == self.rnk[y]:
                self.rnk[y] += 1
    def same(self,x,y):
        return self.find_root(x) == self.find_root(y)
    def count(self,x):
        return -self.root[self.find_root(x)]
n,m = map(int,input().split())
l = unionfind(n+1)
ans = []
a = n*(n-1)//2
l0 = []
for i in range(m):
    ab = list(map(int,input().split()))
    l0.append(ab)
l0.reverse()
for i in range(m):
    ans.append(a)
    if not l.same(l0[i][0],l0[i][1]):
        a -= l.count(l0[i][0])*l.count(l0[i][1])
    l.unite(l0[i][0],l0[i][1])
ans.reverse()
for i in range(m):
    print(ans[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5)
def find(parent,i):
    t = parent[i]
    if t < 0:
        return i
    t = find(parent,t)
    parent[i] = t
    return t
def unite(parent,i,j):
    i = find(parent,i)
    j = find(parent,j)
    if i == j:
        return
    parent[j] += parent[i]
    parent[i] = j
n,m = map(int,input().split())
parent = [-1] * n
ans = n*(n-1)//2
ansl = []
l0 = []
for i in range(m):
    ab = list(map(int,input().split()))
    ab[0] -= 1
    ab[1] -= 1
    l0.append(ab)
l0.reverse()
for i in range(m):
    ansl.append(ans)
    a,b = l0[i]
    if find(parent,a) != find(parent,b):
        ans -= parent[find(parent,a)] * parent[find(parent,b)]
    unite(parent,a,b)
ansl.reverse()
for i in range(m):
    print(ansl[i])
def Test(n,k):
    if n > 2 * k:
        res = "YES"
    else:
        count = 0
        res = "NO"
        for i in range(1,n + 1,2):
            count += 1
            if count == k:
                res = "YES"
    print(res)
    
if __name__ == '__main__':
    _N = input()
    _K = input()
    try:
        N = int(_N)
        K = int(_K)
        Test(N,K)
    except:
        print("Error")

### FIXED CODE ###

def Test(n,k):
    if n > 2 * k:
        res = "YES"
    else:
        count = 0
        res = "NO"
        for i in range(1,n + 1,2):
            count += 1
            if count == k:
                res = "YES"
    print(res)
    
if __name__ == '__main__':
    N,K = map(int,input().split())
    try:
        Test(N,K)
    except:
        print("Error")
import sys
input = sys.stdin.readline
n = int(input())
s = str(input())
r = []
g = []
b = []
ra = r.append
ga = g.append
ba = b.append
for i in range(n):
  if s[i] == "R":
    ra(i)
  elif s[i] == "G":
    ga(i)
  else:
    ba(i)
c = len(r)*len(g)*len(b)
for ri in r:
  for gi in g:
    for bi in b:
      if 3*(max(ri,gi,bi)+min(ri,gi,bi)) == 2*(ri+gi+bi):
        c -= 1
print(c)

### FIXED CODE ###

n,k = map(int,input().split())
x = [0]*k
mod = 10**9+7
def power(a,n):
  ans = 1
  while n:
    if n%2:
      ans = (ans*a)%mod
    a = (a*a)%mod
    n >>= 1
  return ans%mod  
for i in range(k,0,-1):
  c = power(k//i,n)
  j = 2
  while i*j <= k:
    c -= x[i*j-1]
    j += 1
  x[i-1] = c
s = 0
for i in range(1,k+1):
  s = (s + i*x[i-1])%mod
print(s)
class Unionfind():  # Unionfind
    def __init__(self, N):
        self.N = N
        self.parents = [-1] * N

    def find(self, x):  # グループの根
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):  # グループの併合
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def all_group_members(self):  # グループごとの辞書
        members_dict = {i: set([i])
                        for i, x in enumerate(self.parents) if x < 0}
        for i, x in enumerate(self.parents):
            members_dict[self.find(x)].add(i)
        return members_dict


n, m = map(int, input().split())
p = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

uf = Unionfind(n)
for x, y in xy:
    uf.union(x - 1, y - 1)

ans = 0
for lst in uf.all_group_members().values():
    ans += sum((p[num] - 1 in lst) for num in lst)
print(ans)


### FIXED CODE ###

class Unionfind():  # Unionfind
    def __init__(self, N):
        self.N = N
        self.parents = [-1] * N

    def find(self, x):  # グループの根
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):  # グループの併合
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def all_group_members(self):  # グループごとの辞書
        members_dict = {i: set([i]) for i, x in enumerate(self.parents) if x < 0}
        for i, x in enumerate(self.parents):
            if x >= 0:
                members_dict[self.find(x)].add(i)
        return members_dict


n, m = map(int, input().split())
p = list(map(int, input().split()))
xy = [list(map(int, input().split())) for _ in range(m)]

uf = Unionfind(n)
for x, y in xy:
    uf.union(x - 1, y - 1)

ans = 0
for lst in uf.all_group_members().values():
    ans += sum((p[num] - 1 in lst) for num in lst)
print(ans)
S = input()
 
if (S[2] = S[3] and S[4] = S[5]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
 
if (S[2] == S[3] and S[4] == S[5]):
  print("Yes")
else:
  print("No")
from math import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
print(L, R)
for n in range(1, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)


### FIXED CODE ###

from fractions import gcd
N = int(input())
A = [int(s) for s in input().split()]
ans = 0
L = [0] * (N)
R = [0] * (N)
for n in range(0, N):
    if n != N-1:
        L[n+1] = gcd(A[n], L[n])
        R[-(n+2)] = gcd(A[-(n+1)], R[-(n+1)])
for n in range(0, N):
    temp = gcd(L[n], R[n])
    ans = max(temp, ans)
print(ans)
import numpy as np
N,K=map(int,input().split())
A=list(map(int,input().split()))
def B(i):
  if i==0:
    return 1
  return A[B(i-1)-1]
C=[1]
for i in range(1,N+1):
  if C.count(B(i))==0:
    C.append(B(i))
  else:
    l=C.index(B(i))
    break
if K<=l:
  print(C[K])
else:
  print(C[l+(K+1-l)%(len(C)-l)-1])

### FIXED CODE ###

import numpy as np
N,K=map(int,input().split())
A=list(map(int,input().split()))
C=[1]
s=set([1])
for i in range(N):
  if A[C[i]-1] in s:
    l=C.index(A[C[i]-1])+1
    break
  else:
    C.append(A[C[i]-1])
    s.add(A[C[i]-1])
if K+1<=l:
  print(C[K])
else:
  print(C[l-1+(K+1-l)%(len(C)-l+1)])
def gcd(x,y):
   tmp = x
    x = x if x >= y else y
    if tmp != x:
        y = tmp
    if y == 0:
        return x
    return gcd(x%y, y)
    
A,B =  [int(x) for x in input().split(" ")]
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(A,B))




### FIXED CODE ###

def gcd(x,y):
    tmp = x
    x = x if x >= y else y
    if tmp != x:
        y = tmp
    if y == 0:
        return x
    return gcd(x%y, y)

A,B =  [int(x) for x in input().split(" ")]
def lcm(x, y):
    return (x * y) // gcd(x, y)
print(lcm(A,B))
N = int(input())
A = [0 for i in range(5)]
for i in range(5):
    A[i] = int(input())

if N % min(A) != 0:
    print(N // min(A) + 5)
else
    print(N // min(A) + 4)

### FIXED CODE ###

N = int(input())
A = [0 for i in range(5)]
for i in range(5):
    A[i] = int(input())

if N % min(A) != 0:
    print(N // min(A) + 5)
else:
    print(N // min(A) + 4)
print(input()[0]+input()[0]+input()[0])

### FIXED CODE ###

print("A"+input()[8]+"C")
n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
c=0
l=[]
if m==1 and x.length()==1:
    print("0")
else:
    for i in range(m-1):
        l.append(abs(x[i]-x[i+1]))
    l.sort()
    if range(len(l)-n+1)<=0:
        print("0")
    else:
        for i in range(len(l)-n+1):
            c+=l[i]
        print(c)

### FIXED CODE ###

n,m=map(int,input().split())
x=list(map(int,input().split()))
x.sort()
c=0
l=[]
for i in range(m-1):
    l.append(abs(x[i]-x[i+1]))
l.sort()
if len(l)-n+1<=0:
    print("0")
else:
    for i in range(len(l)-n+1):
        c+=l[i]
    print(c)
seep, wolf = map(int, input().rstrip())

if seep > wolf:
  print('safe')
else:
  print('unsafe')

### FIXED CODE ###

seep, wolf = map(int, input().rstrip().split())
 
if seep > wolf:
  print('safe')
else:
  print('unsafe')
s=input();l=len(s)//2-1;c=0
if len(s)==1:
  print(0)
else
  for i in range(l):
    if s[i]!=s[-i-1]:
      c+=1
  print(c)

### FIXED CODE ###

s=input();l=len(s)//2;c=0
for i in range(l):
  if s[i]!=s[-i-1]:
    c+=1
print(c)
#!/bin/python3

a, b = input().split(" ")

if a % 2 == b % 2:
    print((a + b) / 2)
else:
    print("IMPOSSIBLE")


### FIXED CODE ###

# -*- coding: utf-8 -*-

a, b = map(int, input().split(" "))
if a % 2 == b % 2:
    print(int((a + b) / 2))
else:
    print("IMPOSSIBLE")
a=int(input())

alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','z']
if a<27:
 print(alp[a-1])
else:
 b=a//26

 c=a%26
 ans=""
 if b==1:
    ans+='a'
 for i in range(1,17):
  if b/(10**(i))>1:
    d=int(b/(10**(i)))
    ans+=alp[d-1]
  else:
    break
 ans+=alp[c-1]

 print(ans)



### FIXED CODE ###

alp=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
n=int(input())
ans=""
while n>0:
 n-=1
 a=n%26
 ans+=alp[a] 
 n=int(n//26)
 
print(ans[::-1])
def insertionSort( nums, n, g ):
	global cnt
	i = g
	while i < n:
		v = nums[i]
		j = i - g
		while 0 <= j and v < nums[j]:
			nums[ j+g ] = nums[j]
			j -= g
			cnt += 1
		nums[ j+g ] = v
		i += 1
		
def shellSort( nums, n ):
	global cnt
	g = []
	val =0
	for i in range( 0, n ):
		val = 3*val+1
		if  n < val:
			break
		g.append( val )
	
	g.reverse( )
	m = len( g )
	print( m )
	print( " ".join( map( str, g ) ) )
	for i in range( 0, m ):
		insertionSort( nums, n, g[i] )
    
n = int( input( ) )
nums = []
for i in range( 0, n ):
	nums.append( int( input( ) ) )

cnt = 0
shellSort( nums, n )
print( cnt )
print( "\n".join( map( str, nums ) ) )

### FIXED CODE ###

import sys
 
def insertionSort( nums, n, g ):
    cnt = 0
    i = g
    while i < n:
        v = nums[i]
        j = i - g
        while 0 <= j and v < nums[j]:
            nums[ j+g ] = nums[j]
            j -= g
            cnt += 1
        nums[ j+g ] = v
        i += 1
    return cnt
         
def shellSort( nums, n ):
    g = []
    val = 1
    while val <= n:
        g.append( val )
        val = 3*val+1
     
    g.reverse( )
    m = len( g )
    print( m )
    print( " ".join( map( str, g ) ) )
    cnt = 0
    for i in range( m ):
        cnt += insertionSort( nums, n, g[i] )
    print( cnt )
     
n = int( sys.stdin.readline( ) )
nums = []
for i in range( n ):
    nums.append( int( sys.stdin.readline( ) ) )
 
shellSort( nums, n )
print( "\n".join( map( str, nums ) ) )
N,K = map(int, input().split())
A = []
ruiseki = [0]
for i in range(N):
    a,b = map(int, input().split())
    A.append(a)
    ruiseki.append(ruiseki[i]+b)
K = ruiseki[-1]-K+1
for i in range(1,N+1):
    if K >= ruiseki[i]:
        n = i
        break
print(A[n+1])

### FIXED CODE ###

N,K = map(int, input().split())
A = []
for i in range(N):
    a,b = map(int, input().split())
    A.append((a,b))
A.sort()
for i in range(N):
    K -= A[i][1]
    if K <= 0:
        print(A[i][0])
        exit()
from collections import defaultdict, deque

N, K = map(int, input().split())
d = defaultdict(list)
MOD = 10**9+7

for _ in range(N-1):
    a, b = map(int, input().split())
    d[a].append(b)
    d[b].append(a)

ans = K
used = [0]*(N+1)
used[1] = True
q = deque([1])

while q:
    a = q.popleft()
    s = 1 if a==1 else 2
    for b in d[a]:
        if used[b]:continue
        used[b] = True
        ans *= (K-s)
        s += 1
        q.append(b)
	ans %= MOD

print(ans%MOD)


### FIXED CODE ###

from collections import defaultdict
v = defaultdict(list)
mod = 10**9+7

N, K = map(int, input().split())
for _ in range(N-1):
    a, b = map(int, input().split())
    v[a].append(b)
    v[b].append(a)

visited = [False]*(N+1)
ans = 1

q = [(1, 0, 0)]
while q:
    pos, parent, score = q.pop()
    visited[pos] = True
    ans *= (K-score)
    ans %= mod 
   
    a = 1 if pos==1 else 2
    b = 0

    for i in v[pos]:
        if visited[i]:continue
        q.append((i, pos, a+b))
        b += 1

print(ans)
n=int(input())
L=[int(input()) for i in range(n)]
print(len(set(A)))

### FIXED CODE ###

n=int(input())
L=[int(input()) for i in range(n)]
print(len(set(L)))
List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag = True):
    output += amari
print(output)

### FIXED CODE ###

List= [int(input()) for i in range(5)]
amari =9
time = 0
flag = False;
for i in List:
    if(i%10 != 0):
        time += 10 - i%10
        amari = min(amari,i%10)
        flag = True
output = sum(List) + time
if(flag):
    output -= 10 - amari
print(output)
s = input()
x,y = map(int,input().split())
#%%
mx = []
my = []
mx2 = []
my2 = []


cnt = 0
it = 0
for t in s:
    if t == 'T':
        if cnt:
            if it%2==0:
                mx.append(cnt)
                mx2.append(cnt*2)
            else:
                my.append(cnt)
                my2.append(cnt*2)
        it += 1
        cnt = 0
    else:
        cnt += 1
    
if it%2==0:
    mx.append(cnt)
    mx2.append(cnt*2)
else:
    my.append(cnt)
    my2.append(cnt*2)
    
        
dx = sum(mx)-x
dy = sum(my)-y

MAX = len(s)

# dp[i+1][j] : i個目までの要素の和でjを作れるか？

dpx = [[False]*MAX for _ in range(len(mx2)+1)]
dpy = [[False]*MAX for _ in range(len(my2)+1)]

dpx[0][0] = True
dpy[0][0] = True

for i in range(len(mx2)):
    for j in range(MAX):
        if j<mx2[i]:
            dpx[i+1][j] = dpx[i][j]
        else:
            dpx[i+1][j] = dpx[i][j-mx2[i]] or dpx[i][j]

for i in range(len(my2)):
    for j in range(MAX):
        if j<my2[i]:
            dpy[i+1][j] = dpy[i][j]
        else:
            dpy[i+1][j] = dpy[i][j-my2[i]] or dpy[i][j]


if dpx[len(mx2)][dx] and dpy[len(my2)][dy]:
    print('Yes')
else:
    print('No')
    









### FIXED CODE ###

s = input()
x,y = map(int,input().split())
#%%
mx = []
my = []
mx2 = []
my2 = []


cnt = 0
it = 0
firstFlag = (s[0]=='F')
for t in s:
    if t == 'T':
        
        
        if cnt:
            if it%2==0:
                mx.append(cnt)
                mx2.append(cnt*2)
            else:
                my.append(cnt)
                my2.append(cnt*2)
        it += 1
        cnt = 0
    else:
        cnt += 1
    
if it%2==0:
    mx.append(cnt)
    mx2.append(cnt*2)
else:
    my.append(cnt)
    my2.append(cnt*2)

if firstFlag:
    x -= mx[0]
    mx[0] = 0
    mx2[0] = 0
        
dx = sum(mx)-x
dy = sum(my)-y


# dp[i+1][j] : i個目までの要素の和でjを作れるか？

MAX = max(sum(mx2),sum(my2)) + 10
dpx = [[False]*MAX for _ in range(len(mx2)+1)]
dpy = [[False]*MAX for _ in range(len(my2)+1)]

dpx[0][0] = True
dpy[0][0] = True

for i in range(len(mx2)):
    for j in range(MAX):
        if j<mx2[i]:
            dpx[i+1][j] = dpx[i][j]
        else:
            dpx[i+1][j] = dpx[i][j-mx2[i]] or dpx[i][j]

for i in range(len(my2)):
    for j in range(MAX):
        if j<my2[i]:
            dpy[i+1][j] = dpy[i][j]
        else:
            dpy[i+1][j] = dpy[i][j-my2[i]] or dpy[i][j]



if dx<0 or dy<0:
    print('No')

elif dx>sum(mx2) or dy>sum(my2):
    print('No')

else:
    if dpx[len(mx2)][dx] and dpy[len(my2)][dy]:
        print('Yes')
    else:
        print('No')
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
cst = 1
keep = xy[0]
xy.sort(key = lambda x:x[0])
p = xy[1][0]-xy[0][0]
q = xy[1][1]-xy[0][1]
for i in range(1,N-1):
    if not(xy[i][0] == keep[0]+p and xy[i][1] == keep[1]+q):
        cst += 1
        p = xy[i+1][0] - xy[i][0]
        q = xy[i+1][1] - xy[i][1]
        keep = xy[i+1]

print(cst)

### FIXED CODE ###

N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
x = [xy[i][0] for i in range(N)]
y = [xy[i][1] for i in range(N)]
if N == 1:
    print(1)
    exit()
else:
    ans = N
    for i in range(N):
        for j in range(N):
            if i == j:
                continue
            dx,dy = x[j]-x[i],y[j]-y[i]
            cnt = 0
            for k in range(N):
                for l in range(N):
                    if k == l:
                        continue
                    if dx == x[k]-x[l] and dy == y[k]-y[l]:
                        cnt += 1
            ans = min(ans,N-cnt)

print(ans)
from scipy.special import comb

n = int(input())
S = [input() for _ in range(n)]
S_sorted = ["".join(sorted(s)) for s in S]
S_sorted = sorted(S_sorted)

ans = 0
cnt = 1
for i in range(1, len(S_sorted)):
    if S_sorted[i] == S_sorted[i-1]:
        cnt += 1
    else:
        ans += comb(cnt, 2, exact=True)
        cnt = 1

if cnt > 1:
    ans += comb(cnt, 2, exact=True)

print(ans)






### FIXED CODE ###

def cmb(n, r):
    if n == 1: return 0
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n = int(input())
S = [input() for _ in range(n)]
S_sorted = ["".join(sorted(s)) for s in S]
S_sorted = sorted(S_sorted)

ans = 0
cnt = 1
for i in range(1, len(S_sorted)):
    if S_sorted[i] == S_sorted[i-1]:
        cnt += 1
    else:
        ans += cmb(cnt, 2)
        cnt = 1

if cnt > 1:
    ans += cmb(cnt, 2)

print(int(ans))
x = int
print(x**3)

### FIXED CODE ###

x = int(input())
print(x**3)
N = input().split()
X = int(N[0])
Y = int(N[1])

flag = False

if Y % 2 != 0:
    prunt("No")
    exit()

def memo(x, y):
    global flag
    if x == 0:
        if y == 0:
            flag = True
        return flag

    
    memo(x-1, y-2)
    memo(x-1, y-4)

memo(X, Y)

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



### FIXED CODE ###

N = input().split()
X = int(N[0])
Y = int(N[1])

flag = False

for i in range(X):
    if flag:
        break

    if (X-i)*2 + i*4 == Y:
        flag = True
    
    if (X-i)*4 + i*2 == Y:
        flag = True

if flag:
    print("Yes")
else:
    print("No")
n=input()
satis=[]

for i in range(n):
	satis.append(map(int,input().split()))

tempA=satis[0]
tempB=satis[1]
tempC=satis[2]
if n > 1:
  for i in range(n-1):
    tempA2=satis[3*i+3]+max([tempB,tempC])
    tempB2=satis[3*i+4]+max([tempA,tempC])
    tempC2=satis[3*i+5]+max([tempA,tempB])
    tempA=tempA2
    tempB=tempB2
    tempC=tempC2
  print(max([tempA,tempB,tempC]))
else:
  print(max([tempA,tempB,tempC]))

### FIXED CODE ###

n=int(input())
satis=[]

for i in range(n):
  A=list(map(int,input().split()))
  satis.extend(A)

tempA=satis[0]
tempB=satis[1]
tempC=satis[2]
if n > 1:
  for i in range(n-1):
    tempA2=satis[3*i+3]+max([tempB,tempC])
    tempB2=satis[3*i+4]+max([tempA,tempC])
    tempC2=satis[3*i+5]+max([tempA,tempB])
    tempA=tempA2
    tempB=tempB2
    tempC=tempC2
  print(max([tempA,tempB,tempC]))
else:
  print(max([tempA,tempB,tempC]))
s=print(int(input()))
n=0
while(s>0):
  n=n+1
  s=s-1
return(n)

### FIXED CODE ###

s=int(input())
n=0
while(s>0):
  n=n+s
  s=s-1
print(n)
O = list(input().split(" "))
E = list(input().split(" "))

ans = []
for i in range(O.len):
  ans.append(O[i])
  ans.append(E[i])

print("".join(ans))

### FIXED CODE ###

O = list(input())
E = list(input())

ans = []
for i in range(len(O)):
    ans.append(O[i])
    if len(E) > i:
        ans.append(E[i])
    else:
        break
print("".join(ans))
s = list(input())
ans = list("keyence")
x = 0

for c in s:
    if c == ans[x]:
        x += 1

if x >= 6:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

s = input()
n = len(s)
w = "keyence"
 
for i in range(7):
    if s[:i] == w[:i] and s[n-7+i:] == w[i:]:
        print("YES")
        exit()

print("NO")