Harryxun/stf_run huggingface dataset:
from collections import defaultdict as dd
import queue
import numpy as np
import sys
input = sys.stdin.readline
N, M, K = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(M)]
cd = [tuple(map(int,input().split())) for _ in range(K)]
dic = dd(list)
for (a,b) in ab:
    dic[str(a)].append(b)
    dic[str(b)].append(a)
seen = set()
def BFS(dic,node):
    cc = set()
    q = queue.Queue()
    q.put(node)
    cc.add(node)
    while not q.empty():
        now_node = q.get()
        cc.add(now_node)
        target = set(dic[str(now_node)]) - cc
        for tgt in target:
            q.put(tgt)
    return cc
c_comp=np.zeros((N),dtype='int32')
len_ls = []
var = 1
for i in range(1,N+1):
    if c_comp[i-1] == 0:
        # 連結判定
        tmp = BFS(dic,i)
        c_comp[np.array(list(tmp))-1] = var
        len_ls.append(len(tmp)-1)
        var += 1

if N>=1000:
    assert()
for (a,b) in cd:
    if c_comp[a-1] == c_comp[b-1]:
        dic[str(a)].append(str(b))
        dic[str(b)].append(str(a))
res = [0]*N

for i in range(N):
    res[i] = len_ls[c_comp[i]-1] - len(dic[str(i+1)])
print(*res)


### FIXED CODE ###

from collections import defaultdict as dd
import queue
import sys
input = sys.stdin.readline
N, M, K = map(int,input().split())
ab = [tuple(map(int,input().split())) for _ in range(M)]
cd = [tuple(map(int,input().split())) for _ in range(K)]
dic = dd(list)
for (a,b) in ab:
    dic[str(a)].append(b)
    dic[str(b)].append(a)
uf = [-1]*N
def BFS(ufid, dic, node):
    leng = -1
    q = queue.Queue()
    q.put(node)
    while not q.empty():
        now_node = q.get()
        if uf[now_node-1] > 0:
            continue
        leng += 1
        uf[now_node-1] = ufid
        target = [val for val in dic[str(now_node)] if uf[val-1]==-1]
        for tgt in target:
            q.put(tgt)
            uf[tgt-1] = 0
    return leng

len_ls = []
var = 1
for i in range(N):
    if uf[i] == -1:
        # 連結判定
        leng = BFS(var, dic, i+1)
        len_ls.append(leng)
        var += 1
for (a,b) in cd:
    if uf[a-1] == uf[b-1]:
        dic[str(a)].append(b)
        dic[str(b)].append(a)
res = [len_ls[uf[i]-1] - len(dic[str(i+1)]) for i in range(N)]
print(*res)
# B - Two Colors Card Game
from collections import Counter
n = int(input())
n_dict = {}
for _ in range(n):
    ns = str(input())
    if ns not in n_dict.keys():
        n_dict[ns] = 1
    else:
        n_dict[ns] += 1

