Harryxun/stf_run huggingface dataset:
import math
N, K = map(int, input().split())

S = 0

for i in range(N):
  S += ((1/N)*(2**((-1)*max(0, math.ceil(math.log2((K-1)/(i+1)))))))

print(S)

### FIXED CODE ###

import math
N, K = map(int, input().split())

S = 0

for i in range(N):
  S += ((1/N)*(2**((-1)*max(0, math.ceil(math.log2((K-0.1)/(i+1)))))))

print(S)
n = int(input())
A = list(map(int,input().split()))
minus = 0
ans = 0
abs_min = float('inf')
for a in A:
  if a < 0:
    minus += 1
  ans += abs(a)
  abs_min = min(abs_min, abs(a))
if mins%2:
  ans -= abs_min*2

print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int,input().split()))
minus = 0
ans = 0
abs_min = float('inf')
for a in A:
  if a < 0:
    minus += 1
  ans += abs(a)
  abs_min = min(abs_min, abs(a))
if minus%2:
  ans -= abs_min*2

print(ans)
x, y = map(int,input(),split())

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


### FIXED CODE ###

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

if y % 2 == 0 and y >= x*2 and y <= x*4:
    print('Yes')
else:
    print('No')
a =list(map(int, input().split()))
b = []
b[0] = a[0]*a[1]
b[1] = (a[0]+a[1])*2
print(*b)


### FIXED CODE ###

