Harryxun/stf_run huggingface dataset:
# coding: utf-8
from bisect import bisect_left


def solve(*args: str) -> str:
    x = int(args[0])

    P = [pow(i, 5) for i in range(64)]
    ret = None
    for b, b5 in enumerate(P):
        a5 = x+b5
        like_a = bisect_left(P, a5)
        if P[like_a] == a5:
            ret = (like_a, b)
            break

        a5 = abs(x-b5)
        like_a = bisect_left(P, like_a)
        if P[like_a] == a5:
            ret = (like_a if b5 < x else -like_a, -b)
            break

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


### FIXED CODE ###

# coding: utf-8
from bisect import bisect_left


def solve(*args: str) -> str:
    x = int(args[0])

    P = [pow(i, 5) for i in range(128)]
    ret = None
    for b, b5 in enumerate(P):
        a5 = x+b5
        like_a = bisect_left(P, a5)
        if like_a < len(P):
            if P[like_a] == a5:
                ret = (like_a, b)
                break

        a5 = abs(x-b5)
        like_a = bisect_left(P, a5)
        if like_a < len(P):
            if P[like_a] == a5:
                ret = (like_a if b5 < x else -like_a, -b)
                break

    return ' '.join(map(str, ret))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
n=int(input())
a=list(map(int,input().split()))

l=[0]*(max(a)+1)
for i in range(n):
    l[a[i]-1]+=1
#print(l)
ans=0
for i in range(len(l)-2):
    ans=max(ans,l[i]+l[i+1]+l[i+2])
ans=max(ans,l[0]+l[1],l[-1]+l[-2])
print(ans)

### FIXED CODE ###

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

l=[0]*(max(a)+1)
for i in range(n):
    l[a[i]]+=1
#print(l)
ans=0
for i in range(len(l)-2):
    ans=max(ans,l[i]+l[i+1]+l[i+2])
if len(l)==1:
    print(l[0])
elif len(l)==2:
    print(sum(l))
else:
    ans=max(ans,l[0]+l[1],l[-1]+l[-2])
    print(ans)
from functools import reduce
from itertools import product

n = int(input())

digits = 1
base = 10
for i in range(0, 7):
    if n < 10 ** i:
        digits = i
        break

smallest_digit = n % 10
largest_digit = n // (10 ** (digits - 1)) % 10
mid_digit_pattern = (n - largest_digit * (10 ** (digits - 1))) // 10 + 1

def count_pattern(a, b, dig):
    if dig == 1 and a != b:
        return 0
    elif dig == 1:
        return 1
    elif dig == digits:
        if a > largest_digit:
            return 0
        elif a < largest_digit:
            return 10 ** (dig - 2)
        elif b <= smallest_digit:
            return mid_digit_pattern
        elif b > smallest_digit:
            return mid_digit_pattern - 1
        else:
            assert False, "Can't reach here"
    else:
        return 10 ** (dig - 2)

if digits == 1:
    print(n)
else:
    counts = {}
    for state in product(range(1, 10), range(1, 10)):
        counts[state] = sum([count_pattern(*state, d) for d in range(1, digits + 1)])

    result = 0
    for state in counts.keys():
        result += counts[state] * counts[tuple(reversed(state))]
    print(result)

### FIXED CODE ###

n = int(input())

digits = 1
base = 10
for i in range(0, 20):
    if n < 10 ** i:
        digits = i
        break

smallest_digit = n % 10
largest_digit = n // (10 ** (digits - 1)) % 10
mid_digit_pattern = (n - largest_digit * (10 ** (digits - 1))) // 10 + 1

def count_pattern(a, b, dig):
    if dig == 1 and a != b:
        return 0
    elif dig == 1:
        return 1
    elif dig == digits:
        if a > largest_digit:
            return 0
        elif a < largest_digit:
            return 10 ** (dig - 2)
        elif b <= smallest_digit:
            return mid_digit_pattern
        elif b > smallest_digit:
            return mid_digit_pattern - 1
        else:
            assert False, "Can't reach here"
    else:
        return 10 ** (dig - 2)

result = 0
if digits == 1:
    result = n
