Harryxun/stf_run huggingface dataset:
import numpy as np
n,m = map(int,input().split())
k_and_s = list(list(map(int,input().split()))for i in range(m))
p = list(map(int,input().split()))
k = []
s = []
p1 = np.array(p)
print("p1 = ",p1,"\n")
for i in range(m):
    k.append(k_and_s[i][0:1][0])
    s.append(k_and_s[i][1:])
switch = np.array([[0 for i in range(m)]for i in range(n)])
for i in range(len(s)):
    for j in range(len(s[i])):
        switch[s[i][j]-1][i] = 1
ans = 0
for s in range(1<<n):
    t = 0
    for i in range(n):
        if s>>i & 1 == 0:
            t ^= switch[i]
            print("t = ",t,"\n")
            if t == p1:
                ans +=1
            
print("\nswitch = ",switch,"\n")
print("m = ",m)
print("n = ",n)
print("k and s = ",k_and_s)
print("k = ",k)
print("s = ",s)
print("p = ",p1)
#print(len(s))
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
k_and_s = list(list(map(int,input().split()))for i in range(m))
p = list(map(int,input().split()))

k = []
s = []
switch = list([[0 for i in range(m)]for i in range(n)])
switch_1 = [0 for i in range(n)]
cnt = 0

for i in range(1,len(p)+1):
    if p[i-1] == 1:
        cnt += 2**(m-i)
    if i == m:
        p_1 = cnt

for i in range(m):
    k.append(k_and_s[i][0:1][0])
    s.append(k_and_s[i][1:])

for i in range(len(s)):
    for j in range(len(s[i])):
        switch[s[i][j]-1][i] = 1

for i in range(len(switch)):
    cnt = 0
    for j in range(1,len(switch[i])+1):
        if switch[i][j-1] == 1:
            cnt += 2**(m-j)
        if j == m:
            switch_1[i] = cnt

ans = 0
for i in range(1<<n):
    t = 0
    for j in range(n):
        if i >> j & 1 != 0:
            t ^= switch_1[j]
    if t==p_1:
        ans +=1
print(ans)
n,m=map(int,input().split())
l=list(map(int,input()))
k=sum(l)
if k>n:
    print(-1)
else:
    print(n-k)

### FIXED CODE ###

n,m=map(int,input().split())
l=list(map(int,input().split()))
k=sum(l)
if k>n:
    print(-1)
else:
    print(n-k)
n,m = map(int,input().split())
r={i for i in range(1,n+1)}
for i in range(m):
	l,r = map(int,input().split())
	g = { i for i in range(l,r+1)}
	r = r&g
	if r == {} :
		print(0)
		break
print(len(r))

### FIXED CODE ###


n,m = map(int,input().split())
L = []
R = []
for i in range(m):
	l,r = map(int,input().split())
	L.append(l)
	R.append(r)

l = L[0]
r = R[0]
cnt = 0
for i in range(max(L),min(R)+1) :
	if 0<=i<=r :
		cnt += 1
print(cnt)
a,b,c = map(str, input().split())
d,e,f = map(str, input().split())
if c==d and a==f and b==e:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a = input()
b = input()
if a[2]==b[0] and a[0]==b[2] and a[1]==b[1]:
  print("YES")
else:
  print("NO")
N = int(input())
A = int(input())
B = int(input())

if N == 1:
    print('Hello World')

if N == 2:
    print(A + B)

### FIXED CODE ###

N = int(input())

if N == 1:
    print('Hello World')

else:
     A = int(input())
     B = int(input())
     print(A + B)
S=input()
n=len(S)
ans="Good"
comp=S[0]
for i in (1,n):
  if S[i]==comp:
    ans="Bad"
    break
  comp=S[i]
print(ans)
  

### FIXED CODE ###

S=input()
n=len(S)
ans="Good"
for i in range(1,n):
  if S[i]==S[i-1]:
    ans="Bad"
    break
print(ans)
import sys, os, time, math
import numpy as np
import pandas as pd

import sys, os, time, math
import numpy as np
import pandas as pd
 
 
# print("Start")
N = list(map(str, input().split()))
N = N[0]
# N = np.array(list(map(int, input().split())))
# print(N, K)
# print(N)
 
if (N[0] == "7") or (N[1] == "7") or (N[2] == "7"):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = input()
# N = N[0]
# N = np.array(list(map(int, input().split())))
# print(N, K)
# print(N)
 
if (N[0] == "7") or (N[1] == "7") or (N[2] == "7"):
    print("Yes")
