Harryxun/stf_run huggingface dataset:
import sys
row = sys.stdin.readline
 
ls = list(row())
s = sum([1 for i in range(1, len(ls) + 1) if ls[i-1] == ls[i]])
print("Good" if s == len(ls) else "Bad")


### FIXED CODE ###

import sys
row = sys.stdin.readline
 
ls = list(row())
s = sum([1 for i in range(1, len(ls)) if ls[i-1] != ls[i]])
print("Good" if s+1 == len(ls) else "Bad")
n = int(input())
a = []
b = []
flag = 0
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for i in range(0, 101):
	if flag == 1:
		break
	for j in range(0,101):
		if flag == 1:
			break
		h = a[0][0] + abs(i - a[0][2]) + abs(j - a[0][1])
		for k in range(n):
			d = h - abs(i - a[k][2]) - abs(j - a[k][1])
			if (d >= 0 and d != a[k][0]) or (d < 0 and a[k][0] != 0):
				break
			if k == n - 1:
				b.append(i)
				b.append(j)
				b.append(h)
				flag = 1
print(b[0], b[1], b[2])

### FIXED CODE ###

n = int(input())
a = []
for i in range(n):
	a.append([int(n) for n in input().split()])
	a[i][0], a[i][2] = a[i][2], a[i][0]
a = sorted(a)
for x in range(101):
	for y in range(101):
		h = a[n - 1][0] + abs(x - a[n - 1][2]) + abs(y - a[n - 1][1])
		for k in range(n):
			d = h - abs(x - a[k][2]) - abs(y - a[k][1])
			if a[k][0] != max(d, 0):
				break
			if k == n - 1:
				print(x, y, h)
				exit()
i = 1
while True:
    case = input()
    print("Case "+str(i)+":"+case)
    if case == None: 
        print("Case "+str(i)+":"+case)
        break
    i += 1



### FIXED CODE ###

i = 1
while True:
    case = input()
    if case == "0": 
        break
    print("Case "+str(i)+": "+case)
    i += 1
N=input()

if N<2:
	print(0)

else:
	without=10*(N-2)
	considered=(without+2)*(without+1)
	print(considered)


### FIXED CODE ###

MOD=10**9+7
N=int(input())
 
all=pow(10,N,MOD)
sub9=pow(9,N,MOD)
sub8=pow(8,N,MOD)
print((all-2*sub9+sub8)%MOD)
a = map(int,input().split(" "))
if a==1:
    print("1")
elif a%2 == 0:
    print("0.5")
else:
    print("0.6")

### FIXED CODE ###

a = int(input())
if a%2 == 0:
    print(0.5)
else:
    b = (int(a/2)+1)/a
    print(b)
x, y,z = map(int, input().split()) 
test = x / z

if (test < y){
    print('Yes')
}else{
    print('No')
}

### FIXED CODE ###

x, y,z = map(int, input().split()) 
test = x / z

if (test <= y):
    print('Yes')
else:
    print('No')
n = input()
s =n.replace(2017,2018)
print(s)

### FIXED CODE ###

s = input()
print(s[:3]+'8'+s[4:])
while 1:
    x, y = map(int, raw_input().split())
    if x == 0 and y == 0:
       break
    elif y < x:
       print "%d %d" % (y,x)
    else:
       print "%d %d" % (x,y)
    

### FIXED CODE ###

while 1:
   x, y = map(int, raw_input().split())
   if x == 0 and y == 0:
      break
   elif x > y:
      print '%s %s' % (y,x)
   else:
      print '%s %s' % (x,y)
x,y = (map(int,input().split()))

if y%2 != 0:
    print('No')
elif 2*x <= y <= 4*x:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

x = list(map(int,input().split()))
for i in range(6):
    if i not in x:
        print(i)
        break
size = int(input())
array =  list(map(int, input().split()))
dp = [0]* size
for i in range(1,size):
	z= [1,2]
	for i in range(len(z)):
		dp[i] = min(dp[i-1] ,abs( array[i] - array[j] )])
print(dp[-1])
		

### FIXED CODE ###

size = int(input())
array =  list(map(int, input().split()))
dp = [0]* size
dp[1]=  dp[0] + abs(array[1] - array[0]) 
for i in range(2,size):
	dp[i] = min(
	dp[i-1] + abs(array[i] - array[i-1]),
	dp[i-2] + abs( array[i] - array[i-2] )
	)
print(dp[-1])
X = int(input())
Y = int(input())
Z = int(input())
X,Y,Z = Z,X,Y

