Harryxun/stf_run huggingface dataset:
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 24 18:23:54 2018
ITP22C
@author: maezawa
"""

n, q = list(map(int, input().split()))
a = [[] for _ in range(n)]

for i in range(q):
    c = list(map(int, input().split()))
    if c[0] == 0:
        if a[c[1]]:
            if a[c[1]][-1] < c[2]:
                a[c[1]].append(c[2])
            else:
                j = len(a[c[1]])-1
                while True:
                    if a[c[1]][j-1] < c[2]:
                        a[c[1]].insert(j, c[2])
                        break
                    j -= 1
                    if j == 0:
                        a[c[1]].insert(0, c[2])
                        break
        else:
            a[c[1]].append(c[2])
    elif c[0] == 1:
        if a[c[1]]:
            print(a[c[1]][-1])
    else:
        if a[c[1]]:
            a[c[1]].pop()




### FIXED CODE ###

import heapq

n, q = list(map(int, input().split()))
a = [[] for _ in range(n)]

for i in range(q):
    c = list(map(int, input().split()))
    if c[0] == 0:
        heapq.heappush(a[c[1]],-c[2])
    elif c[0] == 1:
        if a[c[1]]:
            print(-a[c[1]][0])
    else:
        if a[c[1]]:
            heapq.heappop(a[c[1]])
import sys

def solve(T,X):
    return T/X
    pass


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    X = int(ws[1])
    return (T, X,)

def main():
    solve(*readQuestion())

# Uncomment before submission
 main()

### FIXED CODE ###

import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(T,X):
    return T/X

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()
I=lambda:map(int,input().split())
n,m,c=I()
b=list(I())
A=[];c=0
A+=list(I())
for a in A:
  d=0
  for i,j in zip(b,a):
    d+=i*j
  c+=(c+d>0)
print(c)

### FIXED CODE ###

I=lambda:map(int,input().split())
n,m,c=I()
b=list(I())
A=[list(I()) for _ in[0]*n]
e=0
for a in A:
  d=0
  for i,j in zip(b,a):
    d+=i*j
  e+=(d+c>0)
print(e)
A, B = map(int, input()split())
x = A+B
y = A-B
z = A*B

if y>=0:
  if x - z >= 0:
    print(x)
  else:
    print(z)
else:
  if y - z >= 0:
    print(y)
  else:
    print(z)

### FIXED CODE ###

A, B = map(int, input().split())
x = A+B
y = A-B
z = A*B

if B>=0:
  if x - z >= 0:
    print(x)
  else:
    print(z)
else:
  if y - z >= 0:
    print(y)
  else:
    print(z)
def BellmanFord(edges,num_v,source):
  #グラフの初期化
  inf=float("inf")
  dist=[inf for i in range(num_v)]
  dist[source-1]=0

  #辺の緩和
  for i in range(num_v):
    for edge in edges:
      if edge[0] != inf and dist[edge[1]-1] > dist[edge[0]-1] + edge[2]:
        dist[edge[1]-1] = dist[edge[0]-1] + edge[2]
        if i==num_v-1 and edge[1]==num_v : return -1
  return dist

N,M,P = [int(x) for x in input().split()]
gp = []
for _ in range(M):
    A,B,C = [int(x) for x in input().split()]
    gp.append([A,B,min(P-C,0)])

li = BellmanFord(gp,M,1)
if(li==-1):
    print(-1)
else:
    print(-li[N-1])


### FIXED CODE ###

def BellmanFord(edges,num_v,source):
    #グラフの初期化
    inf=float("inf")
    dist=[inf for i in range(num_v)]
    dist[source-1]=0
    flag = False

    #辺の緩和
    for i in range(num_v):
        for edge in edges:
          if edge[0] != inf and dist[edge[1]-1] > dist[edge[0]-1] + edge[2]:
            dist[edge[1]-1] = dist[edge[0]-1] + edge[2]
            if i==num_v-1:
                if edge[1] == num_v:
                    return -1
                else:
                    dist[edge[1]-1] = -inf
                    flag = True
    if flag:
        for i in range(num_v):
            for edge in edges:
                if dist[edge[1]-1]>dist[edge[0]-1] + edge[2]:
                    dist[edge[1]-1] = dist[edge[0]-1] + edge[2]
                    if edge[1] == num_v :
                        return -1

    return dist

N,M,P = [int(x) for x in input().split()]
gp = []
for _ in range(M):
    A,B,C = [int(x) for x in input().split()]
    gp.append([A,B,P-C])

li = BellmanFord(gp,N,1)
if(li==-1):
    print(-1)
else:
    print(max(0,-li[N-1]))
import sys
print "\n".join([len(str(sum([int(x) for x in l.split(' ')]))) for l in open(sys.stdin)])

### FIXED CODE ###

import sys
print "\n".join(str(len(str(sum(int(x) for x in l.split(' '))))) for l in sys.stdin)
#枚数
paper = int(input())

#餅リスト
moti_list  = []
li_uniq    = []

#取得
for w in range(paper):
    paper = int(input())

    moti_list.append(paper)

print(len(moti_list))

### FIXED CODE ###

#日付
num = list(input())
num[3] = "8"
print("".join(num))
A,B = input().split()
A = int(a)

B = int(b[0]+b[2:])
print(A*B//100)

### FIXED CODE ###


A,B = input().split()
A = int(A)
B = int(B[0]+B[2:])
print(A*B//100)
N, M = map(int, input().split())
A = list(map(int, input().split()))

tab = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]
A_cmp = {}
for Ai in sorted(A):
    A_cmp[tab[Ai]] = Ai
A = list(A_cmp.values())
A.sort(key=lambda x: -x)

memo = [None] * (N + 1)
memo[0] = 0

import sys
sys.setrecursionlimit(10000)

def dp(X):
    if memo[X] != None: return memo[X]
    if X < 0: return -(1000000007)
    #
    rets = []
    for i, Ai in enumerate(A):
        rets.append(dp(X - tab[Ai]) + 1)
    #
    ret = max(rets)
    memo[X] = ret
    return ret

ans_len = dp(N)

N_tmp = N
ans = ''
for i in range(ans_len):
    for j, Aj in enumerate(A):
        if dp(N_tmp) - 1 == dp(N_tmp - tab[Aj]):
            ans += str(Aj)
            N_tmp -= tab[Aj]
            break

print(ans)

### FIXED CODE ###

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

tab = [6, 2, 5, 5, 4, 5, 6, 3, 7, 6]
A_cmp = {}
for Ai in sorted(A):
    A_cmp[tab[Ai]] = Ai
A = list(A_cmp.values())
A.sort(key=lambda x: -x)

memo = [None] * (N + 1)
memo[0] = 0

import sys
sys.setrecursionlimit(100000)

def dp(X):
    if X < 0: return -(1000000007)
    if memo[X] != None: return memo[X]
    #
    rets = []
    for i, Ai in enumerate(A):
        rets.append(dp(X - tab[Ai]) + 1)
    #
    ret = max(rets)
    memo[X] = ret
    return ret

ans_len = dp(N)

N_tmp = N
ans = ''
for i in range(ans_len):
    for j, Aj in enumerate(A):
        if dp(N_tmp) - 1 == dp(N_tmp - tab[Aj]):
            ans += str(Aj)
            N_tmp -= tab[Aj]
            break

print(ans)
l, r = map(int, input().split())
la = l % 2019
ra = r % 2019
diff = ra - la
if diff <= 0:
  diff+=2019
ans = None
for i in range(la, la+diff):
  for j in range(i+1, la+diff+1):
    mul = (i*j) % 2019
    if mul < ans:
      ans = mul
print(ans)


### FIXED CODE ###

l, r = map(int, input().split())
if r-l >=2019:
  print("0")
  exit()
la = l % 2019
ra = r % 2019
diff = ra - la
if diff <= 0:
  print("0")
  exit()
ans = 2019
for i in range(la, ra):
  for j in range(i+1, ra+1):
    mul = (i*j) % 2019
    if mul <= ans:
      ans = mul
print(int(ans))
X, Y = map(int, input().split())

for i in range(X+1):
    if 2*i +4(X - i) == Y:
        print("Yes")
    else:
        print("No")


### FIXED CODE ###

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

for i in range(X+1):
    if (2*i + 4*(X - i)) == Y:
        print("Yes")
        break
else:
    print("No")
print(eval('('+input().replace(' ', +)+')//2'))

### FIXED CODE ###

import math
print(math.ceil(eval('('+input().replace(' ', '+')+')/2')))
n, k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))

if n >= k:
    ans = -float('inf')
    for i in range(n):
        now = i
        score = []
        for j in range(k):
            now = p[now] - 1
            if j == 0:
                score.append(c[now])
            else:
                score.append(score[j-1] + c[now])
        ans = max(max(score), ans)
else:
    ans = -float('inf')
    for i in range(n):
        now = i
        score = []
        check = [0] * n
        cnt = 0
        for j in range(k):
            go = p[now] - 1
            if check[go] == 1:
                break
            now = go
            if j == 0:
                score.append(c[now])
            else:
                score.append(score[j-1] + c[now])
            check[now] = 1
            cnt += 1
        d = k // cnt
        e = k % cnt
        ans = max(score[-1] * d + max(score[:e]), max(score), ans)
print(ans)

### FIXED CODE ###

n, k = map(int,input().split())
p = list(map(int,input().split()))
c = list(map(int,input().split()))

ans = -float('inf')
for i in range(n):
    score = []
    check = [0] * n
    now = i
    cycle = 0
    for _ in range(k):
        go = p[now] - 1
        if check[go] == 1:
            break
        now = go
        if len(score) == 0:
            score.append(c[now])
        else:
            score.append(score[-1] + c[now])
        check[now] = 1
        cycle += 1

    t = k // cycle
    m = k % cycle

    sum_cycle = score[-1]
    if m == 0:
        ans = max(sum_cycle * t, sum_cycle * (t - 1) + max(score), max(score), ans)
    else:
        ans = max(sum_cycle * t + max(score[:m]), sum_cycle * (t - 1) + max(score), max(score), ans)

print(ans)
N = int(input())
A = list(map(int, input().split()))
ans = 0
flg = "True"

while flg == "True":
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] / 2
        else:
            flg = "False"
    ans += 1

print(ans)


### FIXED CODE ###

a = str(input())
ans = 0
if a[0] == "1":
    ans = ans + 1

if a[1] == "1":
    ans = ans + 1

if a[2] == "1":
    ans = ans + 1

print(ans)
import numpy as np
h, w = map(int, input().split())
colors = np.zeros((h,w))
for i in range(h):
    s = input()
    for j,c in enumerate(s):
        if c=='#':
            colors[i,j] = 1

def tonari(pos):
    i,j = pos
    ans = []
    if i==0:
        ans.append((i+1,j))
    elif i==h-1:
        ans.append((i-1,j))
    else:
        ans.append((i-1,j))
        ans.append((i+1,j))
    if j==0:
        ans.append((i,j+1))
    elif j==w-1:
        ans.append((i,j-1))
    else:
        ans.append((i,j-1))
        ans.append((i,j+1))
    
    return ans

# 深さ優先探索をする
# マス(0,0)からスタート
# 次の仕切り直しで使うスタート位置のリストnext_start
# すでに訪ねたかどうかを表すh*wの表 visited=1 
# current_positionの前後左右を見てもしcurrent_colorと異なればそっちに動く

current_position = (0,0)
current_color = colors[current_position]
current_group = 0
visited_array = np.zeros((h,w))
visited_array[(0,0)] = 1
groups = {0:[1-current_color, current_color]} # {group_num:(white_num,black_num)}
next_visit = []
other_group = []


while True:
    # current_positionの前後左右を見る
    # print(current_position)
    neighbors = tonari(current_position)
    for ngb in neighbors:
        if colors[ngb] != current_color and visited_array[ngb] == 0 and ngb not in next_visit:
            next_visit.append(ngb)
        # もしnon_visitedかつcurrent_colorと異なればnext_visitに追加
        # それ以外は何もしない

    # next_visitが空でないとき
    if len(next_visit) > 0:
        pos = next_visit.pop(0)
        current_position = pos        
        current_color = colors[current_position]
        groups[current_group][0] += 1-current_color
        groups[current_group][1] += current_color
        visited_array[current_position] = 1
        # next_visitの中から次の移動先を取り出して
        # colorをみてgroupに追加
        # current_positionとcurrent_colorを更新
    elif len(next_visit) == 0:
        # next_visitが空のとき
        row, col = np.where(visited_array==0)
        if len(row) == 0:
            break
        else:
            current_position = (row[0], col[0])
            current_color = colors[current_position]
            current_group += 1
            groups[current_group] = [1-current_color, current_color]
            visited_array[current_position] = 1
            # unvisitedの中から一つ選んで
            # current_position, color更新
            # current_group更新

# print(groups)
ans = 0
for g in groups:
    black, white = groups[g]
    ans += black*white
print(int(ans))



### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)

h,w=map(int,input().split())
s=[input() for _ in range(h)]
t=[[None]*w for _ in range(h)]

def dfs(i,j,color):

  if not (0<=i<h and 0<=j<w):return 0,0
  if s[i][j]==color: return 0,0
  if t[i][j]:return 0,0

  t[i][j]=True
  wh,bl=0,0
  if s[i][j]=="#":
    bl+=1
  else:
    wh+=1

  tmp1,tmp2=dfs(i+1,j,s[i][j])
  wh,bl=wh+tmp1,bl+tmp2

  tmp1,tmp2=dfs(i-1,j,s[i][j])
  wh,bl=wh+tmp1,bl+tmp2
        
  tmp1,tmp2=dfs(i,j-1,s[i][j])
  wh,bl=wh+tmp1,bl+tmp2

  tmp1,tmp2=dfs(i,j+1,s[i][j])
  wh,bl=wh+tmp1,bl+tmp2

  return wh,bl

ans=0
for i in range(h):
  for j in range(w):
    a,b=dfs(i,j,"!")
    ans+=a*b

print(ans)
import sys

i = 0
x = 1

while x == 0:
  x = sys.stdin.readline()
  i += 1

  print "Case %d: %d", %(i,x)
  

### FIXED CODE ###

i = 0
d = 0

while d == 0:
    x = input()
    if x != 0:
        i += 1
        print("Case %d: %d" %(i, x))
    else:
        d = 1
a, b, c, d = list(map(int, input().split()))
R=max([b*d, a*d, a*c, b*c])
print(R)


### FIXED CODE ###

N, = map(int, input().split())
mod = 10**9+7
R=pow(10, N, mod) - 2*pow(9, N, mod) + pow(8, N, mod)
print(R%mod)
x = int(input())
h = x / 3600
m = (x % 3600) / 60
s = x - h*3600 - m*60
print(':'.join(h, m, s)

### FIXED CODE ###

x = int(input())
a = x // 3600
b = x // 60 %60
c = x % 60

a = str(a)
b = str(b)
c = str(c)
print(":".join([a,b,c]))
n = int(input())
testimony = [[] for _ in range(n)]

for i in range(n):
    num = int(input())
    for j in range(num):
        person, state = map(int, input().split())
        testimony[i].append([person-1], state)

honest = 0
for i in range(1, 2**n):
    flag = 0
    for j in range(n):
        if (i>>j)&1 == 1:
            for x, y in testimony[j]:
                if (i>>x)&1 != y:
                    flag = 1
                    break
    if flag == 0:
        honest = max(honest, bin(i)[2:].count('1'))

print(honest)

### FIXED CODE ###

n = int(input())
testimony = [[] for _ in range(n)]

for i in range(n):
    num = int(input())
    for j in range(num):
        person, state = map(int, input().split())
        testimony[i].append([person-1, state])

honest = 0
for i in range(1, 2**n):
    flag = 0
    for j in range(n):
        if (i>>j)&1 == 1:
            for x, y in testimony[j]:
                if (i>>x)&1 != y:
                    flag = 1
    if flag == 0:
        honest = max(honest, bin(i)[2:].count('1'))

print(honest)
from collections import deque
import sys


def suffle(deck, c):
    l = len(deck)
    if l % 2 == 0: mid = l//2
    else: mid = (l-1)//2
    deckA = deck[mid:]
    deckB = deck[:mid]
    deckC = []
    
    while(len(deckA) != 0 or len(deckB) != 0):
        deckC.extend(deckA[:c])
        deckA = deckA[c:]
        deckC.extend(deckB[:c])
        deckB = deckB[c:]

    return deckC

while(True):
    deck = []
    n, r = map(int, sys.stdin.readline()[:-1].split())
    deck = [i for i in range(n)]
    c_list = map(int, sys.stdin.readline()[:-1].split())
    for c in c_list:
        deck = suffle(deck, c)

    print(deck[-1])
    #print(" ".join(map(str, deck)))

### FIXED CODE ###

from collections import deque
import sys


def suffle(deck, c):
    l = len(deck)
    if l % 2 == 0: mid = l//2
    else: mid = (l-1)//2
    deckA = deck[mid:]
    deckB = deck[:mid]
    deckC = []
    
    while(len(deckA) != 0 or len(deckB) != 0):
        deckC.extend(deckA[:c])
        deckA = deckA[c:]
        deckC.extend(deckB[:c])
        deckB = deckB[c:]

    return deckC

while(True):
    inp = sys.stdin.readline()
    if not inp: break
    deck = []
    n, r = map(int, inp[:-1].split())
    deck = [i for i in range(n)]
    c_list = map(int, sys.stdin.readline()[:-1].split())
    for c in c_list:
        deck = suffle(deck, c)

    print(deck[-1])
    #print(" ".join(map(str, deck)))
## coding: UTF-8
import sys
#import time

#start = time.time()
N, W = map(int,input().split())
l = [list(map(int, input().split())) for _ in range(N)]


dp = [ [sys.maxsize] * (N * 1000) for _ in range(N) ]
for i in range(N):
    for j in range(N * 1000):
        w = l[i][0]
        v = l[i][1]
        if(j == 0):
            dp[i][j] = 0
        elif(j <= v):
            dp[i][j] = min(dp[i-1][j], w)
        else:
            dp[i][j] = min(dp[i-1][j], dp[i-1][j-v] + w)
#for k in range(N):
    #print(dp[k][:20])


cnt = 0
i = 0
while cnt <= W:
    cnt = dp[-1][i]
    i += 1
print(i-2)#0-index , while分の構造上、iが2多くなる



### FIXED CODE ###

## coding: UTF-8
import sys
#import time

#start = time.time()
N, W = map(int,input().split())
l = [list(map(int, input().split())) for _ in range(N)]


dp = [ [sys.maxsize] * (N * 1000) for _ in range(N) ]
for i in range(N):
    for j in range(N * 1000):
        w = l[i][0]
        v = l[i][1]
        if(j == 0):
            dp[i][j] = 0
        elif(j <= v):
            dp[i][j] = min(dp[i-1][j], w)
        else:
            dp[i][j] = min(dp[i-1][j], dp[i-1][j-v] + w)
#for k in range(N):
    #print(dp[k][:20])

#print(dp[-1][2999])
#print(dp[-1][3000])
cnt = 0
i = 0
while cnt <= W:
    cnt = dp[-1][i]
    i += 1
    if(i == N*1000):
        i += 2
        break
print(i-2)#0-index , while分の構造上、iが2多くなる
n=int(input())
a=list(map(int,input().split()))
l=[]
ans=0
for i in range(n):
  print(l)
  l=list(map(lambda x: x+1,l))
  ans+=l.count(a[i])
  l.append(-a[i])
print(ans)

### FIXED CODE ###

import collections
n=int(input())
l=list(map(int,input().split()))
a=[0]*n
b=[0]*n
for i in range(n):
  a[i]=i+1+l[i]
  b[i]=(i+1-l[i])
A=collections.Counter(a)
aa=A.most_common()
B=collections.Counter(b)

ans=0
for i in range(len(aa)):
  ans+=B[aa[i][0]]*aa[i][1]

print(ans)
import math
from functools import reduce

c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()

k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1

m = min(b) 

lo = []

def gcd_list(numbers):
    return reduce(math.gcd, numbers)


                
print(gcd_list(b))

### FIXED CODE ###

c, d = (int(i) for i in input().split())  
a = [int(i) for i in input().split()]
b = a.copy()
 
k = 0
for i in a:
    b[k] = abs(i - d)
    k += 1
 
m = min(b) 
 
def dec():
 
    i = m
    while i > 0:
        if m% i == 0: 
            k = 0
            for j in b:
                if j%i ==0:
                    k +=1
                if k==len(b):
                    return i
                
            if i == m:
                i -= i//2
                
        i -=1
 
 
 
 
                
print(dec())
#2つの正整数a, bの積の偶奇判定
a = list(map(int,input().split()))

c = a*b
if c % 2 == 0:
    print (Even)
else:
    print(Odd)
    

### FIXED CODE ###

#2つの正整数a, bの積の偶奇判定
a,b = map(int,input().split())

if (a*b) % 2 == 0:
    print ("Even")
else:
    print ("Odd")
a = 20
b = int(input())
if a % b == 0:
    print("even")
else:
    print("odd")

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b) % 2:
  print('Odd')
else:
  print('Even')
n,q=map(int,input().split())
s=input()
list_ac=[]
number=0
for i in range(0,len(s)):
    if s[i]=='A':
        state=1
        list_ac.append(number)
    elif s[i]=='C':
        if state==1:
            number=number+1   
        list_ac.append(number)
        state=0
    else:
        state=0
        list_ac.append(number)
for i in range(0,q):
    l,r=map(int,input().split())
    print(list_ac[r-1]-list_ac[l-1])
        
    


### FIXED CODE ###

n,q=map(int,input().split())
s=input()
list_ac=[0]
number=0
for i in range(0,n):
    if s[i:i+2]=='AC':
        number=number+1
        list_ac.append(number)
    else:
        list_ac.append(number)
for i in range(0,q):
    l,r=map(int,input().split())
    print(list_ac[r-1]-list_ac[l-1])
s=str(input())
print(s.count(1))

### FIXED CODE ###

s=str(input())
print(s.count('1'))
import numpy as np

N,W = list(map(int,input().split()))
dp = np.zeros(W+1,dtype = int)
for i in range(N):
    w,v = list(map(int,input().split()))
    dp[w:] = np.maximum(dp[w:],dp[:-w] + v)
print(dp[-1])

### FIXED CODE ###

import numpy as np

N,W = list(map(int,input().split()))
dp = np.zeros(W+1,dtype = int)
for i in range(N):
    w,v = list(map(int,input().split()))
    dp[w:] = np.maximum(dp[w:],dp[:-w] + v)
print(dp[-1])
import math
A, B = map(int,input().split())

GCD = math.gcd(A,B)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+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

l = factorization(GCD)
if len(l) == 1:
    print(len(l))
else:
    print(len(l)+1)

### FIXED CODE ###

import fractions
import sys
A, B = map(int,input().split())

GCD = fractions.gcd(A,B)

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+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

l = factorization(GCD)
if len(l) == 1 and l[0][0] == 1:
    print(len(l))
else:
    print(len(l)+1)
s=[i for i in input()]
l=[]
cnt=0
for i in s:
  if i=="A" or i=="T" or i=="C" or i=="G" or i==" ":
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0
print(max(l) if len(l)>1 else l[0]) 

### FIXED CODE ###

s=[i for i in input()]
l=[]
cnt=0
for i in range(len(s)):
  if s[i]=="A" or s[i]=="T" or s[i]=="C" or s[i]=="G" or s[i]==" ":
    cnt+=1
    if i==len(s)-1:
      l.append(cnt)
  else:
    l.append(cnt)
    cnt=0  
print(max(l) if len(l)>1 else l[0])
from math import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())

ans = n*m//gcd(n, m)
sp_a, sp_b = ans//n, ans//m
l = [False]*(ans + 1)
jud = True
for i in range(n):
    l[i*sp_a] = s[i]

for i in range(m):
    if not l[i*sp_b]:
        l[i*sp_b] = t[i]
    else:
        if l[i*sp_b] != t[i]:
            jud = False
            break
if jud:
    print(ans)
else:
    print(-1)

### FIXED CODE ###

from math import gcd
n, m = map(int, input().split())
s = list(input())
t = list(input())
g = gcd(n, m)
ans = n*m//g
sp_a, sp_b = m//g, n//g
jud = True
for i in range(ans//sp_a):
    if i*sp_a % sp_b == 0:
        if s[i % n] != t[i*sp_a//sp_b]:
            jud = False

if jud:
    print(ans)
else:
    print(-1)
A,B,K=map(int,input().split())
if A-K>=0:
  print(A-K,B)
else:
  B=B-(K-A)
  if B<=0:
    print(0,0)
    break
  print(0,B)
  
  


### FIXED CODE ###

A,B,K=map(int,input().split())
if A-K>=0:
  print(A-K,B)
else:
  B=B-(K-A)
  if B<=0:
    print(0,0)
  else:
    print(0,B)