else:
    print("No")
N=input()
now=0
for i in range(0,N):
    lr=(input()).split(' ')
    now=now+((int)(lr[1])-(int)(lr[0])+1)

print(now)

### FIXED CODE ###

N=input()
now=0
for i in range(0,(int)(N)):
    lr=(input()).split(' ')
    now=now+((int)(lr[1])-(int)(lr[0])+1)

print(now)
n, w = map(int, input().split())
x = []
y = []

for i in range(n):
  a,b = map(int, input().split())
  x.append(b)
  y.append(a)

dp = [[0] * (w + 1) for i in range(n + 1)]

for i in range(n):
  for j in range(w + 1):
    if(j >= y[i]):
      dp[i + 1][j] = max(dp[i][j], dp[i][j - y[i]] + x[i])
    else:
      dp[i + 1][j] = dp[i][j]

print(dp[n][w])


### FIXED CODE ###

n, w = map(int, input().split())
x = []
y = []

for i in range(n):
  a,b = map(int, input().split())
  x.append(b)
  y.append(a)

max_num = sum(x)

dp = [[float("inf")] * (max_num + 1) for i in range(n + 1)]
dp[0][0] = 0

for i in range(n):
  for j in range(max_num + 1):
    if(j >= x[i]):
      dp[i + 1][j] = min(dp[i + 1][j], dp[i][j - x[i]] + y[i])
    dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
    
print(max(list(int(i) for i in range(max_num + 1) if dp[n][i] <= w)))
n = int(input())
base = list(map(int,input().split()))
even = [0]*(10**5)
odd = [0]*(10**5)

for i in range(1,n+1):
  sign = i%2
  num = base[i-1]
  
  if sign == 0:
    even[num] += 1
  elif sign == 1:
    odd[num] += 1

ans_e = max(even)
ans_o = max(odd)
even_i = even.index(ans_e)
odd_i = odd.index(ans_o)

if even_i == odd_i:
  even.sort()
  odd.sort()
  if even[10*5 - 2] <= odd[10*5 - 2]:
    ans_o = odd[10**5 - 2]
  else:
    ans_e = even[10**5 - 2]
  
print(n - ans_e - ans_o)

### FIXED CODE ###

n = int(input())
base = list(map(int,input().split()))
even = [0]*(10**5)
odd = [0]*(10**5)

for i in range(1,n+1):
  sign = i%2
  num = base[i-1]
  
  if sign == 0:
    even[num-1] += 1
  elif sign == 1:
    odd[num-1] += 1

ans_e = max(even)
ans_o = max(odd)
even_i = even.index(ans_e)
odd_i = odd.index(ans_o)

if even_i == odd_i:
  even.sort()
  odd.sort()
  if even[10**5 - 2] <= odd[10**5 - 2]:
    ans_o = odd[10**5 - 2]
  else:
    ans_e = even[10**5 - 2]
  
print(n - ans_e - ans_o)
A,B,N = map(int, input().split())

if N < B:
  floor = int(A*N/B) - A*int(N/B)
else:
  floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
print(floor)

### FIXED CODE ###

A,B,N = map(int, input().split())
if B == 1 or A == 1:
  floor = 0
else:
  if N < B:
    floor = int(A*N/B) - A*int(N/B)
  elif N == B:
    floor = int(A*(N-1)/B) - A*int((N-1)/B)
  else:
    floor = max([(int(A*(x-1)/B) - A*int((x-1)/B)) for x in range(B,N,B)])
    
print(floor)
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()

limit = sum(range(1, N-1))

# print(list(combinations(range(1, N+1),2)))
if K > limit:  # むり
	print(-1)