### FIXED CODE ###

X,Y,Z = map(int,input().split())
X,Y = Y,X
X,Z = Z,X
print(X,Y,Z)
n = int(input())
x = input()
# print (int(x,2))
a = x.count('1')
# print (a)


for i in range(n):
  if x[i] == '0':
    b = '1'
    cnt = a + 1
  else:
    b = '0'
    cnt = a - 1
  d = x[:i] + b + x[i+1:]
  # print (d, int(d,2))
  v = int(d,2)
  out = 0
  # while v != 0:
  v %= cnt
  cnt = bin(v).count('1')
  if cnt == 0:
    out = 1
  elif cnt < 3:
    out = 2
  else:
    out = 3
  print (out)

### FIXED CODE ###

n = int(input())
x = input()
a = x.count('1')
b = int(x,2)
# print (b)

ary = [None for i in range(200010)]
ary[0] = 0

def f(n):
  if ary[n] is not None:
    return ary[n]
  b = bin(n).count('1')
  r = 1 + f(n%b)
  ary[n] = r
  return ary[n]


a1 = a + 1
a0 = a - 1
for i in range(200010):
  f(i)


one = [1] * 200010
zero = [1] * 200010
for i in range(1, 200010):
    if a0 != 0:
        one[i] = one[i-1] * 2 % a0
    zero[i] = zero[i-1] * 2 % a1


ans = [0 for i in range(n)]
c1 = b%a1
if a0 != 0:
  c0 = b%a0
for i in range(n-1, -1, -1):
  if x[n-1-i] == '0':
    y = c1 + zero[i]
    # y = x %a1
    y %= a1
    print (ary[y]+1)
  else:
    if a0 != 0:
      y = c0 - one[i]
      y %= a0
      print (ary[y]+1)
    else:
      print (0)
# ans.reverse()
# for i in ans:
#   print (i)
a,b,c=[int(x) for x in input().split()]
count= 0
for d in range(a,b+1):
 if c%d ==0 : count += 1
print(count)


### FIXED CODE ###

a,b,c=[int(x) for x in input().split()]
count = 0
for d in range(a,b+1):
    if c%d == 0 : count += 1
print(count)
from collections import deque
h,w=map(int,input().split())
s=[ input() for _ in range(h)]
dist=[ [float('inf') for _ in range(w)] for _ in range(h)]
#print(s)
#do a bfs 
dq=deque()
dist[0][0]=0
dq.append([0,0])
white=0
for i in s:
    white+=i.count('.')
#print(white)
while dq!=[]:
    xx,yy=dq.popleft()
    if xx==h-1 and yy==w-1:
        break
    for i,j in zip([-1,0,1,0], [0,1,0,-1]):
            x=xx+i
            y=yy+j
            def valid(x,y):
                if not(x>=0 and x<h and y>=0 and y<w):
                    return False
                if s[x][y]=='.':
                    return True
                else:
                    return False
            if valid(x,y):
                if dist[x][y]>dist[xx][yy]+1:
                    dist[x][y]=1+dist[xx][yy]
                    dq.append([x,y])
#print(dist[h-1][w-1])
if dist[h-1][w-1]!=float('inf'):
    print(white-1-dist[h-1][w-1])
else:
    print(-1)





### FIXED CODE ###

from collections import deque
h,w=map(int,input().split())
s=[ input() for _ in range(h)]
dist=[ [float('inf') for _ in range(w)] for _ in range(h)]
#print(s)
#do a bfs 
dq=deque()
dist[0][0]=0
dq.append([0,0])
white=0
for i in s:
    white+=i.count('.')
#print(white)
while len(dq)>0:
    xx,yy=dq.popleft()
    if xx==h-1 and yy==w-1:
        break
    for i,j in zip([-1,0,1,0], [0,1,0,-1]):
            x=xx+i
            y=yy+j
            def valid(x,y):
                if not(x>=0 and x<h and y>=0 and y<w) == True:
                    return False
                if s[x][y]=='.':
                    return True
                else:
                    return False
            if valid(x,y):
                if dist[x][y]>dist[xx][yy]+1:
                    dist[x][y]=1+dist[xx][yy]
                    dq.append([x,y])
#print(dist[h-1][w-1])
if dist[h-1][w-1]!=float('inf'):
    print(white-1-dist[h-1][w-1])
else:
    print(-1)
