Harryxun/stf_run huggingface dataset:
n = input()
if n < 1200:
    print ("ABC")
elif n < 2800:
    print ("ARC")
else:
    print ("AGC")

### FIXED CODE ###

n = int(input())
if n < 1200:
    print ("ABC")
elif n < 2800:
    print ("ARC")
else:
    print ("AGC")
n=int(input())
for i in range(n):
    s=list(input())
m=int(input())
for j in range(m):
    t=list(input())

result=0
for i in range(n):
    result=s.count(s[i])-t.count(s[i])

print(max(o,result))


### FIXED CODE ###

n=int(input())
s=[input() for _ in range(n)]
m=int(input())
t=[input() for _ in range(m)]
result=0
for i in set(s):
    result=max(result,s.count(i)-t.count(i))
print(result)
from collections import defaultdict
N, K, L = map(int, input().split())


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        self.size = [1] * n

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
            self.size[x] = 0
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            self.size[y] = 0
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # すべての頂点に対して親を検索する
    def all_find(self):
        for n in range(len(self.par)):
            self.find(n)


D = defaultdict(int)

uf = UnionFind()
tf = UnionFind()
n,k,l =  map(int, input().split())
dp =[1]*n
for i in range(k):
    x,y =map(int, input().split())
    uf.unite(x-1, y-1)  # (3)
for i in range(l):
    x,y =map(int, input().split())
    tf.unite(x-1, y-1)  # (3)
tf.all_find()
uf.all_find()
D = defaultdict(int)
for r, t in zip(uf.par, tf.par):
    D[(r, t)] += 1
 
ans = [D[(r, t)] for r, t in zip(uf.par, tf.par)]
print(*ans, sep=' ')

### FIXED CODE ###

from collections import defaultdict


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0] * n
        self.size = [1] * n

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    # 併合
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
            self.size[x] = 0
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            self.size[y] = 0
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # すべての頂点に対して親を検索する
    def all_find(self):
        for n in range(len(self.par)):
            self.find(n)


D = defaultdict(int)
n,k,l =  map(int, input().split())
uf = UnionFind(n)
tf = UnionFind(n)

dp =[1]*n
for i in range(k):
    x,y =map(int, input().split())
    uf.union(x-1, y-1)  # (3)
for i in range(l):
    x,y =map(int, input().split())
    tf.union(x-1, y-1)  # (3)
tf.all_find()
uf.all_find()
D = defaultdict(int)
for r, t in zip(uf.par, tf.par):
    D[(r, t)] += 1
 
ans = [D[(r, t)] for r, t in zip(uf.par, tf.par)]
print(*ans, sep=' ')
n = input()
for ans in range(111, 999, 111):
    if n <= ans:
        break
print(ans)

### FIXED CODE ###

n = input()
for ans in range(111, 1000, 111):
    if int(n) <= ans:
        break
print(ans)
a, b, c = map(int, input().spulit())

if a <= b * c:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

d,t,s=map(int,input().split())
if d<=t*s:
    print("Yes")
else:
    print("No")
from collections import Counter
import numpy as np

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

count = Counter(a)
# 1; Counter 同士を比較
# 2; 2step loopで2個であることを確認する。

# > linspace で2個ずつ２ステップのリストを比較して、リストが同じであるかIFチェックする。

# 偶数
if (n % 2 == 0):
    check = [0] * n
    for i in range(1, n, 2):
        check[i - 1] = i
        check[i] = i

    checkC = Counter(check)

    if (checkC == count):
        ans = 2 ** (n / 2)
    else:
        ans = 0
# 奇数
else:
    check = [0] * n
    for i in range(2, n, 2):
        check[i - 1] = i
        check[i] = i

    checkC = Counter(check)
    if (checkC == count):
        ans = 2 ** ((n - 1) / 2)
    else:
        ans = 0

print(int(ans))


### FIXED CODE ###

from collections import Counter
import numpy as np

MOD = 10 ** 9 + 7

n = int(input())
a = list(map(int, input().split()))
count = Counter(a)
# 0の個数は、count[0]
num = len(a)
ans = 1


if (num % 2 == 0):
    # 偶数パターン
    temp = 1
    loop = int(num / 2)
    for i in range(loop):
        tar = count[temp]
        if (tar == 2):
            ans *= 2
            temp += 2
        else:
            print(0)
            exit()