else:
    counts = {}
    for i in range(1, 10):
        for j in range(1, 10):
            state = (i, j)
            counts[state] = sum([count_pattern(i, j, d) for d in range(1, digits + 1)])

    for state in counts.keys():
        result += counts[state] * counts[tuple(reversed(state))]

print(result)
import numpy as np
A = input()
B = input()
C = input()
X = input()
count = 0
coin = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a + b + c == 0:
        continue
      else:
        if X == coin.dot(np.array([a,b,c])):
            count += 1
print(count)

### FIXED CODE ###

import numpy as np
A = int(input())
B = int(input())
C = int(input())
X = int(input())
count = 0
coin = np.array([500,100,50])
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a + b + c == 0:
        continue
      else:
        if X == coin.dot(np.array([a,b,c])):
            count += 1
print(count)
a,b,c=input().split();print('NYOE S'[[a[-1]==b[0]and b[-1]==c[0]]::2])

### FIXED CODE ###

a,b,c=input().split();print('NYOE S'[a[-1]==b[0]and b[-1]==c[0]::2])
import sys
readline = sys.stdin.readline
from collections import deque
from math import isinf
INF = float("inf")
sys.setrecursionlimit(200000)
n = int(readline())
G = [[] for _ in range(n)]
for _ in [0] * (n - 1):
    s, t, w = map(int, readline().split())
    G[s].append([t, w])
    G[t].append([s, w])
def bfs(s, D):
    dq = deque([s])
    D = [INF] * n
    D[s] = 0
    while dq:
        u = dq.popleft()
        for i in range(len(G[u])):
            e = G[u][i]
            if isinf(D[e[0]]):
                D[e[0]] = D[u] + e[1]
                dq.append(e[0])
    return D
D = bfs(0, D)
D = bfs(max([i for i in range(n) if not isinf(D[i]) and 0 < D[i]]))
print(max(D[i] for i in range(n) if not isinf(D[i])))

### FIXED CODE ###

import sys
readline = sys.stdin.readline
def dfs(root):
    visited = [False] * n
    queue = [(0, root)]
    longest = (-1, -1)
    while queue:
        total_weight, node = queue.pop()
        if visited[node]: continue
        visited[node] = True
        longest = max(longest, (total_weight, node))
        queue += [(total_weight + w, t) for w, t in edges[node] if not visited[t]]
    return longest
n = int(readline())
edges = [set() for _ in range(n)]
for _ in range(n - 1):
    s, t, w = map(int, readline().split())
    edges[s].add((w, t))
    edges[t].add((w, s))
_, ln = dfs(0)
ld, _ = dfs(ln)
print(ld)
n = int(input())
li = list(map(int,input().split()))
li.sort()
print(abs(li[-1]-li[0]))


### FIXED CODE ###

n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(2 * n)
n = int(input())

es=[[] for _ in range(n)] # es[i] = (頂点iの(隣接する頂点,コスト)の組)
d = [0]*n # 頂点sからの最短距離
used=[True]*n
# 入力
for i in range(n-1):
    a,b,c = map(int,input().split())
    a,b = a-1, b-1
    es[a].append((b,c))
    es[b].append((a,c))


def dfs(s,dist):
    used[s]=False
    for v,x in es[s]:
        if used[v]:
            d[v]=dist+x
            dfs(v,dist+x)
q,k=map(int,input().split())
dfs(k-1,0)
for i in range(q):
    x,y=map(int,input().split())
    print(d[x-1]+d[y-1])

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000000)
input = sys.stdin.readline
n = int(input())
es=[[] for _ in range(n)] # es[i] = (頂点iの(隣接する頂点,コスト)の組)
d = [0]*n # 頂点sからの最短距離
used=[True]*n
# 入力
for i in range(n-1):
    a,b,c = map(int,input().split())
    a,b = a-1, b-1
    es[a].append((b,c))
    es[b].append((a,c))


def dfs(s,dist):
    used[s]=False
    for v,x in es[s]:
        if used[v]:
            d[v]=dist+x
            dfs(v,dist+x)