import sys
import os
import math


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = int(sys.stdin.buffer.readline().rstrip())
    A = list(map(int, sys.stdin.buffer.readline().split()))
    P = set(A)

    for n in range(N):
        ary = A[n + 1:] + A[:-len(A) + n]
        tmp = 0
        for p in P:
            t = ary.count(p)
            tmp += (t * (t - 1)) // 2

        print(tmp)



if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import os

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N, M = list(map(int, sys.stdin.buffer.readline().split()))
    even = (N * (N - 1)) // 2
    odd = 0 if M == 1 else (M * (M - 1)) // 2
    print(even + odd)


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

def readlines(n):
    for _ in range(n):
        a, b = map(int, input().split())
        yield a, b

def main():
    n, q = map(int, input().split())
    edges = [[] for _ in range(n+1)]

    for a, b in readlines(n-1):
        edges[a].append(b)
        edges[b].append(a)

    counter = [0] * (n+1)
    for q, x in readlines(q):
        counter[q] += x

    def dfs(u, prev):
        for v in edges[u]:
            if v == prev:
                continue
            counter[v] += counter[u]
            dfs(v, u)

    dfs(1, 0)

    print(" ".join(map(str, counter[1:])))

main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

def readlines(n):
    for _ in range(n):
        a, b = map(int, input().split())
        yield a, b

def main():
    n, q = map(int, input().split())
    edges = [[] for _ in range(n+1)]

    for a, b in readlines(n-1):
        edges[a].append(b)
        edges[b].append(a)

    counter = [0] * (n+1)
    for q, x in readlines(q):
        counter[q] += x

    def dfs(u, prev):
        for v in edges[u]:
            if v == prev:
                continue
            counter[v] += counter[u]
            dfs(v, u)

    dfs(1, 0)

    print(" ".join(map(str, counter[1:])))

main()
D = int(input())

if D==22:
    print "Christmas Eve Eve Eve Eve"

if D==23:
    print "Christmas Eve Eve"

if D==24:
    print "Christmas Eve"

if D==25:
    print "Christmas "


### FIXED CODE ###

D = int(input())

if D==22:
    print ("Christmas Eve Eve Eve")

if D==23:
    print ("Christmas Eve Eve")

if D==24:
    print ("Christmas Eve")

if D==25:
    print ("Christmas ")
s = input()
for i in range(len(s)):
  if s[i+1] != 'B':
    ans += s[i]
    
print(ans)

### FIXED CODE ###

s = input()
output_s = ""

for i in s:
  if i == "B" and len( output_s) != 0:
    output_s = output_s[0:len( output_s)-1]
  elif i != "B":
    output_s += i
  
print(output_s)
import math

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

if a*b/2 >= x/a :
  ax = 2*x/a/b
  print(math.degrees(math.atan(b/ax)))
else : 
  bx = 2*x/a/a - b
  print(90-math.degrees(math.atan(a/(b-bx))))

### FIXED CODE ###

import math

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

if a*a*b == x :
  print(0)
elif a*b/2 >= x/a :
  ax = 2*x/a/b
  print(math.degrees(math.atan(b/ax)))
else : 
  bx = 2*x/a/a - b
  print(90-math.degrees(math.atan(a/(b-bx))))
cards = []
mark = ["S","H","C","D"]
for i in (mark):
    for j in range(1,14):
        cards.append( i + " " + str(j) )
print(cards)
n = int(input())
for i in range(n+1):
    a = input()
    cards.remove(a)
print(a)

### FIXED CODE ###

cards = list()
mark = ["S","H","C","D"]
for i in (mark):
    for j in range(1,14):
        cards.append( i + " " + str(j) )
n = int(input())
for i in range(n):
    a = input()
    cards.remove(a)
if len(cards) > 0:
    print("\n" .join(cards))
l = [0,0,0,0,0,0,0,0,0]
n = int(input())
a = list(map(int,input().split()))

for i in range(len(a)):
    if 1 <=  a[i] <= 399:
        l[0] = l[0] + 1
    elif 400 <=  a[i] <= 799:
        l[1] = l[1] + 1
    elif 800 <=  a[i] <= 1199:
        l[2] = l[2] + 1
    elif 1200 <=  a[i] <= 1599:
        l[3] = l[3] + 1
    elif 1600 <=  a[i] <= 1999:
        l[4] = l[4] + 1
    elif 2000 <=  a[i] <= 2399:
        l[5] = l[5] + 1
    elif 2400 <=  a[i] <= 2799:
        l[6] = l[6] + 1
    elif 2800 <=  a[i] <= 3199:
        l[7] = l[7] + 1
    else:
        l[8] = l[8] + 1
        