else:

    tar0 = count[0]
    if (tar0 == 1):
        pass
    else:
        print(0)
        exit()

    temp = 2

    for i in range(num // 2):
        if (count[temp] == 2):
            ans *= 2
            temp += 2
        else:
            print(0)
            exit()

ans %= MOD
print(ans)
mod = 10 ** 9 + 7

f = [0 for _ in range(100000)]
f[0] = 1
for i in range(1, 100000):
    f[i] = f[i - 1] * i % mod
inv = [pow(f[i], mod - 2, mod) for i in range(100000)]


def C(n, m):
    if n < m: return 0
    return f[n] * inv[m] * inv[n - m]

n = int(input())
a = [*map(lambda x: int(x) - 1, input().split())]
pos = [[] for _ in range(n)]

for idx, x in enumerate(a):
    pos[x].append(idx)

for _ in pos:
    if len(_) == 2:
        l, r = _

for i in range(1, n + 2):
    print(((C(n + 1, i) - C(n + l - r, i - 1)) % mod + mod) % mod)



### FIXED CODE ###

mod = 10 ** 9 + 7

f = [0 for _ in range(200000)]
f[0] = 1
for i in range(1, 200000):
    f[i] = f[i - 1] * i % mod
inv = [pow(f[i], mod - 2, mod) for i in range(200000)]


def C(n, m):
    if n < m or m < 0: return 0
    return f[n] * inv[m] * inv[n - m] % mod

n = int(input())
a = list(map(lambda x: int(x) - 1, input().split()))
pos = [[] for _ in range(n)]

for idx, x in enumerate(a):
    pos[x].append(idx)

for _ in pos:
    if len(_) == 2:
        l, r = _

for i in range(1, n + 2):
    print(((C(n + 1, i) - C(n + l - r, i - 1)) % mod + mod) % mod)
a,b,k=map(int,input().split())
x=[]
y=[]
for i in range(a,b+1):
    x.append(i)
for i in range(k):
    y.append(x[i])
for i in range(1,k+1):
    y.append(x[-i])
y.sort()
for i in range(len(y)):
    print(y[i])

### FIXED CODE ###

a,b,k=map(int,input().split())
x=[]
y=[]
if b-a<k:
    k=b-a+1
for i in range(a,a+k):
    x.append(i)
for i in range(b-k+1,b+1):
    x.append(i)
x=list(set(x))
x.sort()
for i in range(len(x)):
    print(x[i])
# -*- coding: utf-8 -*-


N = input()
A = input().split()

sum = 0
for i in range(N-1):
  for j in range(i+1, N):
    sum += (A[i]^A[j])

dst = sum % (10**9+7)
print(dst)
    
    


### FIXED CODE ###

import numpy as np

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

mod = 10 ** 9 + 7
s = 0

for i in range(60):# Aは2の6乗より小さい
    c = np.count_nonzero(A & 1) # 最下位のbitで0じゃないものの個数
    s += 2 ** i * c * (N - c) # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    A >>= 1 #　1bitずつ右にずらす。これを繰り返し続ける
print(s % mod)
import math
from functools import reduce
N = int(input())
An = list(map(int, input().split()))


def gcd(list):
    return reduce(math.gcd, list)


print(gcd(An))


### FIXED CODE ###

import fractions
from functools import reduce
N = int(input())
An = list(map(int, input().split()))


def gcd(list):
    return reduce(fractions.gcd, list)


print(gcd(An))
memo1 = {}
def cho(n):
    if n==0:
        return 1
    if n in memo1:
        return memo1[n]
    memo1[n] = 2*cho(n-1)+3
    return memo1[n]
memo2 = {}
def pat(n):
    if n==0:
        return 1
    if n in memo2:
        return memo2[n]
    memo2[n] = 2*pat(n-1)+1
    return memo2[n]
N,X = map(int,input().split())
cnt = 0
k = N
while X>0:
    if X==1:
        break
    elif X==cho(k)//2:
        cnt += pat(k-1)
        break
    elif X<cho(k)//2:
        k -= 1
        X -= 1
    elif X==cho(k)//2+1:
        cnt += 1+pat(k-1)
        break
    else:
        cnt += pat(k-1)+1
        X -= cho(k-1)+2
        k -= 1
print(cnt)

### FIXED CODE ###

def f(n):
    return 2**(n+2)-3
def g(n):
    return 2**(n+1)-1
def p(x,n):
    if x==1:
        return 0
    if n==1:
        if 2<=x<=4:
            return x-1
        elif x>4:
            return 3
    if x==f(n-1)+2:
        return g(n-1)+1
    if x>=2*f(n-1)+2:
        return 2*g(n-1)+1
    if x<f(n-1)+2:
        return p(x-1,n-1)
    if x<2*f(n-1)+2:
        return g(n-1)+1+p(x-f(n-1)-2,n-1)
N,X = map(int,input().split())
print(p(X,N))
while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    if len(num) != 1:
        print "%d %d %d" % (min(num),max(num),sum(num))
        break

### FIXED CODE ###

while True:
    l = map(int, raw_input().split())
    num = map(int, raw_input().split())
    print "%d %d %d" % (min(num),max(num),sum(num))
    break
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])
try:raise RuntimeError
except:exit()