else:  # いける
	edge = list(combinations(range(1, N+1),2))
	for i in range(K):
		if edge[i][1] == N:
			continue
		else:
			edge.pop(0)

	print(N*(N-1)//2 - K)
	for u, v in edge:
		print(u, v)


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()

limit = sum(range(1, N-1))

if K > limit:  # むり
	print(-1)
else:  # いける
	edge = list(combinations(range(1, N+1),2))
	if K == 0:
		print(N*(N-1)//2)
		for u, v in edge:
			print(u, v)
	else:	
		rem = []
		count = 0
		for i in edge:
			if i[1] != N:
				rem.append(i)
				count += 1
				if count == K:
					break
		for i in rem:
			edge.remove(i)

		print(N*(N-1)//2 - K)
		for u, v in edge:
			print(u, v)
import numpy as np
h,w=map(int,input().split())
S=np.array([list(input()) for _ in range(h)])
S=np.where(S==".",1,0)

left,right,up,down=[np.zeros((h,w)) for _ in range(4)]
for i in range(w):
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[i,-i-1]
for i in range(h):
    up[i]=(up[i-1]+1)*S[i]
    down[-i-1]=(down[-i]+1)*S[-i-1]

print(np.max(left+right+up+down)-3)

### FIXED CODE ###

import numpy as np
h,w=map(int,input().split())
S=np.array([list(input()) for _ in range(h)])
S=np.where(S==".",1,0)

left,right,up,down=[np.zeros((h,w),dtype=np.int64) for _ in range(4)]
for i in range(w):
    left[:,i]=(left[:,i-1]+1)*S[:,i]
    right[:,-i-1]=(right[:,-i]+1)*S[:,-i-1]
for i in range(h):
    up[i]=(up[i-1]+1)*S[i]
    down[-i-1]=(down[-i]+1)*S[-i-1]

print(int(np.max(left+right+up+down)-3))
n, h,  *ab = map(int, open(0).read().split())
a = ab[::2]
x = max(a)
b = sorted([i for i in ab[1**2] if i > x], reverse=1)
ans = 0
for i in b:
    ans += 1
    h -= i
    if h <= 0:
        break
ans += (h + x - 1) // x
print(ans)


### FIXED CODE ###

n, h = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(n)]
A,B = zip(*AB)
a = max(A)
B = [b for b in B if b > a]
B.sort(reverse=True)
ans = 0
hp = h
attack_cnt = 0
for b in B:
    if hp <= 0:
        break
    attack_cnt += 1
    hp -= b
if hp > 0:
    attack_cnt += (hp - 1) // a + 1
print(attack_cnt)
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
N=int(input())
#N, L=input().split()
#S=input()
#T=input()
#S_list=list(S)
a_list=  list(map(int, input().split(" ")))
j=0
times=0
for i in range(N):
# print(i,j,times, a_list)

 if a_list[j]==j+1:
     j=j+1
     if j==len(a_list):
         print(times)
         sys.exit()

 #if a_list[i]==i+1:
 #i=j
 #print(i, a_list)
 #if i+1==len(a_list):
#    print(times)
#    sys.exit()
 if a_list[j]!=j+1:
     a_list.pop(j)
     #j=i
     #i=j
     times+=1
     if len(a_list)==0:
      print(-1)
      sys.exit()
     #elif j+1==len(a_list):
     #print(times)
    #     sys.exit()

#     elif
print(times)


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
i=0
N=int(input())
#N, L=input().split()
#S=input()
#T=input()
#S_list=list(S)
a_list=  list(map(int, input().split(" ")))
j=0
times=0

for i  in range(N):
    if a_list[i]==i-times+1:
       pass
    else:
       times=times+1

if times==len(a_list):
    print(-1)
    sys.exit()
print(times)



#for i in range(N):
# print(i,j,times, a_list)

 #if a_list[j]==j+1:
#     j=j+1
#     if j==len(a_list):
#         print(times)
#         sys.exit()

 #if a_list[i]==i+1:
 #i=j
 #print(i, a_list)
 #if i+1==len(a_list):
#    print(times)
#    sys.exit()
# if a_list[j]!=j+1:
#     a_list.pop(j)
     #j=i
     #i=j
#     times+=1
#     if len(a_list)==0:
#      print(-1)
#      sys.exit()
     #elif j+1==len(a_list):
     #print(times)
    #     sys.exit()

#     elif
#print(times)
#
def resolve():
    # 整数 1 つ
    n = str(input().rstrip())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    n[3] = "8"

    print(n)

resolve()

### FIXED CODE ###


def resolve():
    # 整数 1 つ
    n = input()
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]
    m = n[:3] + "8" + n[4:]

    print(m)


resolve()
import sys
input=sys.stdin.buffer.readline
#from collections import defaultdict
#d = defaultdict(int)
#import fractions
#import math
#import collections
#from collections import deque
#from bisect import bisect_left
#N = int(input())
#A = list(map(int,input().split()))
#S = list(input())
#S.remove("\n")
#N,M = map(int,input().split())
#S,T = map(str,input().split())
#A = [int(input()) for _ in range(N)]
#S = [input() for _ in range(N)]
#A = [list(map(int,input().split())) for _ in range(N)]
#import itertools
def primes(n):#nまでの素数を列挙
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2,int(n**(0.5)+1)):
        if not is_prime[i]:
            continue
        for j in range(i*2,n+1,i):
            is_prime[j] = False
    return [i for i in range(n+1) if is_prime[i]]