tokurei = 0        
for i in range(7):
    tokurei = tokurei + l[i]

if tokurei = 0:
    print('1 ' + str(l[8]) )
else:
    flag = 0
    for i in range(7):
        if l[i] > 0:
            flag = flag + 1
    print(str(flag) + ' ' + str(flag + l[8]))

### FIXED CODE ###

l = [0,0,0,0,0,0,0,0,0]
n = int(input())
a = list(map(int,input().split()))

for i in range(len(a)):
    if 1 <=  a[i] <= 399:
        l[0] = l[0] + 1
    elif 400 <=  a[i] <= 799:
        l[1] = l[1] + 1
    elif 800 <=  a[i] <= 1199:
        l[2] = l[2] + 1
    elif 1200 <=  a[i] <= 1599:
        l[3] = l[3] + 1
    elif 1600 <=  a[i] <= 1999:
        l[4] = l[4] + 1
    elif 2000 <=  a[i] <= 2399:
        l[5] = l[5] + 1
    elif 2400 <=  a[i] <= 2799:
        l[6] = l[6] + 1
    elif 2800 <=  a[i] <= 3199:
        l[7] = l[7] + 1
    else:
        l[8] = l[8] + 1
        
tokurei = 0        
for i in range(8):
    tokurei = tokurei + l[i]

if tokurei == 0:
    print('1 ' + str(l[8]) )
else:
    flag = 0
    for i in range(8):
        if l[i] > 0:
            flag = flag + 1
    print(str(flag) + ' ' + str(flag + l[8]))