### FIXED CODE ###

dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])
import numpy as np

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

print(np.lcm(A, B))

### FIXED CODE ###

import fractions

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

def lcm(a,b):
    y = a*b / fractions.gcd(a,b)
    return int(y)

print(lcm(A,B))
import itertools
import numpy as np

X, N = list(map(int, input().split(' ')))
ps = list(map(int, input().split(' ')))

ps_sort = list(sorted(ps))
not_in_ps = np.array([[abs(i-X), i] for i in range(101) if i not in ps_sort])
print(not_in_ps[np.argmin(not_in_ps[:,0], 0), 1])

### FIXED CODE ###

import itertools
import numpy as np

X, N = list(map(int, input().split(' ')))
ps = input()
if len(ps)!=0:
    ps = list(map(int, ps.split(' ')))

ps_sort = list(sorted(ps))
not_in_ps = np.array([[abs(i-X), i] for i in range(-1, 102) if i not in ps_sort])
print(not_in_ps[np.argmin(not_in_ps[:,0], 0), 1])
import numpy as np
K, X = map(int, input().split())

if min(-1000000, X-(K-1)) != X-(K-1) and max(1000000, X+(K-1)) != X+(K-1):
    left = X-(K-1)
    right = X+(K-1)
elif min(-1000000, X-(K-1)) == X-(K-1):
    left = -1000000
    right = X+(K-1)
elif max(1000000, X+(K-1)) == X+(K-1):
    left = X-(K-1)
    right = 1000000
else:
    left = -1000000
    right = 1000000

ans = list(map(str,range(left,right+1)))
print(' '.join(ans))


### FIXED CODE ###

K, X = map(int, input().split())

left = X-(K-1)
right = X+(K-1)
ans = list(map(str,range(left,right+1)))
print(' '.join(ans))
import sys
input = sys.stdin.readline
from collections import deque

MOD = 10 ** 9 + 7

N = int(input())
graph = [[] for _ in range(N+1)]
for i,x in enumerate(input().rstrip().split(),1):
    x = int(x)
    graph[i].append(x)
    graph[x].append(i)

# 各深さから来ている (0個、1個、2個以上) の分布を 確率 mod MODで持つ。

half = (MOD + 1) // 2

def merge(dp,dp1):
    L = len(dp1)
    for i in range(L):
        # 0個,1個,2個以上
        a,b,c = dp[i]
        d,e,f = dp1[i]
        a,b,c = a*d, a*e + b*d, a*f + b*e + b*f + c*d + c*e + c*f
        a %= MOD
        b %= MOD
        c %= MOD
        dp[i] = (a,b,c)
    return

def dfs(v,parent = None):
    dp = None
    L = 0
    for u in graph[v]:
        if u == parent:
            continue
        dp1 = dfs(u,v)
        if dp is None:
            dp = dp1
        else:
            if len(dp) < len(dp1):
                dp,dp1 = dp1,dp
            # 2個以上が入っているインデックス
            if L < len(dp1):
                L = len(dp1)
            merge(dp,dp1)
    if dp is None:
        dp = deque()
    else:
        # 2個以上あるときに、0個化する
        for i in range(L):
            a,b,c = dp[i]
            dp[i] = (a+c,b,0)
    dp.appendleft((half,half,0))
    return dp

dp = dfs(0)

answer = sum(b for a,b,c in dp)
answer *= pow(2,N+1,MOD)
answer %= MOD
print(answer)

### FIXED CODE ###

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

MOD = 10 ** 9 + 7

N = int(input())
graph = [[] for _ in range(N+1)]
for i,x in enumerate(input().rstrip().split(),1):
    x = int(x)
    graph[i].append(x)
    graph[x].append(i)

# 各深さから来ている (0個、1個、2個以上) の分布を 確率 mod MODで持つ。