q,k=map(int,input().split())
dfs(k-1,0)
for i in range(q):
    x,y=map(int,input().split())
    print(d[x-1]+d[y-1])
N = int(input())
p = list(map(int, input().split()))

q = 0
for i in range(len(p)):
  if A[i] != i+1:
    q += 1

if q <= 2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

q = 0
for i in range(len(p)):
  if p[i] != i+1:
    q += 1

if q <= 2:
  print('YES')
else:
  print('NO')
from sys import stdin
    n,m = map(int,stdin.readline().split())
    a = map(int,stdin.readline().split())
    b = map(int,stdin.readline().split())
    a.sort()
    b.sort()
    x = []
    y = []
    for i in xrange(1,n):
        x.append(a[i] - a[i-1])
    for i in xrange(1,m):
        y.append(b[i] - b[i-1])   
    fir = 0
    sec = 0
    n = len(x)
    m = len(y)
    for i in xrange(n):
        fir += (i+1) * (n-i)*x[i]
    for i in xrange(m):
        sec += (i+1) * (m-i) * y[i]
    mod = 10**9 + 7
    print (fir * sec)%mod

### FIXED CODE ###

from sys import stdin
n,m = map(int,stdin.readline().split())
a = map(int,stdin.readline().split())
b = map(int,stdin.readline().split())
a.sort()
b.sort()
x = []
y = []
for i in xrange(1,n):
    x.append(a[i] - a[i-1])
for i in xrange(1,m):
    y.append(b[i] - b[i-1])   
fir = 0
sec = 0
n = len(x)
m = len(y)
for i in xrange(n):
    fir += (i+1) * (n-i)*x[i]
for i in xrange(m):
    sec += (i+1) * (m-i) * y[i]
mod = 10**9 + 7
print (fir * sec)%mod
n = int(input())
w = [map(int, input().split())]
s1 = w[0]
s2 = w[n-1]
for i in range(1, n-2):
    if s1 < s2:
        s1 += w[i]
    else:
        s2 += w[-i-1]
print(abs(s1 - s2))


### FIXED CODE ###

n = int(input())
w = list(map(int, input().split()))
ans = float('inf')
for i in range(n):
    s1 = sum(w[:i])
    s2 = sum(w[i:])
    z = abs(s1 - s2)
    ans = min(ans, z)
print(ans)
A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    l=sorted([A,B])
    ans_list=[1]
    for i in range(2,l[1]):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))


### FIXED CODE ###

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

def ans120(A:int, B:int, K:int):
    if A>=B:
        n=A
    else:
        n=B
    ans_list=[]
    for i in range(1,n+1):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))
N = int(input())
S,T = input().split()
q = None
for u in S :
  for d in T:
    q += u
    q += d
    break
print(q)    

### FIXED CODE ###

N = int(input())
S,T = input().split()
S = list(S)
T = list(T)
q = ''
for u in S :
  for d in T:
    q += u
    q += d
    T.remove(T[0])
    break
print(q)
S = int(input())
W = int(input())

if W >= S:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

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

if W >= S:
    print("unsafe")
else:
    print("safe")
ar = [[int(i) for i in input().split()] for j in range(3)]

if ar[0][0] + ar[1][1] + ar[2][2] == ar[0][1] + ar[1][2] + ar[2][0] == ar[0][3] + ar[1][0] + ar[2][1]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

ar = [[int(i) for i in input().split()] for j in range(3)]

if ar[0][0] + ar[1][1] + ar[2][2] == ar[0][1] + ar[1][2] + ar[2][0] == ar[0][2] + ar[1][0] + ar[2][1]:
  print("Yes")
else:
  print("No")
import math
Q = int(input())

def sosuu(x):
  if x == 1:
    return False
  else:
    for i in range(2,int(math.sqrt(x))):
      if x % i == 0:
        return False
    return True

table=[0]*50000
for i in range(1,50001):
  if sosuu(2*i - 1) and sosuu(i):
    table[i]=table[i-1] + 1
  else:
    table[i]=table[i-1]
    