n = int(input())
  print((800*n) - (n//15*200))

### FIXED CODE ###

N = int(input())
print(800*N - 200*(N//15))
n = int(input())
h = list(map(int,input().split()))
a = []
for i in range(n-1):
    count = 0
    for j in range(i, n-1):
        if h[j] >= h[j+1]:
            count += 1
        else:
            break
    a.append(count)
print(max(a))

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
c_max = 0
count = 0
for i in range(n-1):
    if h[i] >= h[i+1]:
        count += 1
    else:
        c_max = max(count, c_max)
        count = 0
print(max(c_max, count))
N, K = map(int, input().split())
A = list(map(int, input().split()))
ans = 0
min_in = A.index(1)

left = len(A[0:min_in])

right = len(A[min_in+1:])

if N ==K:
    ans = 0
    
else:
    if (min(left, right) + 1) < K:
        ans += 1
        tuyoi = len(A-K)
        
        ans += tuyoi//K
        
        if tuyoi % K !=0:
            ans +=1
    
    else:
        if left != 0:
            ans += left//(K-1)
            
            if left%(K-1) != 0:
                ans += 1
        
        if right != 0:
            ans += right//(K-1)
            
            if right%(K-1) != 0:
                ans += 1
print(ans)

### FIXED CODE ###

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

if (N-1)%(K-1) ==0:
    print((N-1)//(K-1))
else:
    print((N-1)//(K-1)+1)
n = int(input())
from math import ceil, gcd

tkhs = 1
aoki = 1

for _ in range(n):
    t, a = map(int, input().split())
    t, a = t // gcd(t,a), a // gcd(t,a)
    k = max(ceil(tkhs/t), ceil(aoki/a))
    tkhs = k*t
    aoki = k*a

print(tkhs+aoki)



### FIXED CODE ###

n = int(input())
from math import ceil

tkhs = 1
aoki = 1

for _ in range(n):
    t, a = map(int, input().split())
    k = max((tkhs+t-1)//t, (aoki+a-1)//a)
    tkhs = k*t
    aoki = k*a

print(tkhs+aoki)
import numpy as np

X, N = map(int, input().split())
P = np.array(list(map(int, input().split())))

P = P - X

for i in range(0, X):
    if i not in P or -i not in P:
        if -i not in P:
            ans = X - i
        else:
            ans = X + i
        break

print(ans)


### FIXED CODE ###

import numpy as np

X, N = map(int, input().split())
P = np.array(list(map(int, input().split())))

P = P - X

for i in range(0, X + 1):
    if i not in P or -i not in P:
        if -i not in P:
            ans = X - i
        else:
            ans = X + i
        break

print(ans)
def solve():
    global N, A, PA, XA, i
    N = int(input())
    A = list(map(int, input().split()))

    PA = [0]*(N+1)
    XA = [0]*(N+1)

    PA[0] = A[0]
    XA[0] = A[0]

    for i in range(1,N):
        PA[i] = PA[i-1] + A[i]
        XA[i] = XA[i-1] ^ A[i]

    # print(PA)
    # print(XA)

    count = 0
    for i in range(N):
        r = bs(i, N, solver) - 1
        # print("i, r, r-i+1", i, r, r-i+1)
        count += r-i+1
    print(count)

def bs(ng, ok, solver):  # binary search for integer set
    """
    input:
        ng: max number known to be ng. default -1
        ok: min number known to be ok. default max number + 1
    output:
        the number that is OK firstly
    """
    while math.fabs(ok-ng) > 1:
        mid = (ok+ng)//2
        if solver(mid):
            ok = mid
        else:
            ng = mid
    return ok

def solver(x):
    if PA[x] - PA[i-1] == XA[x] ^ XA[i-1]:
        return False
    else:
        return True

if __name__ == "__main__":
    solve()


### FIXED CODE ###

import math
def solve():
    global N, A, PA, XA, i
    N = int(input())
    A = list(map(int, input().split()))

    PA = [0]*(N+1)
    XA = [0]*(N+1)
    PA[0] = A[0]
    XA[0] = A[0]

    for i in range(1,N):
        PA[i] = PA[i-1] + A[i]
        XA[i] = XA[i-1] ^ A[i]

    count = 0
    for i in range(N):
        r = bs(i, N, solver) - 1
        count += r-i+1
    print(count)

def bs(ng, ok, solver):  # binary search for integer set
    """
    input:
        ng: max number known to be ng. default -1
        ok: min number known to be ok. default max number + 1
    output:
        the number that is OK firstly
    """
    while math.fabs(ok-ng) > 1:
        mid = (ok+ng)//2
        if solver(mid):
            ok = mid
        else:
            ng = mid
    return ok

def solver(x):
    if PA[x] - PA[i-1] == XA[x] ^ XA[i-1]:
        return False
    else:
        return True

if __name__ == "__main__":
    solve()
from operator import itemgetter
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split)
  l.append([a,b])
l.sort(key=itemgetter(0))
s=0
for j in range(n):
  s=s+l[j][0]*min(l[j][1],m)
  m=m-l[j][1]
  if m<0:
    break
print(s) 

### FIXED CODE ###

from operator import itemgetter
n,m=map(int,input().split())
l=[]
for i in range(n):
  a,b=map(int,input().split())
  l.append([a,b])
l.sort(key=itemgetter(0))
s=0
for j in range(n):
  s=s+l[j][0]*min(l[j][1],m)
  m=m-l[j][1]
  if m<0:
    break
print(s)
from collections import deque
N,H=map(int,input().split())
a=deque([]);b=deque([])
for _ in range(N):
    ai,bi=map(int,input().split())
    a.append(ai)
    b.append(bi)
bb=deque([])
ma=max(a)
for _ in range(N):
    bi=b.pop[b.index(max(b))]
    if bi>ma:
        bb.append(bi)
    if sum(bb)>=H:
        print(len(bb))
        exit()
ans=(H-sum(bb))//ma+len(bb)
if (H-sum(bb))%ma==0:
    print(ans)
else:
    print(ans+1)

### FIXED CODE ###

N,H=map(int,input().split())
S=[[int(x) for x in input().split()] for _ in range(N)]
A,B=zip(*S)
A=max(A)
B=[b for b in B if b>A]
B.sort(reverse=True)
ans=0
cnt=0
for b in B:
    if H<=0:
        break
    cnt+=1
    H-=b
if H>0:
    cnt+=(H-1)//A+1
print(cnt)
# -*- coding: utf-8 -*-
import sys 
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
H, W, M = map(int,readline().split())
h_cnt = [0]*(H+1)
w_cnt = [0]*(W+1)
data = [[False]*(W+1) for i in range(H+1)]
 
for i in range(M):
    h,w = map(int,readline().split())
    data[h][w] = True
    h_cnt[h] += 1 
    w_cnt[w] += 1
    
maxh = max(h_cnt)
maxw = max(w_cnt)
maxhInd = []
maxwInd = []
maxhInd = [i for i,a in enumerate(h_cnt) if a == maxh]
maxwInd = [i for i,a in enumerate(w_cnt) if a == maxw]
maxhCnt = len(maxhInd)
maxwCnt = len(maxwInd)

if max_w_cnt * max_h_cnt > M:
    print(max_h+max_w)
else:
    t = list(itertools.product(max_h_ind, max_w_ind))
    for h,w in t:
        if data[h][w] == False:
            print(max_h+max_w)
            sys.exit()
    print(max_h+max_w-1)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys 
import itertools
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
H, W, M = map(int,readline().split())
h_cnt = [0]*(H+1)
w_cnt = [0]*(W+1)
bomb = []
 
for i in range(M):
    h,w = map(int,readline().split())
    bomb.append((h,w))
    h_cnt[h] += 1 
    w_cnt[w] += 1
    
maxh = max(h_cnt)
maxw = max(w_cnt)
maxhCnt = h_cnt.count(maxh)
maxwCnt = w_cnt.count(maxw)

total = maxhCnt*maxwCnt
ans = maxh+maxw
cnt = 0
for h,w in bomb:
    if h_cnt[h] == maxh and w_cnt[w] == maxw:
       cnt += 1

print(ans-1 if cnt == total else ans)
t=input()
a,*b,c=t
print("a",len(*b),"c")


### FIXED CODE ###

t=input()
a,*b,c=t
print(a+str(len(b))+c)
import cmath
import numpy
import sys

INF=10**18
MOD=10**9+7
MAX=10**5+7

def main():
    N=int(input())
    dp=[0, 0, 0]
    for line in sys.stdin.readlines():
        a,b,c=map(int, line.split())
        ndp=[0, 0, 0]
        ndp[0]=max(dp[1], dp[2])+a
        ndp[1]=max(dp[2], dp[0])+b
        ndp[2]=max(dp[0], dp[1])+c
        dp=ndp
    print(max(dp))

main()


### FIXED CODE ###

import cmath
import numpy as np
import sys

INF=10**18
MOD=10**9+7
MAX=10**5+7

def main():
    N=int(input())
    dp=[0, 0, 0]
    for _ in range(N):
        a,b,c=map(int, input().split())
        ndp=[0, 0, 0]
        ndp[0]=max(dp[1], dp[2])+a
        ndp[1]=max(dp[2], dp[0])+b
        ndp[2]=max(dp[0], dp[1])+c
        dp=ndp
    print(max(dp))

if __name__=='__main__':
    main()
s = input()
week = { 'SUN': 7, 'MUN': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1 }
print(week[s])

### FIXED CODE ###

week = { 'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1 }
print(week[input()])
import math

def combinations_count(n, r):
    if r>n:
        return 0
    if n==0 or n==1:
        return 0
    if n==r:
        return 1
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


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

num_list = [0] * n
com_list1 = [0] * n
com_list2 = [0] * n

for i in range(n):
    num_list[a[i]] += 1

for i in range(n):
    num = num_list[i]
    if num>=2:
        com_list1[i] = combinations_count(num, 2)

for i in range(n):
    num = num_list[i]-1
    if num>=2:
        com_list2[i] = combinations_count(num, 2)


total = sum(com_list1)

for i in range(n):
    num = a[i]
    print(total - com_list1[num] + com_list2[num])

### FIXED CODE ###

from collections import Counter

n = int(input())
a = list(map(int, input().split()))
re = [0] * (n+1)

c = Counter(a)   # c: Counter({1: 3, 2: 2})など
for k, v in c.items():
    re[k] = v*(v-1) // 2

total = sum(re)
for i in a:
    print(total - re[i] + (c[i]-1)*(c[i]-2) // 2)
# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

a,b = map(int, input().split())
if a > 9 or b > 9:
  print('-1')
else:
  print(a * b)


### FIXED CODE ###

# coding: utf-8
# submission # - User: herp_sy
# https://atcoder.jp/contests/
#
# lang: Python3 (3.4.3)

import math
import statistics
import numpy as np
import queue

n = int(input())
for a in range(1, 10):
  for b in range(1, 10):
    if(a * b == n):
      print('Yes')
      exit(0)
print('No')
M=int(input())
N=list(input().split())
print(N)
check=[0,0,0,0,0,0,0,0,0,0]
for i in range(M):
    check[int(N[i])]+=1
num=0
for i in range(M):
    num+=check[i]*(check[i]-1)//2
for i in range(M):
    print(num-(check[int(N[i])]-1))

### FIXED CODE ###

M=int(input())
N=list(input().split())
check=[0]*M
for i in range(M):
    check[int(N[i])-1]+=1
num=0
for i in range(M):
    num+=check[i]*(check[i]-1)//2
for i in range(M):
    if check[int(N[i])-1]!=2:
        print(num-(check[int(N[i])-1]-1))
    else:
        print(num-1)