half = (MOD + 1) // 2

def merge(dp,dp1):
    L = len(dp1)
    for i in range(L):
        # 0個,1個,2個以上
        a,b,c = dp[i]
        d,e,f = dp1[i]
        a,b,c = a*d, a*e + b*d, a*f + b*e + b*f + c*d + c*e + c*f
        a %= MOD
        b %= MOD
        c %= MOD
        dp[i] = (a,b,c)
    return

def dfs(v,parent = None):
    dp = None
    L = 0
    for u in graph[v]:
        if u == parent:
            continue
        dp1 = dfs(u,v)
        if dp is None:
            dp = dp1
        else:
            if len(dp) < len(dp1):
                dp,dp1 = dp1,dp
            # 2個以上が入っているインデックス
            if L < len(dp1):
                L = len(dp1)
            merge(dp,dp1)
    if dp is None:
        dp = deque()
    else:
        # 2個以上あるときに、0個化する
        for i in range(L):
            a,b,c = dp[i]
            dp[i] = (a+c,b,0)
    dp.appendleft((half,half,0))
    return dp

dp = dfs(0)

answer = sum(b for a,b,c in dp)
answer *= pow(2,N+1,MOD)
answer %= MOD
print(answer)
H, W = map(int, input().split())
S = [input() for _ in range(H)]


def f(i, j):
    t = [[-1] * W for _ in range(W)]
    t[i][j] = 0
    q = [(i, j)]
    while q:
        y, x = q.pop(0)
        if y - 1 >= 0 and S[y - 1][x] != '#' and t[y - 1][x] == -1:
            t[y - 1][x] = t[y][x] + 1
            q.append((y - 1, x))
        if y + 1 < H and S[y + 1][x] != '#' and t[y + 1][x] == -1:
            t[y + 1][x] = t[y][x] + 1
            q.append((y + 1, x))
        if x - 1 >= 0 and S[y][x - 1] != '#' and t[y][x - 1] == -1:
            t[y][x - 1] = t[y][x] + 1
            q.append((y, x - 1))
        if x + 1 < W and S[y][x + 1] != '#' and t[y][x + 1] == -1:
            t[y][x + 1] = t[y][x] + 1
            q.append((y, x + 1))
    return max(max(tt) for tt in t)


result = 0
for i in range(H):
    for j in range(W):
        if S[i][j] != '#':
            result = max(result, f(i, j))
print(result)


### FIXED CODE ###

H, W = map(int, input().split())
S = [input() for _ in range(H)]


def f(i, j):
    t = [[-1] * W for _ in range(H)]
    t[i][j] = 0
    q = [(i, j)]
    while q:
        y, x = q.pop(0)
        if y - 1 >= 0 and S[y - 1][x] != '#' and t[y - 1][x] == -1:
            t[y - 1][x] = t[y][x] + 1
            q.append((y - 1, x))
        if y + 1 < H and S[y + 1][x] != '#' and t[y + 1][x] == -1:
            t[y + 1][x] = t[y][x] + 1
            q.append((y + 1, x))
        if x - 1 >= 0 and S[y][x - 1] != '#' and t[y][x - 1] == -1:
            t[y][x - 1] = t[y][x] + 1
            q.append((y, x - 1))
        if x + 1 < W and S[y][x + 1] != '#' and t[y][x + 1] == -1:
            t[y][x + 1] = t[y][x] + 1
            q.append((y, x + 1))
    return max(max(tt) for tt in t)


result = 0
for i in range(H):
    for j in range(W):
        if S[i][j] != '#':
            result = max(result, f(i, j))