ans=[0]*Q
for i in range(Q):
  l,r=map(int,input().split())
  ans[i]=table[(r+1)//2] - table[(l+1)//2]
for i in range(Q):
  print(ans[i])
  

### FIXED CODE ###

import math
Q = int(input())

def sosuu(x):
  if x == 1:
    return False
  else:
    for i in range(1,int(math.sqrt(x))):
      if x % (i+1) == 0:
        return False
    return True

table=[0]*50001
for i in range(1,50001):
  if sosuu(2*i - 1) and sosuu(i):
    table[i]=table[i-1] + 1
  else:
    table[i]=table[i-1]
    
ans=[0]*Q
for i in range(Q):
  l,r=map(int,input().split())
  ans[i]=table[(r+1)//2] - table[(l+1)//2 - 1]
  
for i in range(Q):
  print(ans[i])
# E
X, Y, NA, NB, NC = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
*C, = map(int, input().split())

A = sorted(A)[-X:]
B = sorted(B)[-Y:]
C = sorted(C)[::-1]

ans = sum(A) + sum(B)

i = 0
j = 0
for c in C:
    if A[i] < c or B[j] < c:
        if A[i] < B[j]:
            i += 1
            ans += c - A[i]
        else:
            j += 1
            ans += c - B[j]

print(ans)


### FIXED CODE ###

# E
X, Y, NA, NB, NC = map(int, input().split())
*A, = map(int, input().split())
*B, = map(int, input().split())
*C, = map(int, input().split())

A = sorted(A)[-X:]
B = sorted(B)[-Y:]
C = sorted(C)[::-1]

ans = sum(A) + sum(B)


i = 0
j = 0
num_A = len(A)
num_B = len(B)
for c in C:
    if i < num_A and j < num_B:
        if A[i] < B[j] and A[i] < c:

            ans += c - A[i]
            i += 1
        elif A[i] >= B[j] and B[j] < c:

            ans += c - B[j]
            j += 1

    elif i < num_A:
        if A[i] < c:
            ans += c - A[i]
            i += 1

    elif j < num_B:
        if B[j] < c:
            ans += c - B[j]
            j += 1

    else:
        break

print(ans)
n=str(input())
if n="ABC":
  print("ARC")
else:
  print("ABC")

### FIXED CODE ###

n=str(input())
if n=="ABC":
  print("ARC")
else:
  print("ABC")
import sys

def dump(x):
    print(x, file=sys.stderr)


a,b,c,d = [int(i) for i in input()]
ans = max(a*c,a*d,b*c,b*d,)
print(ans)







### FIXED CODE ###

import sys

def dump(x):
    print(x, file=sys.stderr)

a,b,c,d = [int(i) for i in input().split()]
ans = max(a*c,a*d,b*c,b*d)
print(ans)
def string():
    s = input()
    q = int(input())
    l = ''
    r = ''
    re = False
    while q > 0:
        t = list(input().strip().split())
        if t[0] == 1:
            re = not re
        else:
            if re:
                if t[1] == 2:
                    l = t[2] + l
                else:
                    r = r + t[2]
            else:
                if t[1] == 2:
                    l = t[2] + l
                else:
                    r = r + t[2]
        q -= 1
    s = l + s + r
    if re:
        s = s[::-1]
    print(s)
string()

### FIXED CODE ###

S = input()
Q = int(input())
flip = 0
head = []
tail = []
for i in range(Q):
  Query = input().split()
  if len(Query) == 3:
    T,F,C = Query
    F = int(F)-1
    if F^flip == 1:
      tail.append(C)
    else:
      head.append(C)
  else:
    flip ^= 1
if flip:
  head, tail = tail, head
  S = S[::-1]
head = ''.join(head[::-1])
tail = ''.join(tail)
print(head+S+tail)
A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B)+min(C+D))

### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
D = int(input())
print(min(A,B)+min(C,D))
a,b=list(map(int,input().split()))
if a%2==0&&b%2==0:
  if (b-a)%4==0:
    print(b)
  else:
    print(b^1)
elif a%2==0:
  if (b-a)%4==1:
    print(0)
  else:
    print(1)
elif b%2==0:
  if (b-a)%4==1:
    print(a^b^1)
  else:
    print(a^b)
else:
  if (b-a)%4==0:
    print(a)
  else:
    print(a^1)