m = int(input()
m_dict = {}
for _ in range(n):
    ms = str(input())
    if ms not in m_dict.keys():
        n_dict[ms] = 1
    else:
        n_dict[ms] += 1

delta = dict(Counter(n_dict) - Counter(m_dict))
ans = max(delta.values())
print(ans)

### FIXED CODE ###

# B - Two Colors Card Game
from collections import Counter
n = int(input())
n_dict = {}
for _ in range(n):
    ns = str(input().split())
    if ns not in n_dict.keys():
        n_dict[ns] = 1
    else:
        n_dict[ns] += 1

m = int(input())
m_dict = {}
for _ in range(m):
    ms = str(input().split())
    if ms not in m_dict.keys():
        m_dict[ms] = 1
    else:
        m_dict[ms] += 1

delta = dict(Counter(n_dict) - Counter(m_dict))
if len(delta)>0:
  ans = max(delta.values())
else:
  ans = 0
print(ans)
N,M=map(int,input().split())
P=[[] for i in range(M)]
Y=[1 for i in range(M)]
id=[0 for i in range(M)]
for i in range(M):
    a,b=map(int,input().split())
    P[i].append(i)
    P[i].append(a)
    P[i].append(b)
P.sort(key=lambda x:x[2])
for i in range(M):
    P[i].append(str(P[i][1]*1000000+Y[P[i][1]]))
    Y[P[i][1]]+=1
P.sort(key=lambda x:x[0])
for i in range(M):
    print(P[i][3].zfill(12))


### FIXED CODE ###

N,M=map(int,input().split())
P=[[] for i in range(M)]
Y=[1 for i in range(N+1)]
for i in range(M):
    a,b=map(int,input().split())
    P[i].append(i)
    P[i].append(a)
    P[i].append(b)
P.sort(key=lambda x:x[2])
for i in range(M):
    P[i].append(str(P[i][1]*1000000+Y[P[i][1]]))
    Y[P[i][1]]+=1
P.sort(key=lambda x:x[0])
for i in range(M):
    print(P[i][3].zfill(12))
import numpy as np

h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
np_ab = np.array(ab)

max_a = max(np_ab[:, 0])
dp = [0] * (h + max_a)

for i in range(1, h + max_a):
    dp[i] = min(dp[i - a] + b for a, b in ab)

print(dp[h])


### FIXED CODE ###

import sys

H, N = map(int, input().split())
A = [0] * N
B = [0] * N

for i in range(N):
    a, b = map(int, sys.stdin.readline().rstrip().split())
    A[i] = a
    B[i] = b

max_A = max(A)
INF = 10**18
dp = [INF] * (H + max_A)
dp[0] = 0

for i in range(H):
    for j in range(N):
        dp[i + A[j]] = min(dp[i] + B[j], dp[i + A[j]])

print(min(dp[H:H + max_A]))
H, W = map(int, input().split())

List = list(range(W))
count = 0

for i in range(W):
    if List[i]%2 == 0:
      count +=1

if W%2 ==0:
  Answer = count*H
else:
  if H%2 ==0:
    Answer = count*H - H/2
  else:
    Answer = count*(H-1) - (H-1)/2 + count

print(Answer)


### FIXED CODE ###

H, W = map(int, input().split())

if H==1 or W==1:
  Answer =1

elif W%2 ==0:
  Answer = W/2*H
  
else:
  count = (W-1)/2 +1
  if H%2 ==0:
    Answer = count*H - H/2
  else:
    Answer = count*H - (H-1)/2

print(int(Answer))
from itertools import product
from collections import Counter
 
n, c = map(int, input().split())
color_costs = [list(map(int, input().split())) for _ in range(c)]
matrix = [list(map(int, input().split())) for _ in range(n)]
 
colord = {(i, j):cost for i, row in enumerate(color_costs)
                      for j, cost in enumerate(row)}
 
res = []
for n in range(3):
  color_count = Counter(c-1 for i, row in enumerate(matrix) 
                            for j, c in enumerate(row) 
                            if (i + j) % 3 == n)
  def color_cost(color):
    return sum(colord[ccolor, color] * ccount for ccolor, ccount in color_count.items())
  cx = [(color, color_cost(color)) for color in range(c)]
  sorted_by_cost = sorted(cx, key=lambda x:x[1])
  cheapest3 = sorted_by_cost[:3]
  res.append(cheapest3)
 
color_pickss = product(*res)
filtered_unique = (picks for picks in color_pickss if len(set(x[0] for x in picks)) == 3)
costs = (sum(x[1] for x in picks) for pick in filtered_unique)
print(min(costs))
from itertools import product
from collections import Counter
 
n, c = map(int, input().split())
color_costs = [list(map(int, input().split())) for _ in range(c)]
matrix = [list(map(int, input().split())) for _ in range(n)]

colord = {(i, j):cost for i, row in enumerate(color_costs)
                      for j, cost in enumerate(row)}
 
res = []
for n in range(3):
  color_count = Counter(c-1 for i, row in enumerate(matrix) 
                            for j, c in enumerate(row) 
                            if (i + j) % 3 == n)
  def color_cost(color):
    return sum(colord[ccolor, color] * ccount for ccolor, ccount in color_count.items())
  cx = [(color, color_cost(color)) for color in range(c)]
  sorted_by_cost = sorted(cx, key=lambda x:x[1])
  cheapest3 = sorted_by_cost[:3]
  res.append(cheapest3)

color_pickss = product(*res)
filtered_unique = (picks for picks in color_pickss if len(set(x[0] for x in picks)) == 3)
costs = (sum(x[1] for x in picks) for picks in filtered_unique)
print(min(costs))

### FIXED CODE ###

from itertools import product
n, c = map(int, input().split())
color_costs = [map(int, input().split()) for _ in range(c)]
matrix = [map(int, input().split()) for _ in range(n)]
colord = {(i+1, j+1):cost for i, row in enumerate(color_costs)
                         for j, cost in enumerate(row)}
 
cellgroups = [[] for _ in range(3)]
for i, row in enumerate(matrix):
  for j, color in enumerate(row):
    cellgroups[(i+1+j+1)%3].append(color)
  
cc = [[(color, sum(colord[cellcolor, color] for cellcolor in cells))
	       									for color in range(1,c+1)]
      										for cells in cellgroups]
 
dd = [sorted(xs, key=lambda x:x[1])[:3] for xs in cc]
ee = (a[1]+b[1]+c[1] for a, b, c in product(*dd) if len(set((a[0], b[0], c[0]))) == 3)
print(min(ee))
n,w = map(int,input().split())
wv=[]
for _ in range(n):
  w,v=map(int,input().split())
  wv.append([w,v])

dp=[[0 for i in range(w+1)]for j in range(n+1)]
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-h[i]<0:
      dp[i][j]=dp[i-1][j]
    else:
      dp[i][j]=max(dp[i-1][j-wv[i][0]],dp[i-1][j])

print(dp[n][w])

### FIXED CODE ###

n,w=map(int,input().split())
P=[]
for _ in range(n):
  iw,iv=map(int,input().split())
  P.append([iw,iv])
INF=float('inf')
 
dp=[[0 for i in range(w+1)] for j in range(n+1)]
 
for i in range(1,n+1):
  for j in range(1,w+1):
    if j-P[i-1][0]>=0:
      dp[i][j]=max(dp[i-1][j],dp[i-1][j-P[i-1][0]]+P[i-1][1])
    else:
      dp[i][j]=dp[i-1][j]
print(dp[n][w])
h = 1
w = 1
while True:
	nums = list(map(int, input().split(" ")))
	if h == 0 and w == 0:
		break
	h = nums[0]
	w = nums[1]

	for i in range(h):
		for j in range(w):
			print("#", end="")
		print("")
	
	print("")


### FIXED CODE ###

while True:
	nums = list(map(int, input().split(" ")))
	h = nums[0]
	w = nums[1]
	if h == 0 and w == 0:
		break

	for i in range(h):
		for j in range(w):
			print("#", end="")
		print("")
	
	print("")
import math
import sys

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


if X < A * 1 + B:
    print(0)
    exit(0)
for i in range(1,10): 
    if X < A * 10**i  + B * (i+1) : 
        print ( (X - B * i)  // A )
        exit(0)

print(10**9)

### FIXED CODE ###

import math
import sys

S=input()

if S == "SUN":
    print(7)
elif S == "MON":
    print(6)
elif S == "TUE":
    print(5)
elif S == "WED":
    print(4)
elif S == "THU":
    print(3)
elif S == "FRI":
    print(2)
elif S == "SAT":
    print(1)
from numpy import gcd, sqrt
m = gcd(a,b)
cnt = 1
print(1)
for i in range(2, int(sqrt(m))+1):
    div = False
    while m%i == 0:
        div = True
        m = m//i
    if div:
        cnt += 1
        print(i)
    if m == 1:
        break
if m > 1:
    cnt += 1
    print(m)
print(cnt)

### FIXED CODE ###

a, b = map(int, input().split())
from fractions import gcd
from numpy import sqrt
m = gcd(a,b)
cnt = 1
for i in range(2, int(sqrt(m))+1):
    div = False
    while m%i == 0:
        div = True
        m = m//i
    if div:
        cnt += 1
    if m == 1:
        break
if m > 1:
    cnt += 1
print(cnt)
import sys
#from functools import lru_cache
sys.setrecursionlimit(100000)

N = int(input())
H = [int(h) for h in input().split()]
INF = 10**4+1
cost = [INF]*N
cost[0] = 0
cost[1] = abs(H[0] - H[1])

#@lru_cache(maxsize=None)
def dp(i):
  if cost[i] != INF:
    return cost[i]
  else:
    cost[i] = min(
      dp(i-1) + abs(H[i-1] - H[i]),
      dp(i-2) + abs(H[i-2] - H[i]))
  return cost[i]

print(dp(N-1))

### FIXED CODE ###

import sys
#from functools import lru_cache
sys.setrecursionlimit(100000)

N = int(input())
H = [int(h) for h in input().split()]
INF = 10**5+1
cost = [INF]*N
cost[0] = 0
cost[1] = abs(H[0] - H[1])

#@lru_cache(maxsize=None)
def dp(i):
  if cost[i] != INF:
    return cost[i]
  else:
    cost[i] = min(
      dp(i-1) + abs(H[i-1] - H[i]),
      dp(i-2) + abs(H[i-2] - H[i]))
  return cost[i]

for i in range(N-1):
  dp(i)
print(dp(N-1))
n,*a=map(int,open(0).read().split())

ans=0
x=a[0]
if a[1]>a[0]:
  mode=0
else:
  mode=1
for s in a:
#  print(x,s,mode,ans)
  if x<s and mode==0:
    ans+=1
    mode=1
  elif x>s and mode==1:
    ans+=1
    mode=0
  x=s
print(ans//2+1)

### FIXED CODE ###

n,*a=map(int,open(0).read().split())
tmp=0
ans=1
for i in range(len(a)-1):
    dif=a[i+1]-a[i]
    if tmp==0:
        tmp=dif
    elif dif*tmp<0:
        ans+=1
        tmp=0

print(ans)
import numpy as np
N = int(input())

xyh = []
for _ in range(N):
    xyh.append(list(map(int, input().split())))
xyh = np.array(xyh)
xyh = xyh[np.argsort(xyh[:, 2])[::-1]]

cxylist = [[i, j] for i in range(101) for j in range(101)]

Hdict = [[] for i in range(101)]
for i in range(len(cxylist)):
    x, y, h =xyh[0]
    H = h + abs(x-cxylist[i][0]) + abs(y-cxylist[i][1])
    Hdict[cxylist[i][0]].append(H)

def calh(cxylist, x, y, h):
    newcxylist = []
    for i in range(len(cxylist)):
        cx, cy = cxylist[i]
        H = h + abs(x-cx) + abs(y-cy)
        if Hdict[cx][cy] == H:
            newcxylist.append([cx, cy])
    return newcxylist

def checkh(cxylist, x, y):
    newcxylist = []
    for i in range(len(cxylist)):
        cx, cy = cxylist[i]
        if Hdict[cx][cy] - abs(x-cx) - abs(y-cy) <= 0:
            newcxylist.append([cx, cy])
    return newcxylist

for n in range(N-1):
    if xyh[n][2] != 0:
        cxylist = calh(cxylist, xyh[n+1][0], xyh[n+1][1], xyh[n+1][2])
    else:
        cxylist = checkh(cxylist, xyh[n+1][0], xyh[n+1][1])

print(cxylist[0][0], cxylist[0][1], Hdict[cxylist[0][0]][cxylist[0][1]])


### FIXED CODE ###

import numpy as np
N = int(input())

xyh = []
for _ in range(N):
    xyh.append(list(map(int, input().split())))
xyh = np.array(xyh)
xyh = xyh[np.argsort(xyh[:, 2])[::-1]]

cxylist = [[i, j] for i in range(101) for j in range(101)]

Hdict = [[] for i in range(101)]
for i in range(len(cxylist)):
    x, y, h =xyh[0]
    H = h + abs(x-cxylist[i][0]) + abs(y-cxylist[i][1])
    Hdict[cxylist[i][0]].append(H)

def calh(cxylist, x, y, h):
    newcxylist = []
    for i in range(len(cxylist)):
        cx, cy = cxylist[i]
        H = h + abs(x-cx) + abs(y-cy)
        if Hdict[cx][cy] == H:
            newcxylist.append([cx, cy])
    return newcxylist

def checkh(cxylist, x, y):
    newcxylist = []
    for i in range(len(cxylist)):
        cx, cy = cxylist[i]
        if Hdict[cx][cy] - abs(x-cx) - abs(y-cy) <= 0:
            newcxylist.append([cx, cy])
    return newcxylist

for n in range(N-1):
    if xyh[n+1][2] != 0:
        cxylist = calh(cxylist, xyh[n+1][0], xyh[n+1][1], xyh[n+1][2])
    else:
        cxylist = checkh(cxylist, xyh[n+1][0], xyh[n+1][1])

print(cxylist[0][0], cxylist[0][1], Hdict[cxylist[0][0]][cxylist[0][1]])
from collections import deque


max_n = 11000
dp = [-1] * max_n  # -1を未探索とする
dp[0] = 0  # 初期条件の設定
n = int(input())
que = deque([])
que.append(dp[0])
while que:
    v = que.popleft()
    pow = 1
    while v + pow <= n:
        if dp[v + pow] == -1:
            dp[v + pow] = dp[v] + 1
            que.append(v + pow)
        pow *= 6
    pow = 1
    while v + pow <= n:
        if dp[v + pow] == -1:
            dp[v + pow] = dp[v] + 1
            que.append(v + pow)
        pow *= 9
# print(dp)
print(dp[n])


### FIXED CODE ###

n = int(input())
dp = [0 for _ in range(n+1)]
for i in range(1, n+1):  # iは金額
    dp[i] = i  # 初期化
    power = 1  # 累乗を初期化
    while power <= i:  # 累乗より小さい値の時はループに入る
        dp[i] = min(dp[i], dp[i - power] + 1)  # 漸化式
        power *= 6  # 6の累乗を更新
    power = 1  # 累乗を初期化
    while power <= i:  # 累乗より小さい時はループい入る
        dp[i] = min(dp[i], dp[i - power] + 1)  # 漸化式
        power *= 9  # 9の累乗を更新
print(dp[n])
n = input()

color = [0 for i in range(n)]
d = [0 for i in range(n)]
f = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
X = [0 for i in range(n)]

def dfsv(u):
  color[u] = 1
  t += 1
  d[u] = t
  for v in range(n):
    if M[u][v] == 1 and color[v] == 0:
      dfsv(v)
  color[u] = 2
  t += 1
  f[u] = t

def dfs():
  t = 0
  for u in range(n):
    if color[u] == 0:
      dfsv(u)
  for u in range(n):
    print u+1, d[u], f[u]

for i in range(n):
  X = map(int, raw_input().split())
  for j in range(X[1]):
    M[X[0]-1][X[2+j]-1] = 1

dfs()
    

### FIXED CODE ###

n = int(raw_input())
 
d = [0 for i in range(n)]
f = [0 for i in range(n)]
G = [0 for i in range(n)]
M = [[0 for i in range(n)] for j in range(n)]
col = [0 for i in range(n)]
t = [0]
 
def DFS_visit(u):
    col[u] = 1
    t[0] += 1
    d[u] = t[0]
    for v in range(n):
        if M[u][v] == 1 and col[v] == 0:
            DFS_visit(v)
    col[u] = 2
    t[0] += 1
    f[u] = t[0]
 
def DFS():
    for u in range(n):
        if col[u] == 0:
            DFS_visit(u)
    for u in range(n):
        print'{0} {1} {2}'.format(u+1, d[u], f[u])
     
for i in range(n):
    X = map(int, raw_input().split())
    for j in range(X[1]):
        M[X[0]-1][X[2+j]-1] = 1
 
DFS()
from functools import reduce

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

if X not in x_list:
    x_list.append(X).sort()
    N += 1    

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

if N >= 3:
    space = [abs(x_list[i + 1] - x_list[i]) for i in range(N - 1)]
    print(reduce(gcd, space))
elif N == 2:
    space = x_list[1] - x_list[0]
    print(space)
elif N == 1:
    space = x_list[0]
    print(space)






### FIXED CODE ###

from functools import reduce

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

if X not in x_list:
    x_list.append(X)
    x_list.sort()
    N += 1    

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

if N >= 3:
    space = [abs(x_list[i + 1] - x_list[i]) for i in range(N - 1)]
    print(reduce(gcd, space))
elif N == 2:
    space = x_list[1] - x_list[0]
    print(space)
elif N == 1:
    space = x_list[0]
    print(space)
a.b,c = map(int,input().split())
print(c-(a-b))

### FIXED CODE ###

a,b,c = map(int,input().split())
ans = c-(a-b)
if ans <0:
  print("0")
else:
  print(ans)
N, M, C = map(int , input().strip().split())
B = list(map(int , input().strip().split()))
l = [];cnt = 0
for i in range(m):
  g = list(map(int , input().strip().split()))
  l.append(g)

for i in range(m):
  sums = 0
  for j in range(n):
    sums += l[i][j]*B[j]
  if sums + C >:
    cnt+=1
print(cnt)

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Mon May 13 18:16:09 2019

@author: avina
"""

N, M, C = map(int , input().strip().split())
B = list(map(int , input().strip().split()))
l = [];cnt = 0
for i in range(N):
  g = list(map(int , input().strip().split()))
  l.append(g)
for i in range(N):
  sums = 0
  for j in range(M):
    sums += l[i][j]*B[j]
  if sums + C > 0:
    cnt+=1
print(cnt)
n,m = map(int,input().split())
t = [0]*m
s = []

for i in range(n):
    a = list(map(int,input().split()))
    for j in range(a[0]):
        t[a[j]] += 1

count = 0

for i in range(len(t)):
    if t[i] == n:
        count += 1

print(count)





### FIXED CODE ###


n,m = map(int,input().split())
ans = [0] * m
info = []

for i in range(n):
    info = list(map(int,input().split()))
    for j in range(1,info[0]+1):
        ans[info[j]-1] += 1
#    print(ans)

print(ans.count(n))
W,H,x,y,r=map(int,input().split())
if (x+r<W&&r<x&&r<y&&y+r<H):
 print("Yes")
else:
 print("No")

### FIXED CODE ###

W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")
def dfs(v):
    global visited
    visited[v] = True
    for nv in graph[v]:
        if nv in graph[v]:
            if not visited[nv]:
                dfs(nv)


if __name__ == "__main__":
    N, M = map(int, input().split())
    graph = [[] for _ in range(N)]
    visited = [False]*N
    for _ in range(M):
        A, B = map(lambda x: int(x)-1, input().split())
        graph[A].append(B)
        graph[B].append(A)
    ans = -1
    for v in range(N):
        if not visited[v]:
            dfs(v)
            ans += 1
    print(ans)


### FIXED CODE ###

import sys


def dfs(v):
    global visited
    visited[v] = True
    for nv in graph[v]:
        if nv in graph[v]:
            if not visited[nv]:
                dfs(nv)


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    N, M = map(int, input().split())
    graph = [[] for _ in range(N)]
    visited = [False]*N
    for _ in range(M):
        A, B = map(lambda x: int(x)-1, input().split())
        graph[A].append(B)
        graph[B].append(A)
    ans = -1
    for v in range(N):
        if not visited[v]:
            dfs(v)
            ans += 1
    print(ans)
x, n = map(int, input().split())
if n!=0:
    p = input().split()
    p = [int(i) for i in p]

if not(x in p):
    print(x)
else:
    for i in range(101):
        if not(x-i in p):
            print(x-i)
            break
        elif not(x+i in p):
            print(x+i)
            break
        else:
            continue

### FIXED CODE ###

x, n = map(int, input().split())
if n==0:
    print(x)
else:
    p = input().split()
    p = [int(i) for i in p]
    if not(x in p):
        print(x)
    else:
        for i in range(101):
            if not(x-i in p):
                print(x-i)
                break
            elif not(x+i in p):
                print(x+i)
                break
            else:
                continue
N = list(input())
for i in range(len(N)):
  if N[i] in'ACGT':
    N[i] += 1
    N[i+1] = N[i]
  else:
    N[i] = 0
print(max(N))

### FIXED CODE ###

N = list(input())
dp = [0]*(len(N)+1)
for i in range(len(N)):
  if N[i] in'ACGT':
    dp[i] += 1
    dp[i+1] = dp[i]
  else:
    dp[i] = 0
print(max(dp))
input = input()
print(input ** 2)

### FIXED CODE ###

input = int(input())
print(input ** 3)
x,y =[int(i) for i in input().split()]
if x < y :
    swap(x, y)
while y > 0 :
    r = x % y
    x = y
    y = r
print(x)



### FIXED CODE ###

x,y =[int(i) for i in input().split()]
if x < y :
    t = x
    x = y
    y = t
while y > 0 :
    r = x % y
    x = y
    y = r
print(x)
print( int(((1+int(N))*N)/2) )

### FIXED CODE ###

N=int(input())
print( int(((1+N)*N)/2) )
K,S = map(int,input().split())
div = (K+1)//3
one = 0
three = 0
six = 0
for l in range(div):
  for m in range(l+1,div):
    for n in range(m+1,div):
      if l+m+n == S:
        six +=1
if S%3 == 0:
  one = 1
for i in range(K+1):
  if (S-i)%2 ==0 and S%3!=0:
    two +=1

print(one+3*three+6*six)

### FIXED CODE ###

K,S = map(int,input().split())
one = 0
three = 0
six = 0
if S%3==0:
    one = 1
else:
    one = 0
for l in range(K+1):
    if (S-l)%2==0 and (S-l)//2 <= K and (S-l)>=0:
        three += 1
for m in range(K-1):
    for n in range(m+1,K):
        rest = S-(m+n)
        if rest>n and rest<=K:
          six += 1
print(one+3*(three-one)+6*six)
from math import factorial

num=int(input())
count=0

#for i in range(num):
#    str=input()
#    str=''.join(sorted(str))
#    str = ''.join(sorted(input()))
#    stl.append(str)
stl =[(''.join(sorted(input()))) for i in range(num)]

duplicate=[x for x in set(stl) if stl.count(x) > 1]
if duplicate:
    for dup in duplicate:
        n=stl.count(dup)
        count += factorial(n) // 2 // factorial(n - 2)
    
print(count)

### FIXED CODE ###

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

c=a+b
d=a-b
e=a*b

print(max(c,d,e))
import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))

n = ri()
a = []
b = []
for i in range(n):
    x,y = rl()
    a.append(x+y)
    b.append(x-y)
a.sort()
b.sort()
print(max(a[-1]-a[0], b[-1]-[0]))

### FIXED CODE ###

import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip()
rl = lambda : list(map(int, input().split()))

n = ri()
a = []
b = []
for i in range(n):
    x,y = rl()
    a.append(x+y)
    b.append(x-y)
a.sort()
b.sort()
print(max(a[-1]-a[0], b[-1]-b[0]))
N = int(input())
c = 0
n = 0
list = [0] *1001
for l in range(1,N+1):
    list = []
    for i in range(1,int(N**0.5)):
        if i*i > l:
            break;       
        for j in range(1,int(N**0.5)):
            a = i*i + j*j + i*j
            for k in range(1,int(N**0.5)):
              a = i*i + j*j + k*k + i*j +j*k + i*k
                if i*i + j*j + k*k + i*j +j*k + i*k <= N:
                    list[a] += 1
for i in range(N):
  print(lsit[i])

### FIXED CODE ###

N = int(input())
list = [0]*(N+1)
for i in range(1,100):  
    for j in range(1,100):
        a = i*i + j*j + i*j
        for k in range(1,100):
            a = i*i + j*j + k*k + i*j +j*k + i*k
            if a <= N:
                list[a] += 1
for i in range(1,N+1):
    print(list[i])