a,b = [int(x) for x in input().split()]
print(a*b,2*(a+b))
N=int(input())
p=list(map(int,intput().split()))
sum=0
print(sum(p)-max(p)//2)

### FIXED CODE ###

N=int(input())
p=[int(input()) for i in range(N)]
print(sum(p)-max(p)//2)
def resolve():
    import collections
    n = int(input())
    c = list(collections.Counter([int(input()) for _ in range(n)]).most_common())
    s = []
    m = c[0][0]
    for i in c:
        if c !=m:
            break
        s.append(i[0])
    s.sort()
    print("\n".join(s))
resolve()

### FIXED CODE ###

def resolve():
    import collections
    n = int(input())
    c = list(collections.Counter([input() for _ in range(n)]).most_common())
    s = []
    m = c[0][1]
    for i in c:
        if i[1] !=m:
            break
        s.append(i[0])
    s.sort()
    print("\n".join(s))
resolve()
import sys
input = sys.stdin.buffer.readline
from collections import deque

def main():
    N = int(input())
    memo = []
    base = 0
    for i in range(N-1):
        memo.append(base)
        base += N-i-1
    edge = [[] for _ in range((N*(N-1))//2)]
    
    for i in range(N):
        a = list(map(int,input().split()))
        b = []
        for j in a:
            j -= 1
            if i < j:
                b.append(memo[i]+j-i-1)
            else:
                b.append(memo[j]+i-j-1)
        for i in range(N-2):
            edge[b[i+1]].append(b[i])

    go = [False]*((N*(N-1))//2)
    cul = [False]*((N*(N-1))//2)
    dp = [0]*((N*(N-1))//2)
    
    def dfs(v):
        if go[v]:
            if not cul[v]:
                return -1
            return dp[v]
        go[v] = True
        dp[v] = 1
        for u in edge[v]:
            ret = dfs(u)
            if ret == -1:
                return -1
            dp[v] = max(dp[v],ret+1)
        cul[v] = True
        return dp[v]
    
    ans = 0
    for i in range((N*(N-1))//2):
        ret = dfs(i)
        if ret == -1:
            print(-1)
            exit()
        ans = max(ans,ret)
        
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

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

def main():
    N = int(input())
    memo = []
    base = 0
    for i in range(N-1):
        memo.append(base)
        base += N-i-1
    edge = [[] for _ in range((N*(N-1))//2)]
    
    for i in range(N):
        a = list(map(int,input().split()))
        b = []
        for j in a:
            j -= 1
            if i < j:
                b.append(memo[i]+j-i-1)
            else:
                b.append(memo[j]+i-j-1)
        for i in range(N-2):
            edge[b[i+1]].append(b[i])

    go = [False]*((N*(N-1))//2)
    cul = [False]*((N*(N-1))//2)
    dp = [0]*((N*(N-1))//2)
    
    def dfs(v):
        if go[v]:
            if not cul[v]:
                return -1
            return dp[v]
        go[v] = True
        dp[v] = 1
        for u in edge[v]:
            ret = dfs(u)
            if ret == -1:
                return -1
            dp[v] = max(dp[v],ret+1)
        cul[v] = True
        return dp[v]
    
    ans = 0
    for i in range((N*(N-1))//2):
        ret = dfs(i)
        if ret == -1:
            print(-1)
            exit()
        ans = max(ans,ret)
        
    print(ans)

if __name__ == "__main__":
    main()
#include <stdio.h>
#include <ctype.h>
#include <string.h>
 
int main() {
  int alpha;
  int cnt[256] = {0};
  while( (alpha = getchar()) != EOF ) {
    alpha = tolower( alpha );
    cnt[alpha]++;
  }
  for(alpha = 'a'; alpha <= 'z'; alpha++) {
    printf( "%c : %d\n", alpha, cnt[alpha] );
  }
  return 0;
}

### FIXED CODE ###

a = [chr(i) for i in range(97, 123)]
line = ''
while True:
    try:
        line += input().lower()
    except:
        break
for c in a:
    print("{0} : {1}".format(c, line.count(c)))
import sys
def main():
    t1, t2, a1, a2, b1, b2 = map(int, sys.stdin.read().split())
    A1 = t1 * a1
    A2 = t2 * a2
    B1 = t1 * b1
    B2 = t2 * b2

    d = abs(A1 + A2 - B1 - B2)
    if A1 == B1:
        ans = 0
    elif A1 > B1:
        if A1 + A2 > B1 + B2:
            ans = 0
        elif A1 + A2 == B1 + B2:
            ans = 'infinity'
        else:
            (A1 - B1) // d * 2 + 1

    
    elif A1 < B1:
        if A1 + A2 < B1 + B2:
            ans = 0
        elif A1 + A2 == B1 + B2:
            ans = 'infinity'
        else:
            ans = (B1 - A1) // d * 2 + 1

    print(ans)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from math import ceil
def main():
    T1, T2, A1, A2, B1, B2 = map(int, sys.stdin.read().split())
    
    BA1 = A1 - B1
    BA2 = A2 - B2

    if BA1 == 0:
        print(0)
        sys.exit()

    # A1, B1の速い方が速い方をA1とする
    if BA1 < 0:
        BA1 = -BA1
        BA2 = -BA2
    
    d = BA1 * T1 + BA2 * T2
    if d > 0:
        print(0)
        sys.exit()
    if d == 0:
        print('infinity')
        sys.exit()
    
    n = ceil((- BA1 * T1) / d)
    if n * d == - BA1 * T1:
        ans = 2 * n
    else:
        ans = 2 * n - 1
    
    print(ans)
    
if __name__ == '__main__':
    main()
r, g, b = input()
rgb = int(r+g+b)
if rgb % 4 == 0:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

r, g, b = input().split()
rgb = int(r+g+b)
if rgb % 4 == 0:
  print('YES')
else:
  print('NO')
n=int(input())
if n % 4 == 0 or n % 7 == 0:
  print("Yes");
else:
  while n > 0:
    n -= 4
    if n % 7 == 0:
      print("Yes")
      return
  print("No")

### FIXED CODE ###

n=int(input())
if n % 4 == 0 or n % 7 == 0:
	print("Yes");
else:
	while n > 0:
		n -= 4
		if n % 7 == 0:
			print("Yes")
			exit()
	print("No")
s=input()
k=int(input())
ss = [0]*len(s)
for i in range(len(s)):
    if k >= 26:
        k = k + ord(s[i])-97-26
        ss[i] = 'a'
    elif 97+26 - ord(s[i]) <= k:
        k = k + ord(s[i])-97-26
        ss[i] = 'a'
    else:
        ss[i] = s[i]
ss[-1] = chr(ord(s[-1])+k)
#print((ss))

for i in range(len(s)):
    print(ss[i],end='')
print()

### FIXED CODE ###

def str_rotate(S,k): # str_rotate(str,int)
    if k >= 26:
        k = k%26
    if ord(S) + k > 123:
        S = chr(ord(S)+k-97)
    else:
        S = chr(ord(S)+k)
    return S

s = list(input())
k = int(input())
for i in range(len(s)):
    if k == 0:
        break
    if s[i] == "a":
        pass
    elif 123 - ord(s[i]) <= k:
        k -= 123 - ord(s[i])
        s[i] = "a"
    else:
        pass
s[-1] = str_rotate(s[-1],k)
print("".join(s))
N = input()
ret = 0
for c in N:
  ret += ret + int(c) % 9

if ret % 9 == 0:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

import collections 

N = input()
D = collections.Counter(N)
ret = 0
for c in D.keys():
  ret += int(c) * D[c]
  ret = ret % 9
  
if ret  == 0:
  print('Yes')
else:
  print('No')
N K= map(int, input().split())
A =list(map(int, input().split()))

Aset =list(set(A))
B=[0]*len(Aset)
cnt =0

for i in range(len(Aset)):
  for j in range(len(A)):
    if Aset[i] == A[j]:
      cnt += 1
  B[i] = cnt
  cnt =0

B=sorted(B)[::-1]  

ans =0

for i in range(K,len(B)):
  ans +=B[i]
  
print(ans) 

### FIXED CODE ###

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


import collections

c = collections.Counter(a)
c2=sorted(c.values())

sum=0
for i in range(len(c)-K):
        sum+=c2[i]
print(sum)
import sys
from collections import defaultdict
import collections

class UnionFindPathCompression():
    def __init__(self, n):
        self.parents = list(range(n))

    def find(self, x):
        if self.parents[x] == x:
            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

        self.parents[y] = x


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

for i in range(M):
    A, B = map(int, input().split())
    uf.union(A - 1, B - 1)

hoge = [uf.find(i) for i in range(N)]

#print(hoge)
hogehoge = collections.Counter(hoge).most_common()

print(hogehoge[0][1])


### FIXED CODE ###

import sys
from collections import defaultdict
import collections

sys.setrecursionlimit(1000000)

class UnionFindPathCompression():
    def __init__(self, n):
        self.parents = list(range(n))

    def find(self, x):
        if self.parents[x] == x:
            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

        self.parents[y] = x


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

for i in range(M):
    A, B = map(int, input().split())
    uf.union(A - 1, B - 1)

hoge = [uf.find(i) for i in range(N)]

#print(hoge)
hogehoge = collections.Counter(hoge).most_common()

print(hogehoge[0][1])
if __name__ == "__main__":
  input1 = input()
  input2 = input()

  print (input1*input1 - input2)



### FIXED CODE ###


input1 = int(input())
input2 = int(input())

print (input1*input1 - input2)
S = list(input())
gs = 1
ks = 0
rtu = "Yes"
while gs <= len(S) - 1:
    if S[ks] == "L":
        rtu = "No"
        break
    elif S[gs] == "R":
        rtu = "No"
        break
    gs += 1
    ka += 1
print(rtu)

### FIXED CODE ###

S = list(input())
rtu = "Yes"
ks = 1
for i in S:
    if ks == 1:
        if i == "L":
            rtu = "No"
            ks = 0
            break
        else:
            ks = 0
    elif ks == 0:
        if i == "R":
            rtu = "No"
            ks = 1
            break
        else:
            ks = 1
print(rtu)
S = input()
if S = int('ARC')
   print('ABC')
if S = int('ABC')
   print('ARC')
       

### FIXED CODE ###

S = input()
if S == "ARC":
   print("ABC")
elif S == "ABC":
     print("ARC")
N = int(raw_input())
S = int(raw_input())
x = 0
maxx = 0

for c in S:
    if c == 'I':
        x += 1
    if c == 'D':
        x -= 1
    if x > maxx:
        maxx = x

print maxx

### FIXED CODE ###

N = int(raw_input())
S = raw_input()
x = 0
maxx = 0

for c in S:
    if c == 'I':
        x += 1
    if c == 'D':
        x -= 1
    if x > maxx:
        maxx = x

print maxx
N = int((input()))
ab = [list(map(int,input().split())) for _ in range(N-1)]
c = list(map(int,input().split()))
c.sort(reverse = True)

al = [[] for _ in range(N+1)]
for a,b in ab:
    al[a].append(b)


d = [0] * (N)
d[ab[0][0]-1] = c[0]
cnt = 1
child = al[ab[0][0]]
ans = 0

while cnt < N:
    pi = int(child.pop())
    d[pi-1] = (c[cnt])
    ans += c[cnt]
    if al[pi]:
        child = child + al[pi]
    cnt += 1
    
print(ans)
print(' '.join(map(str,d)))
    
    
    
    

### FIXED CODE ###

N = int((input()))
ab = [list(map(int,input().split())) for _ in range(N-1)]
c = list(map(int,input().split()))
c.sort(reverse = True)

al = [[] for _ in range(N+1)]
for a,b in ab:
    al[a].append(b)
    al[b].append(a)

d = [0] * (N)
d[ab[0][0]-1] = c[0]
cnt = 1
child = al[ab[0][0]]
ans = 0
Check = [True] * (N+1)
Check[ab[0][0]] = False

while child and cnt < N:
    pi = int(child.pop())
    Check[pi] = False
    d[pi-1] = (c[cnt])
    ans += c[cnt]
    for i in al[pi]:
        if Check[i]:child.append(i)
    cnt += 1
    
print(ans)
print(' '.join(map(str,d)))
import sys
def datasets(n):
    for i in range(n)
        type, rank = raw_input().split()
        yield type, rank

db = { 'S' : [False] * 13,
       'H' : [False] * 13,
       'C' : [False] * 13,
       'D' : [False] * 13 }

n = int(raw_input())
for type, rank in datasets(n):
    db[type][rank-1] = True

for type in db:
    count = 0
    for card in db[type]:
        if not db[type][card]:
            count += 1
    print count

### FIXED CODE ###

def datasets(n):
    for i in range(n):
        type, rank = raw_input().split()
        yield type, rank
db = {'S' : [False] * 13,
      'H' : [False] * 13,
      'C' : [False] * 13,
      'D' : [False] * 13 }

n = int(raw_input())

for type, rank in datasets(n):
    db[type][int(rank)-1] = True

for type in ['S', 'H', 'C', 'D']:
    for num, card in enumerate(db[type]):
        if card == False:
            print type, (num+1)
K = int(input())
ans = 0

for i in range(K):
    i = i + 1
    for k in range(K):
        k = k + 1
        for j in range(K):
            j = j + 1
            
            ans += gcd(gcd(i, k),j)
            j = j + 1
        k = k + 1
    i = i + 1
            
print(ans)




### FIXED CODE ###

K = int(input())
ans = 0
from math import gcd
for i in range(1,K+1):
    for k in range(1,K+1):
        for j in range(1,K+1):
            ans += gcd(gcd(i, k),j)
            
print(ans)
import bisect
#input
n = int(input())
list1 = list(map(int,input().split()))
list1.sort()

cout = 0 #最終的な三角形の個数

for i in range(n-2): #リストから三角形が作れなくなるまでループ
	o = list1[i] #1辺を確定、そのままリストから消去
	for j in range(i+1,n-1): #残りの二辺のループ(iで使っている次の値から)
		p = list1[j] #２辺目を確定

		b = o+p -1 #昇順にソートしてあるので、c<a+b条件のみ計算

		d = bisect.bisect_right(list1[j+1:],b) #３辺目を確定
		
		cout += d

print(cout)

### FIXED CODE ###

a,b = map(int,input().split())
if a <= b*2:
    print(0)
else:
    print(a-b*2)
k = 0
i = 0
     
while k = 1:
   i += 1
   x = input()
   if x == 0:
      k = 1
   else:
      print "Case %d: %d" %(i, x)

### FIXED CODE ###

i = 0
     
while 1:
   i += 1
   x = input()
   if x == 0:
      break
   else:
      print "Case %d: %d" %(i, x)
n = int(input())
a = list(int(i) for i in input().split())

hai = 0
tya = 0
midori = 0
mizu = 0
ao = 0
ki = 0
daidai = 0
aka = 0

niji = 0

mincolor = 0
maxcolor = 0

for i in range(n):
    if 1 <= a[i] and a[i] <=399:
        hai = 1
    elif 400 <= a[i] and a[i] <= 799:
        tya = 1
    elif 800 <= a[i] and a[i] <= 1199:
        midori = 1
    elif 1200 <= a[i] and a[i] <=1599:
        mizu = 1
    elif 1600 <= a[i] and a[i] <= 1999:
        ao = 1
    elif 2000 <= a[i] and a[i] <= 2399:
        ki = 1
    elif 2400 <= a[i] and a[i] <=2799:
        daidai = 1
    elif 2800 <= a[i] and a[i] <= 3199:
        aka = 1
    elif 3200 <= a[i]:
        niji += 1

mincolor = hai + tya + midori + mizu + ao + ki + daidai + aka
maxcolor = mincolor + niji

if maxcolor >= 9:
    maxcolor = 8

print(mincolor, maxcolor)


### FIXED CODE ###

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

suuji = a*100 + b*10 + c

if suuji%4 == 0:
    print("YES")

else:
    print("NO")
N = input()
 
if N[-1]==2or 4or 5or 7or 9:
     print('hon')
     
elif N[-1]==0or 1or 6or 8:
    print('pon')
     
else:
    print('bon')

### FIXED CODE ###

N = input()
 
if N[-1]=='2' or N[-1]=='4' or N[-1]=='5' or N[-1]=='7' or N[-1]=='9':
    print('hon')
     
elif N[-1]=='0' or N[-1]=='1' or N[-1]=='6' or N[-1]=='8':
    print('pon')
     
else:
    print('bon')
#-*-coding:utf-8-*-

def main():
    n = int(input())
    numbers=[]
    answers=[]
    number=0
    numbers=[int(input()) for _ in range(n)]

    for number in numbers:
        if len(answers)==0:
            answers.append(number)
        else:
            if number in answers:
                answers.pop(number)
            else:
                answers.append(number)
    print(len(answers))

if __name__=="__main__":
    main()

### FIXED CODE ###

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

from collections import Counter

def main():
    n = int(input())
    numbers=[]
    answers=[]
    number=0
    numbers=[int(input()) for _ in range(n)]
    Numbers_col = Counter(numbers)

    for number in Numbers_col.values():
        if number%2!=0:
            answers.append(number)
    print(len(answers))

if __name__=="__main__":
    main()
import math
data = list(map(int,input().split()))
print("%f" %(math.sqrt(abs(data[0]-data[2])**2 + abs(data[1]-data[3]**2))))


### FIXED CODE ###

import math
data = list(map(float,input().split()))
print("%f" %(math.sqrt(abs(data[0]-data[2])**2 + abs(data[1]-data[3])**2)))
import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
  
 
  
p,q = map(int,input().split())
 
 
m = 10**9 + 7
 
for i in range(1,q+1):
  a =  combination_count(p-q+1,i) * combination_count(q-1,i-1)
  print(a%m)


### FIXED CODE ###

import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
    
n,k = map(int,input().split())
 
mod = 10**9 + 7
 
for i in range(1,k+1):
    x = combination_count(n-k+1,i) * combination_count(k-1, i-1)
    print(x%mod)
#入力した整数が５、７、５であるならばTrueを返す
# int,int,int -> True 

x,y,z = int(input())
if x == 7:
    if y == z and y == 5 :
        print("YES")
    else:
        print("NO")
elif y == 7:
    if x == z and x == 5:
        print("YES")
    else:
        print("NO")
elif z == 7:
    if x == y and x == 5:
        print("YES")
    else:
        print("NO")
    else:
        print("NO")


### FIXED CODE ###

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

input_list = input().split()

cnt7 = 0
cnt5 = 0

for n in input_list:
    if int(n) == 7:
        cnt7 += 1
    elif int(n) == 5:
        cnt5 += 1
    else:
        continue
if cnt7 == 1 and cnt5 == 2:
    print("YES")
else:
    print("NO")
A=[1]
for i in range(1,33):
  for j in range(1, 11):
    if i**j<X:
      A.append(i**j)
print(A[-1])

### FIXED CODE ###

A=[1]
X=int(input())
for i in range(1,33):
  for j in range(2, 11):
    if i**j<X+1:
      A.append(i**j)
print(max(A))
import sys
def is_prime(q):
&#160;&#160;&#160;&#160;q = abs(q)
&#160;&#160;&#160;&#160;if q == 2: return True
&#160;&#160;&#160;&#160;if q < 2 or q&1 == 0: return False
&#160;&#160;&#160;&#160;return pow(2, q-1, q) == 1
for n in sys.stdin:
&#160;&#160;&#160;&#160;a=int(n.strip())
&#160;&#160;&#160;&#160;b=a
&#160;&#160;&#160;&#160;while 1:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;a+=2
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if is_prime(a):
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;max_a=a
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break
&#160;&#160;&#160;&#160;while 1:
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;b-=2
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if is_prime(b):
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;min_b=b
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break
&#160;&#160;&#160;&#160;print min_b,max_a

### FIXED CODE ###

import sys
def is_prime(q):
    q = abs(q)
    if q == 2: return True
    if q < 2 or q&1 == 0: return False
    return pow(2, q-1, q) == 1
for n in sys.stdin:
    a=int(n.strip())
    b=a
    while 1:
        a+=1
        if is_prime(a):
            max_a=a
            break
    while 1:
        b-=1
        if is_prime(b):
            min_b=b
            break
    print min_b,max_a
n = A.pop(0)
while True:
  if n == 'a':
    if A == []:
      print('A')
      break
    n = A.pop(0)
  elif n == 'b':
    if B == []:
      print('B')
      break
    n = B.pop(0)
  else:
    if C == []:
      print('C')
      break
    n = C.pop(0)

### FIXED CODE ###

A = list(input())
B = list(input())
C = list(input())

n = A.pop(0)
while True:
  if n == 'a':
    if A == []:
      print('A')
      break
    n = A.pop(0)
  elif n == 'b':
    if B == []:
      print('B')
      break
    n = B.pop(0)
  else:
    if C == []:
      print('C')
      break
    n = C.pop(0)
a,b = input().split()

cross = int((a * b)/2)

if cross == 0:
    print("even")

if cross != 0:
    print("odd")


### FIXED CODE ###

a,b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRY', 'SAT']
S = input()
print(7-l.index(S))

### FIXED CODE ###

l = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT']
S = input()
print(7-l.index(S))
N, M, X = map(int, input().split())
C = [(list(map(int, input().split()))) for _ in range(N)]
 
# bit全探索を行い、参考書に関する全ての組みについて、値段と理解度を求める
ans = 10**10
for i in range(2**N):
  U = [0]*(M+1)
  for j in range(N):
    if ((i >> j) & 1):
      for k in range(M+1):
        U[k] += C[j][k]
  
  # ある組みが条件を満たすなら、その値段をvalに追加
  if sum([u >= X for u in U[1:]]) == M:
    ans = min(ans, M[0])

if ans == 10**10: print(-1)
else: print(ans)
 

### FIXED CODE ###

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

# bit全探索を行い、参考書に関する全ての組みについて、値段と理解度を求める
val = []
for i in range(2**N):
  U = [0]*(M+1)
  for j in range(N):
    if ((i >> j) & 1):
      for k in range(M+1):
        U[k] += C[j][k]
  
  # ある組みが条件を満たすなら、その値段をvalに追加
  if sum([u >= X for u in U[1:]]) == M:
    val.append(U[0])

# 条件を満たす組みの中で、値段が最小のものを出力し、組みが無ければ-1を出力する
ans = 0
if len(val) == 0: ans = -1
else: ans = min(val)
print(ans)
from collections import deque
import copy

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] =  [long(input_raw[0])]
    input_raw = read_func().strip().split()
    cards = {}
    for i in range(N):
        c = int(input_raw[i])
        if c not in cards:
            cards[c] = 1
        else:
            cards[c] += 1

    even_num = 0
    for c in cards:
        if cards[c] % 2 == 0:
            even_num += 1
    if even_num % 2 == 0:
        print len(cards)
    else:
        print len(cards) - 1



if __name__ == '__main__':
    main()


### FIXED CODE ###

from collections import deque
import copy
import sys

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] =  [long(input_raw[0])]
    input_raw = read_func().strip().split()
    cards = {}
    for i in range(N):
        c = int(input_raw[i])
        if c not in cards:
            cards[c] = 1
        else:
            cards[c] += 1

    even_num = 0
    for c in cards:
        if cards[c] % 2 == 0:
            even_num += 1
    if even_num % 2 == 0:
        print len(cards)
    else:
        print len(cards) - 1



if __name__ == '__main__':
    main()
N, Q = map(int, input().split())
S = input()

for count in range(3):
    l, r = map(int, input().split())
    ans = 0
    count = 0

    for i in S[l-1: r]:
        if i =="A" or i == "T":    
            count += 1
        else:
            ans = max(count, ans)
            count = 0
    ans = max(count, ans)
    print(ans)




### FIXED CODE ###

N, Q = map(int, input().split())
data = input()
result = [0] * N
for i in range(N-1):
  if data[i] == "A" and data[i+1] == "C":
    result[i+1] = result[i] + 1
  else:
    result[i+1] = result[i]

for i in range(Q):
  l, r = map(int, input().split())
  print(result[r-1]-result[l-1])