### FIXED CODE ###

a,b=map(int,input().split())
if a%2==0 and b%2==0:
  if (b-a)%4==0:
    print(b)
  else:
    print(b^1)
elif a%2==0:
  if (b-a)%4==1:
    print(1)
  else:
    print(0)
elif b%2==0:
  if (b-a)%4==1:
    print(a^b)
  else:
    print(a^b^1)
else:
  if (b-a)%4==0:
    print(a)
  else:
    print(a^1)
N,Y=map(int,input().split())
res=(-1,-1,-1)
for x in range(N+1):
    for y in range(N+1-x);
    if N-x-y>=0 and 10000*x+5000*y+1000*(N-x-y)==Y:
        res=(x,y,N-x-y)
print(res[0],res[1],res[2])

### FIXED CODE ###

N, Y = map(int, input().split())
res = (-1, -1, -1)
for x in range(N + 1):
    for y in range(N + 1 - x):
        if N - x - y >= 0 and 10000*x + 5000*y + 1000*(N - x - y) == Y:
            res = (x, y, N - x - y)
print(res[0], res[1], res[2])
from math import gcd,ceil
a,b=map(int,input().split())
print(gcd(a,b))


### FIXED CODE ###

a,b=map(int,input().split())
if a>b:
    ans=a
    a-=1
else:
    ans=b
    b-=1
print(ans+max(a,b))
n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
while(n[0] >= n[1]):
  print(0)
  break
k=1
kyori=list()
while k < n[1]: 
  sa=i[k]-i[k-1]
  kyori.append(sa)
  k=k+1
mm=1
idou=sum(kyori)
idoulist=kyori
for mm in range(0, n[0]-1,1):
  saidai=max(idoulist)
  idou=idou-saidai
  idoulist.remove(saidai)
print(idou)

### FIXED CODE ###

n = list(map(int, input().split())) 
i = list(map(int, input().split())) 
i.sort()
if(n[0] >= n[1]):
  print(0)
else:
	k=1
	kyori=list()
	while k < n[1]: 
	  sa=i[k]-i[k-1]
	  kyori.append(sa)
	  k=k+1
	kyori.sort()
	mm=1
	owari=n[1]-n[0]
	kyori=kyori[0:owari]
	idou=sum(kyori)
	print(idou)
A,B = map(int,input().split())
if A>=13 :
  print(B)