A,B = map(int,input().split())
if A == 1 or B == 1:
    print(1)
else:
    m = min(A,B)
    pr = primes(m)
    c = 0
    if len(pr)==0:
      print(1)
    for i in pr:
        if A%i == 0 and B%i == 0:
            c += 1
    print(c+1)


### FIXED CODE ###


"""nを素因数分解"""
"""2以上の整数n => [(素因数, 指数), ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(n**0.5)+1):
        if temp%i == 0:
            cnt = 0
            while temp%i == 0:
                cnt += 1
                temp //= i
            arr.append((i, cnt))
    if temp != 1:
        arr.append((temp, 1))
    if arr == []:
        arr.append((n, 1))
    return arr

import fractions
a, b = map(int, input().split())
li = factorization(fractions.gcd(a, b))

if li[0][0] == 1:
    print(1)
else:
    print(len(li)+1)
N, K = map(int, input().split())
c = 0
n = 1
List = []
for i in range(1,K):
  d = int(input())
  m = int(input())
  List.append(m)
for I in range(1,N):
  if n in List:
    n = n+1
  else:
    c = c+1
    n = n+1
print(c)

### FIXED CODE ###

def resolve():
    N, K = map(int, input().split())
    A = []
    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A.extend(a)
    print(N - len(set(A)))
resolve()
n=int(input())
m=[[] for i in range(n)]
for i in range(n-1):
    a,b,c=map(int, input().split())
    m[a-1].append([b-1,c])
    m[b-1].append([a-1,c])
q,k=map(int, input().split())
    
def reach(m,d,k):
    for i in m[k]:
        if d[i[0]]==-1:
            d[i[0]]=d[k]+i[1]
            reach(m,d,i[0])
d=[-1]*n
d[k-1]=0
reach(m,d,k-1)

for i in range(q):
    x,y=map(int, input().split())
    print(d[x-1]+d[y-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

n=int(input())
m=[[] for i in range(n)]
for i in range(n-1):
    a,b,c=map(int, input().split())
    m[a-1].append([b-1,c])
    m[b-1].append([a-1,c])
q,k=map(int, input().split())
    
def reach(m,d,k):
    for i in m[k]:
        if d[i[0]]==-1:
            d[i[0]]=d[k]+i[1]
            reach(m,d,i[0])
d=[-1]*n
d[k-1]=0
reach(m,d,k-1)

for i in range(q):
    x,y=map(int, input().split())
    print(d[x-1]+d[y-1])
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    N = int(input())
    A = list(map(int, input().split()))

    #output
    from collections import Counter
    M = max(A) + 1
    B = [True] * (M)
    A = sorted(A)
    C = Counter(A)

    answer = 0
    for a in A:
        if C[a] > 1:
            continue
        elif B[a]:
            answer += 1
            for j in range(a, M+1, a):
                B[j] = False

    print(answer)

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()

### FIXED CODE ###

#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    N = int(input())
    A = list(map(int, input().split()))

    #output
    from collections import Counter
    M = max(A) + 1
    B = [True] * (M+1)
    A = sorted(A)
    C = Counter(A)

    answer = 0
    for a in A:
        if B[a]:
            for j in range(a, M, a):
                B[j] = False
            if C[a] > 1:
                continue
            else:
                answer += 1

    print(answer)

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()
S = input()
K = input()
s = len(str(S))
i=0

while i < s-1:
  if S[i] == '1':
    i = i + 1
  else:
    break
if int(K) > i:
  print(S[k])
else:
  print(1)

### FIXED CODE ###

S = input()
K = int(input())
s = len(str(S))
i=0

while i < s-1:
  if S[i] == '1':
    i = i + 1
  else:
    break

if K > i:
  print(S[i])
else:
  print(1)
s = list(map(int,input()))
#print(s)
bool =True
x =0
cnt = 0
while bool:
    if  1  not in s or 0 not in s:
        #print('finA')
        break
    if len(s)>=2 and x==len(s)-1:
        x=0
    else:
        if s[x]==1 and s[x+1]==0:
            s.pop(x+1)
            s.pop(x)
            cnt+=2
            #print(len(s))
            #print(s)
            if len(s)<=1:
                #print('finB')
                break
        if s[x]==0 and s[x+1]==1:
            s.pop(x+1)
            s.pop(x)
            cnt+=2
            #print(len(s))
            #print(s)
            if len(s)<=1:
                #print('finC')
                break
        else:
            x+=1
print(cnt)

### FIXED CODE ###

s = list(map(int,input()))
if  1  not in s or 0 not in s:
    print(0)
    exit()
print(2*min(s.count(0),s.count(1)))
def solver():
  a = input().rstrip('\n').split('/')
  if int(a[0]) >= 2019:
  	if int(a[1]) >= 4:
  		if int(a[2]) >= 30:
          print('TBD')
  else:
    print('Heisei')
    
solver()

### FIXED CODE ###

def solver():
	a = input().rstrip('\n').split('/')
	if int(a[0]) > 2019:
		print('TBD')
	elif int(a[0]) < 2019:
		print('Heisei')
	else:
		if int(a[1]) > 4:
			print('TBD')
		elif int(a[1]) < 4:
			print('Heisei')
		else:
			if int(a[2]) > 30:
				print('TBD')
			elif int(a[2]) < 30:
				print('Heisei')
			else:
				print('Heisei')

solver()
import math
print(math.ceil(a/2+b/2))

### FIXED CODE ###

import math
a,b=map(int,input().split())
print(math.ceil(a/2+b/2))
r=int(input())
g=int(input())
b=int(input())
num=100*r+10*g+b
if num%4==0:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

r,g,b=(int(x) for x in input().split())

num=100*r+10*g+b
if num%4==0:
    print("YES")
else:
    print("NO")
A, B = list(map(int, input().split()))
result = (A+B)/2 if (A+B)%2 == 0 else "IMPOSSIBLE"
print(int(result))


### FIXED CODE ###

A, B = list(map(int, input().split()))
result = (A+B)//2 if (A+B)%2 == 0 else "IMPOSSIBLE"
print(result)
#a,bの入力
a=int(input())
b=int(input())
#a,bの積を演算する
a_to_b_no_seki=a*b
#a,b,の積を2で割った余りを計算し、余りが0なら偶数と出力、1なら奇数と出力
if a_to_b_no_seki%2==0:
    print("Even")
else:
    print("Odd")


### FIXED CODE ###

#a,bの入力
a,b=map(int,input().split())
#a,bの積を演算する
a_to_b_no_seki=a*b
#a,b,の積を2で割った余りを計算し、余りが0なら偶数と出力、1なら奇数と出力
if a_to_b_no_seki%2==0:
    print("Even")
else:
    print("Odd")
x,y = map(int, input().split())
if x==2:
  print('No')
elif x==4 or x==6 or x==9 or x==11
  if y==6 or y==9 or y==11:
    print('Yes')
  else: print('No')
else:
  if y==3 or y==5 or y==7 or y==8 or y==10 or y==12:
    print('Yes')
  else: print('No')

### FIXED CODE ###

x,y = map(int, input().split())
if x==2:
  print('No')
elif x==4 or x==6 or x==9 or x==11:
  if y==6 or y==9 or y==11:
    print('Yes')
  else: print('No')
else:
  if y==3 or y==5 or y==7 or y==8 or y==10 or y==12:
    print('Yes')
  else: print('No')
S=input()
print(7 if S==SUN 6 if S==MON 5 if S==TUE 4 if S==WED 3 if S==THU 2 if S==FRI 1 if S==SAT

### FIXED CODE ###

S=input()
if S=="SUN":
  print(7)
if S=="MON":
  print(6)
if S=="TUE":
  print(5)
if S=="WED":
  print(4)
if S=="THU":
  print(3)
if S=="FRI":
  print(2)
if S=="SAT":
  print(1)
r=int(input())
data1=1200
dara2=2800
name=('ABC', 'ARC', 'AGC')
if r<data1:
  print(name[0])
elif data1<=r<data2:
  print(name[1])
else:
  print(name[2])
  



### FIXED CODE ###

r=int(input())

name=('ABC', 'ARC', 'AGC')
if r<1200:
  print(name[0])
elif 1200<=r<2800:
  print(name[1])
else:
  print(name[2])
n, l = map(int, input().split())
s = []
for _ in range(n):
    s.append(input())
s = sorted(s)
print(''.join(s))


### FIXED CODE ###

a = [int(x) for x in input().split()]
countF = 0
countS = 0
for i in range(3):
    countF += a[i] == 5
    countS += a[i] == 7
if countF == 2 and countS == 1:
    print('YES')
else:
    print('NO')
N = int(input())
flag = False
memo = {}
for a in range(1,3500)[::-1]:
    for b in range(1,3500)[::-1]:
        if (a,b) not in memo:
            memo[(b,a)] = True
            if (N*a*b)%(4*a*b -N*n - N*b) == 0:
                c = int((N*a*b)/(4*a*b -N*n - N*b))
                flag = True
                break
        else:
            continue
    if flag:
        break
print(a,b,c)

### FIXED CODE ###

N = int(input())
for h in range(1, 3501):
    for n in range(1, 3501):
        a = 4 * h * n - h * N - n * N
        if a == 0:
            break
        w = int((h * n * N) / a)
        if w > 0 and 4 / N == 1 / h + 1 / n + 1 / w:
            print(h, n, w)
            exit()
N = input()
l = len(N)

if N[i::] == '9'*(l-1):
    print(int(N[0])+9*(l-1))
else:
    print(int(N[0])-1+9*(l-1))

### FIXED CODE ###

N = input()
l = len(N)

if N[1::] == '9'*(l-1):
    print(int(N[0])+9*(l-1))
else:
    print(int(N[0])-1+9*(l-1))
s = input()

s = sorted()

if s == "abc":
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()
s = sorted(s)

if ''.join(s) == "abc":
    print("Yes")
else:
    print("No")
n = int(input())

if n%9 == 0:
    if n//9 <10:
        print(Yes)
    else:
        print(No)
elif n%8 == 0:
    if n//8 < 9:
        print(Yes)
    else:
        print(No)
elif n%7 == 0:
    if n//7 <8:
        print(Yes)
    else:
        print(No)
elif n%6 == 0:
    if n//6 <7:
        print(Yes)
    else:
        print(No)
elif n%5 == 0:
    if n//5 <6:
        print(Yes)
    else:
        print(No)
elif n%4 == 0:
    if n//4 <5:
        print(Yes)
    else:
        print(No)
elif n<9:
    print(Yes)
else:
    print(No)


### FIXED CODE ###

n = int(input())

if n%9 == 0:
    if n//9 <10:
        print("Yes")
    else:
        print("No")
elif n%8 == 0:
    if n//8 < 9:
        print("Yes")
    else:
        print("No")
elif n%7 == 0:
    if n//7 <8:
        print("Yes")
    else:
        print("No")
elif n%6 == 0:
    if n//6 <7:
        print("Yes")
    else:
        print("No")
elif n%5 == 0:
    if n//5 <6:
        print("Yes")
    else:
        print("No")
elif n%4 == 0:
    if n//4 <5:
        print("Yes")
    else:
        print(No)
elif n<9:
    print("Yes")
else:
    print("No")
_ = int(input())

num_list = list(map(int, input().split()))

count = 0
is_all_even = None 
while True:
    for num in num_list:
        if num % 2 != 0:
            is_all_even = False
            break
    if is_all_even is not None:
        break
    count += 1
    num_list = list(map(lambda x: x / 2, num_list))
print(count)







### FIXED CODE ###

num = input()
cnt = 0
for i in num:
    if i == "1":
        cnt += 1
print(cnt)
n = int(input())
h = [input() for i in range(n)]

ans = 0

for i in range(n):
    if max(h[0:i]) >= h[i] and h[0] >= h[i]:
        ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))

cnt = 0
for i in range(len(H)):
    if (max(H[0:i+1]) == H[i]):
        cnt += 1

print(cnt)
N, M = map(int, input().split())
list=[]
s=[]
if N = 1:
    print(len(input())-1)
else:
    for i in range(N):
        list.append(input().split())
        s = set(s) & set(list[1:])
        list=[]
    print(len(s)) 

### FIXED CODE ###

N, M = map(int, input().split())
list=[]
s=set(range(1, M+1))
for i in range(N):
    K, *A = map(int, input().split())
    s &= set(A)
print(len(s))
x = int(input())
if x ==　1:
    ans = 0
else:
    ans = 1
print(ans)

### FIXED CODE ###

x = int(input())
if x == 1:
    ans = 0
else:
    ans = 1
print(ans)
a=list(input().split())
a="".join(a)
count=0
for i in range(3):
    
    if a[i]=='R':
        count+=1
        ans=count
    else:
        count=0
       
        
print(ans)

### FIXED CODE ###

n=input()
n="".join(n)
c,ans=0,0
for i in range(3):
    if n[i]=="R":
        c+=1
        ans=c
    else:
        c=0
        
print(ans)