print(result)
s=int(input()
if s==3 or s==5 or s==7:
      print("YES")
else:
      print("NO")

### FIXED CODE ###

s=int(input())
if s==3 or s==5 or s==7:
  print("YES")
else:
  print("NO")
N, M = [int(i) for i in input().split()]

if N == 1 and M == 1:
    print(1)
elif N == 1:
    print(M - 2)
elif M == 1:
    print(N - 2)
else:
    print(N * M - ((N - 2) * 2 + (M - 2) * 2) - 4)



### FIXED CODE ###

l = [input() for i in range(3)]

print(''.join([l[0][:1], l[1][1:2], l[2][2:3]]))
n, ma, mb = map(int, input().split())
abc = [list(map(int, input().split())) for _ in range(n)]

m = n * 10 + 1

dp1 = [[float('inf')] * m for i in range(n + 1)]
for i in range(n + 1):
    dp1[i][0] = 0
for i in range(n):
    for j in range(m):
        dp1[i+1][j] = min(dp1[i+1][j], dp1[i][j])
        # i個目を買う
        jj = j + abc[i][0]
        if jj <= 400:
            dp1[i+1][jj] = min(dp1[i+1][jj], dp1[i][j] + abc[i][2])

dp2 = [[float('inf')] * m for i in range(n + 1)]
for i in range(n + 1):
    dp2[i][0] = 0
for i in range(n):
    for j in range(m):
        dp2[i+1][j] = min(dp2[i+1][j], dp2[i][j])
        # i個目を買う
        jj = j + abc[i][1]
        if jj <= 400:
            dp2[i+1][jj] = min(dp2[i+1][jj], dp2[i][j] + abc[i][2])

from fractions import gcd
ans = float('inf')
for i in range(1, m):
    for j in range(1, m):
        d1 = dp1[-1][i]
        d2 = dp2[-1][j]
        g = gcd(i, j)
        if i // g == ma and j // g == mb:
            ans = min(ans, d1 + d2)

if ans == float('inf'):
    print(-1)
else:
    print(ans)


### FIXED CODE ###

n, ma, mb = map(int, input().split())
abc = [list(map(int, input().split())) for _ in range(n)]

m = n * 10 + 1

dp = [[[float('inf')] * m for j in range(m)] for i in range(n + 1)]
for i in range(n + 1):
    dp[i][0][0] = 0

for i in range(n):
    for j in range(m):
        for k in range(m):
            dp[i+1][j][k] = min(dp[i+1][j][k], dp[i][j][k])

            # i個目を買う
            jj = j + abc[i][0]
            kk = k + abc[i][1]
            if jj < m and kk < m:
                dp[i+1][jj][kk] = min(dp[i+1][jj][kk], dp[i][j][k] + abc[i][2])

from fractions import gcd
ans = float('inf')
for i in range(1, m):
    for j in range(1, m):
        g = gcd(i, j)
        if i // g == ma and j // g == mb:
            ans = min(ans, dp[-1][i][j])

if ans == float('inf'):
    print(-1)
else:
    print(ans)
n = int(input())
list = []
for i in range(1, n**0.5+1):
  if n%i == 0:
    list.append(int(i + n/i))
print(min(list)-2)

### FIXED CODE ###

n = int(input())
list = []
for i in range(1, int(n**0.5+1)):
  if n%i == 0:
    list.append(int(i + n/i))
print(min(list)-2)
x,y=map(int,input().split())
if x%y==0:
  print(-1)
else:
  pritn(x)
  

### FIXED CODE ###

x,y=map(int,input().split())
if x%y==0:
  print(-1)
else:
  print(x)
N, A, B, C = list(map(str, input().split()))
l = [0]*N
for i in range(N):
    l[i] = int(input())


def dfs(A_list, B_list, C_list, i):
    if i == N:
        return A - sum(A_list) + B - sum(B_list) + C - sum(C_list)

    dfs_not_used = dfs(A_list, B_list, C_list, i+1)
    dfs_A = dfs(A_list.append(l[i]), B_list, C_list, i+1) + 10
    dfs_B = dfs(A_list, B_list.append(l[i]), C_list, i+1) + 10
    dfs_C = dfs(A_list, B_list, C_list.append(l[i]), i+1) + 10

    return min(dfs_not_used, dfs_A, dfs_B, dfs_C)


ans = dfs([0], [0], [0], 8)
print(ans)


### FIXED CODE ###

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

N, A, B, C = [int(i) for i in input().split()]
L = [int(input()) for i in range(N)]


def dfs(idx, a, b, c):

    if idx == N:
        if a == 0 or b == 0 or c == 0:
            return 1e9

        return abs(A - a) + abs(B - b) + abs(C - c)

    x = dfs(idx + 1, a, b, c)
    y = dfs(idx + 1, a + L[idx], b, c) + 10*(a != 0)
    z = dfs(idx + 1, a, b + L[idx], c) + 10*(b != 0)
    w = dfs(idx + 1, a, b, c + L[idx]) + 10*(c != 0)
    return min(x, y, z, w)


ans = dfs(0, 0, 0, 0)
print(ans)
a,b=map(int,input().split())

c = int(a)
d = int(b) 

time = (1/c) * d

return(time)

### FIXED CODE ###

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

c = int(a)
d = int(b)

time = c / d

print(time)
S=raw_input()
N=len(S)
for k in range(N/3,0,-1):
    s="J"*k+"O"*k+"I"*k
    if S.count(s)>0:
        print k
        break
else:
    print 0

### FIXED CODE ###

S=raw_input()
N=len(S)
i,k=0,0
while i<N:
    L=[0]*3
    s="JOI"
    for j in range(len(s)):
        while i<N and S[i]==s[j]:
            L[j]+=1
            i+=1
    if L[0]>=L[1] and L[2]>=L[1]:
        k=max(L[1],k)
print k
n,m = map(int,input().split())
light = [list(map(int,input().split())) for _ in range(m)]
p = list(map(int,input().split()))

ans = 0
for i in range(1<<n):
  flag = True
  for i in range(m):
    l = light[m][1:]
    count = 0
    for s in l:
      if i & (1<<(s-1)):
        count += 1
    if count%2 != p[m]:
      flag = False
  if flag==True:
    ans += 1
print(ans)

### FIXED CODE ###

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

ans = 0
for i in range(1<<n):
  flag = True
  for j in range(m):
    l = light[j][1:]
    count = 0
    for s in l:
      if i & (1<<(s-1)):
        count += 1
    if count%2 != p[j]:
      flag = False
  if flag==True:
    ans += 1
print(ans)
i=0
while True:
     a=int(input())
    i+=1
    if a==0:
        break
    else:
        print("Case" + str(i)+": "+str(a))
        


### FIXED CODE ###

l = []
while True:
  i = str(input())
  if i == '0':
    break
  else:
    l.append(i)
t = 0
for i in l:
  t += 1
  print('Case '+str(t)+': '+i)
import sys
input = sys.stdin.readline
import numpy as np

N, K = [int(item) for item in input().split()]
h =np.array([int(item) for item in input().split()])
# print(h.shape)
dp = np.full(N+K, 10**10+1, dtype='int64')
dp[0] = 0

for i in range(1, K):
    max1 = min(N, i+K)
    cost = abs(h[i:max1] - h[i-1])
    # print(cost.shape, dp[i:max1].shape)
    dp[i:max1] = np.minimum(dp[i:max1], dp[i-1] + cost)

    print(dp)
print(dp[N-1])


### FIXED CODE ###

import numpy as np

N, K = [int(item) for item in input().split()]
h =np.array([int(item) for item in input().split()])
# print(h.shape)
dp = np.full(N+K, 10**10+1, dtype='int64')
dp[0] = 0

for i in range(1, N):
    max1 = min(N, i+K)
    cost = abs(h[i:max1] - h[i-1])
    # print(cost.shape, dp[i:max1].shape)
    dp[i:max1] = np.minimum(dp[i:max1], dp[i-1] + cost)

    # print(dp)
print(dp[N-1])
elements = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

if K < 16:
    th = K-1
    print(elements[th])
else:
    th = -(32-K)-1
    print(elements[th])

### FIXED CODE ###

elements = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
K = int(input())
th = K-1
print(elements[th])
a,b,c,d,e,f = list(map(int,input().split()))
a *= 100
b *= 100 

def node(w,s):
    return s/w

w,s = 0,0

w += a

nodelist = []
nodelistapd = nodelist.append
nodedict = {}

enode = node(100+e, e)

while(1):
    if w >= f:break
    if node(w+d,s+d) <= enode:
        s += d
        w += d
    elif node(w+c,s+c) <= enode:
        s += c
        w += c
    else:
        nodelistapd(node(w,s))
        nodedict[node(w,s)] = (w,s)
        if node(w+b,s) not in nodelist:
            w += b
        elif node(w+a,s) not in nodelist:
            w += a
        else:
            break
        
ansnode = nodedict[max(nodelist)]
print("{} {}".format(ansnode[0],ansnode[1]))

### FIXED CODE ###

def nodef(w,s):
    return (s/(s+w))


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

best_w = 0
best_s = 0
best_node = 0

for i in range(30//a+1):
    for j in range(30//b+1):
        w = 100*(a*i + b*j)
        if w<=f and w:
            max_s = min(f-w,(a*i + b*j)*e)
            for k in range(max_s//c+1):
                l = (max_s-k*c)//d
                s = k*c + l*d
                node = nodef(w,s)
                if node >= best_node and node<=e and w+s<=f:
                    best_w = w
                    best_s = s
                    best_node = node
                    
print("{} {}".format((best_s+best_w ),best_s))