elif A >=6 and A<=12:
  print(B//2)
 else:
  print(0)

### FIXED CODE ###

A,B = map(int,input().split())
if A>=13 :
  print(B)
elif A >=6 and A<=12:
  print(B//2)
else:
  print(0)
import math
from functools import reduce
n=int(input())
box=list(map(int,input().split()))

def lcm_base(x,y):
    return (x*y)//math.gcd(x,y)

def lcm_list(numbers):
    return reduce(lcm_base,numbers,1)

point=0
count=lcm_list(box)-1
for i in box:
    point +=count%i

print(point)

### FIXED CODE ###

n=int(input())
s=list(map(int,input().split()))
print(sum(s)-n)
N,M=map(int,input().split())
List = []
for i in range (M):
  List.append(list(map(int, input().split())))

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
uni = UnionFind(N)
for i in range(M):
  uni.union(List[i][0],List[i][1])
res = 0
for i in range(N):
  res = max(res,uni.size(i))
print(res)

### FIXED CODE ###

N,M=map(int,input().split())
List = []
for i in range (M):
  List.append(list(map(int, input().split())))

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

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

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
      
uni = UnionFind(N)
for i in range(M):
  uni.union(List[i][0]-1,List[i][1]-1)
res = 0
for i in range(N):
  res = max(res,uni.size(i))
print(res)
data = [int(s) for in input().split()]

if data[1] >= 13:
    print(data[0])
elif data[1] >= 6:
    print(data[0]/2)
else:
    print(0)

### FIXED CODE ###

data = [int(s) for s in  input().split()]

if data[0] >= 13:
    print(data[1])
elif data[0] >= 6:
    print(int(data[1]/2))
else:
    print(0)
import itertools

if __name__ == "__main__":
  n = int(input())
  li = list(map(int, input().split()))
  array = list(itertools.combinations(li, 2))
  sum = 0
  for i in range(n):
    sum += array[i][0] * array[i][1]
  print(sum)

### FIXED CODE ###

# -*- using:utf-8 -*-

class main:
  def judge(d, x):
    if d <= x:
      print("Yes")
    else:
      print("No")

if __name__ == "__main__":
  d, t, s = map(int, input().split())
  dis = t * s
  main.judge(d,dis)
import sys
from collections import namedtuple

import numpy as np

sys.setrecursionlimit(10**6)

length = int(sys.stdin.readline())

values = np.array([int(i) for i in sys.stdin.readline().split()], dtype=np.int32)
values = np.sort(values)[::-1]

next_ptr = np.zeros(shape=values.shape, dtype=np.int32)-1
next_ptr[0] = 0

total_score = 0
for index in range(1, len(values)):
  best_index = 0
  best_score = 0
  i = np.where(next_ptr>=0)[0]
  next_i = next_ptr[i]
  values_i = values[i]
  next_values_i = values[next_i]
  scores = np.min([values_i, next_values_i], axis=0)
  best_index = np.argmax(scores)
  
  total_score += scores[best_index]
  
  next_ptr[index] = next_ptr[best_index]
  next_ptr[best_index] = index
  
print(total_score)

### FIXED CODE ###

import sys
import math

price = int(sys.stdin.readline().strip())

if price % 1000 == 0:
  print(0)
else:
	print(1000 * (price // 1000 + 1) - price)
S = list(input())
count = 1 if S[0] in lis else 0
lis = ['A','T','C','G']
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
    

### FIXED CODE ###

S = list(input())
S.append('fuck')
lis = ['A','T','C','G']
count = 1 if S[0] in lis else 0
ans = 1 if S[0] in lis else 0
for i in range(1,len(S)):
  if S[i] in lis:
    count += 1
  else:
    ans = max(ans,count)
    count = 0
print(ans)
s = list(input())
t = list(input())

#print(s)
#print(t)

n = len(s)

dic = {}
dic2 = {}

if s == t:
    print("Yes")

else:
    for i in range(n):
        if s[i] in dic:
            if dic[s[i]] != t[i]:
                print("No")
                sys.exit()

        else:
            dic[s[i]] = t[i]

        
        if t[i] in dic2:
            if dic2[t[i]] != s[i]:
                print("No")
                sys.exit()

        else:
            dic2[t[i]] = s[i]

print("Yes")


### FIXED CODE ###

import sys

s = input()
t = input()

#print(s)
#print(t)

n = len(s)

dic = {}
dic2 = {}


for i in range(n):
    if s[i] in dic:
        if dic[s[i]] != t[i]:
            print("No")
            sys.exit()
            
    else:
        dic[s[i]] = t[i]
            
            
    if t[i] in dic2:
        if dic2[t[i]] != s[i]:
            print("No")
            sys.exit()
            
    else:
        dic2[t[i]] = s[i]
        
print("Yes")
# coding:utf-8
# C - Grand Garden

N = int(input())
h = list(map(int,input().split()))
h += [0]
ans = 0

for _ in range(1000):
    mini_ans = 0
    for i in range(N+1):
        if h[i] != 0:
            h[i] -= 1
            add = True
        else:
            if add:
                mini_ans += 1
            add = False
    
    if mini_ans == 0:
        break
    else:
        ans += mini_ans

print(ans)

### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
h += [0]
add = False
ans = 0
for n in range(100):
    for i in range(N+1):
        if h[i] != 0:
            h[i] -= 1
            add = True
        else:
            if add:
                ans += 1
            add = False
print(ans)
N = list(map(int, input().split()))
S = N%4

if S == 0 or S == 3:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())

if N%4 == 0:
    print("Yes")

if N%4 == 1:
    if N < 21:
        print("No")
    else:
        print("Yes")

if N%4 == 2:
    if N < 14:
        print("No")
    else:
        print("Yes")


if N%4 == 3:
    if N < 7:
        print("No")
    else:
        print("Yes")