Harryxun/stf_run huggingface dataset:
import numpy as np
import math

num = int(input())
a = 1
sum = 0

def gcd(a, b, c):
  num = np.array([a, b, c])
  return np.gcd(np.gcd.reduce(num))

def loopC(a, b, num):
  c = 1
  sum = 0
  while c <= num:
      ans = gcd(a, b, c)
      sum += ans
      c += 1
  return sum

def loopB(a, num):
  b = 1
  sum = 0
  while b <= num:
    ans = loopC(a, b, num)
    b += 1
    sum += ans
  return sum

while a <= num:
  ans = loopB(a, num)
  sum += ans
  a += 1

print(sum)

### FIXED CODE ###

import math

num = int(input())
sum = 0

for a in range(1, num + 1):
  for b in range(1, num + 1):
    gcd_ab = math.gcd(a, b)
    for c in range(1, num + 1):
      sum += math.gcd(gcd_ab, c)

print(sum)
print((int(input())**2)

### FIXED CODE ###

print(int(input())**2)
x=int(input())
a=int(input())
b=int(input())
m=0
for i in range(1,10001)
    if (x-a)/(b*i)<1:
        m=i-1
        break
print((x-a-b*m))


### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())
m=0
for i in range(1,10001):
    if (x-a)/(b*i)<1:
        m=i-1
        break
print((x-a-b*m))
from collections import deque
n,m = map(int,input().split())

uv = [[] for i in range(n)]

for i in range(m):
    u,v = map(int,input().split())
    #uv[v-1].append(u-1)
    uv[u-1].append(v-1)
    
s,t = map(int,input().split())

check = [[0 for i in range(3)] for j in range(n)]

d = deque()
d.appendleft([0,s-1])
#check[s-1][0] = 1

while len(d) > 0:
    for i in range(len(d)):
        num,ver = d.popleft()
        check[ver][num] = 1
        num = num+1
        #cnt += 1
        for j in range(len(uv[ver])):
            #print(cnt,num,ver,j,t-1,uv[ver][j])
            if uv[ver][j] == t-1 and num%3 == 0:
                print(num//3)
                exit()
            if check[uv[ver][j]][num] == 0:
                #check[uv[ver][j]][num] = 1
                d.append([num,uv[ver][j]])
                
print(-1)

### FIXED CODE ###

# coding: utf-8
import sys
from heapq import heapify, heappop, heappush

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

# vertexごとに3つの状態数を持つ
N, M = lr()
graph = [[] for _ in range((N+1)*3)]  # 1-indexed
for _ in range(M):
    a, b = lr()
    a *= 3; b *= 3
    for i in range(3):
        j = i+1 if i < 2 else 0
        graph[a+i].append(b+j)

INF = 10 ** 15

def dijkstra(start):
    dist = [INF] * (N+1) * 3
    dist[start] = 0
    que = [(0, start)]
    while que:
        d, prev = heappop(que)
        if dist[prev] < d:
            continue
        for i in graph[prev]:
            #print(graph[prev],dist[next],next)
            d1 = d + 1
            if dist[i] > d1:
                dist[i] = d1
                heappush(que, (d1, i))
    return dist

S, T = lr()
dist = dijkstra(S*3)
answer = dist[T*3]
if answer == INF:
    answer = -1
else:
    answer //= 3
print(answer)
from math import pi
r = float(input())
area = r * r * pi
cir =(r+r) * pi
print(f'{(area):.6f}{(cir):.6f}')



### FIXED CODE ###

from math import pi
r = float(input())
area = r * r * pi
cir =(r+r) * pi
print(f'{(area):.6f} {(cir):.6f}')
def dfs(num):
    if dp[num] != -1:
        return dp[num]

    res = 0
    for obj in G[num]:
        res = max(res, dfs(obj) + 1)

    dp[num] = res
    return res


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

dp = [-1] * N
G = {i:[] for i in range(N)}

for _ in range(M):
    x, y = map(int, input().split())
    G[x - 1].append(y - 1)

res = 0
for i in range(N):
    res = max(res, dfs(i))

print(res)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)

#import math
#import numpy as np
#= int(input())
#= input()
#= map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]
def dfs(num):
    if dp[num] != -1:
        return dp[num]

    res = 0
    for obj in G[num]:
        res = max(res, dfs(obj) + 1)

    dp[num] = res
    return res


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

dp = [-1] * N
G = {i:[] for i in range(N)}

for _ in range(M):
    x, y = map(int, input().split())
    G[x - 1].append(y - 1)

res = 0
for i in range(N):
    res = max(res, dfs(i))

print(res)
import numpy as np
N, M = list(map(int, input().split()))
A_list = list(map(int, input().split()))

card_num = np.zeros(10**9+1)
max_num = -1
for a in A_list:
    card_num[a] += 1
    if max_num < a:
        max_num = a

for _ in range(M):
    B, C = list(map(int, input().split()))
    card_num[C] += B
    if max_num < C:
        max_num = C

ans = 0
current_num = 0
for i in range(max_num, 0, -1):
    num = card_num[i]
    if num == 0:
        continue
    else:
        if current_num + num <= N:
            ans += num * i
            current_num += num
        else:
            ans += (N-current_num) * i
            break
print(int(ans))

### FIXED CODE ###

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

card = []
card_num = []

for a in A_list:
    card.append(a)
    card_num.append(1)
        
for _ in range(M):
    B, C = list(map(int, input().split()))
    card.append(C)
    card_num.append(B)
    
union = zip(card, card_num)
sorted_union = sorted(union, key=lambda x:x[0])[-1::-1]
sorted_card, sorted_card_num = zip(*sorted_union)

ans = 0
current_num = 0
for c, c_num in zip(sorted_card, sorted_card_num):
    if current_num + c_num < N:
        current_num += c_num
        ans += c * c_num
    else:
        ans += c * (N - current_num)
        current_num = N
        break
print(ans)
from collections import defaultdict, deque

N, M, P = map(int, input().split())
G = defaultdict(lambda: defaultdict(lambda: 10000000))
G_rev = defaultdict(lambda: defaultdict(lambda: 10000000))

for i in range(1, N + 1):
    G[i] = dict()
    G_rev[i] = dict()

for _ in range(M):
    A, B, C = map(int, input().split())
    G[A][B] = min(G[A][B], P - C)
    G_rev[B][A] = 1

reachable_N = [0] * (N + 1)
reachable_N[N] = 1
queue = deque([N])

while len(queue) > 0:
    p = queue.popleft()
    for q in G_rev[p].keys():
        if reachable_N[q] == 0:
            reachable_N[q] = 1
            queue.append(q)

reachable_1 = [0] * (N + 1)
reachable_1[1] = 1
queue = deque([1])

while len(queue) > 0:
    p = queue.popleft()
    for q in G[p].keys():
        if reachable_1[q] == 0:
            reachable_1[q] = 1
            queue.append(q)

reachable = [reachable_1[i] * reachable_N[i] for i in range(N + 1)]

dist = [10000000000 for i in range(N + 1)]
res = 0
dist[1] = 0
queue = deque([1])
cnt = 0

update = True

while update:
    update = False
    for p in range(1, N + 1):
        if reachable[p] == 0:
            continue
        for q in G[p].keys():
            if reachable[q] == 0:
                pass
            elif dist[p] + G[p][q] < dist[q]:
                dist[q] = dist[p] + G[p][q]
                update = True
    cnt += 1
    if cnt > N:
        res = -1
        break

if res == -1:
    print(res)
else:
    print(max(0, -dist[N]))


### FIXED CODE ###

from collections import defaultdict, deque

N, M, P = map(int, input().split())
G = defaultdict(lambda: defaultdict(lambda: 10000000))
G_rev = defaultdict(lambda: defaultdict(lambda: 10000000))

for _ in range(M):
    A, B, C = map(int, input().split())
    G[A][B] = min(G[A][B], P - C)
    G_rev[B][A] = 1

reachable_N = [0] * (N + 1)
reachable_N[N] = 1
queue = deque([N])

while len(queue) > 0:
    p = queue.popleft()
    for q in G_rev[p].keys():
        if reachable_N[q] == 0:
            reachable_N[q] = 1
            queue.append(q)

reachable_1 = [0] * (N + 1)
reachable_1[1] = 1
queue = deque([1])

while len(queue) > 0:
    p = queue.popleft()
    for q in G[p].keys():
        if reachable_1[q] == 0:
            reachable_1[q] = 1
            queue.append(q)

reachable = [reachable_1[i] * reachable_N[i] for i in range(N + 1)]

dist = [10000000000 for i in range(N + 1)]
res = 0
dist[1] = 0
queue = deque([1])
cnt = 0

update = True

while update:
    update = False
    for p in range(1, N + 1):
        if reachable[p] == 0:
            continue
        for q in G[p].keys():
            if reachable[q] == 0:
                pass
            elif dist[p] + G[p][q] < dist[q]:
                dist[q] = dist[p] + G[p][q]
                update = True
    cnt += 1
    if cnt > N:
        res = -1
        break

if res == -1:
    print(res)
else:
    print(max(0, -dist[N]))
S = int(input())
W = int(input())
print('safe' if S > W else 'unsafe')

### FIXED CODE ###

S, W = map(int, input().split())
if S > W:
  print("safe")
else:
  print("unsafe")
N, M, K = input().split()
a_timelist = input().split()
b_timelist = input().split()
N, M, K = int(N), int(M), int(K)
a_timelist = [int(x) for x in a_timelist]
b_timelist = [int(x) for x in b_timelist]
counta = len(a_timelist)
countb = len(b_timelist)
counter = 0
time = 0
if a_timelist[0] > K and b_timelist[0] > K:
  print(0)
  exit()
while time <= K:
  if a_timelist == [] and b_timelist == []:
    print(counta + countb)
    exit()
  if (b_timelist == [] and a_timelist != []) or (a_timelist[0] >= b_timelist[0]):
    time += a_timelist[0]
    counter += 1
    del a_timelist[0]
  elif (a_timelist == [] and b_timelist != []) or (a_timelist[0] <= b_timelist[0]):
    time += b_timelist[0]
    counter += 1
    del b_timelist[0]
print(counter)

### FIXED CODE ###

N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a, b = [0], [0]
for i in range(N):
  a.append(a[i] + A[i])
for i in range(M):
  b.append(b[i] + B[i])
ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans, i + j)
print(ans)
from multiprocessing import Pool

### D - Triangles ###
 
N = int(input())
L = list(map(int, input().split()))
 
from itertools import combinations
 
cb = combinations(L, 3)
 
def my_def(x):
    if x[1] + x[2] > x[0]:
        if x[0] + x[2] > x[1]:
            if x[0] + x[1] > x[2]:
                return(1)
    return(0)
 
print(sum(list(map(my_def, cb))))

### FIXED CODE ###

### A - Curtain ###
A, B = map(int, input().split())
print(A-B*2 if A-B*2 > 0 else 0)
A, B, K = map(int, input().split())
L = []
for i in range(A, A + K):
    L.append(i)

for j in range(B - k + 1, B + 1):
    L.append(i)

L = sorted(L, reverse=True)

for l in L:
    print(l)

### FIXED CODE ###

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

for i in range(K):
    if A + i > B - i:
        break
    else:
        L.append(A + i)
        L.append(B - i)

L = set(L)
L = sorted(L)

for l in L:
    print(l)
import sys
sys.setrecursionlimit(500*500)
h,w = map(int,input().split())
hw = []
for i in range(h):
    hw.append(input())

todo = [(0,0)]
seen = [[200 for j in range(w)] for i in range(h)]
sx = 0
sy = 0
if hw[0][0] == '.':
    seen[0][0] = 0
else:
    seen[0][0] = 1




while len(todo)>0:
    sx,sy = todo.pop(0)
    if sx + 1 < w and seen[sx+1][sy] == 200:
        todo.append((sx+1,sy))
    if sx + 1 < w and hw[sx+1][sy] == '.' and seen[sx+1][sy] > seen[sx][sy]:
        seen[sx+1][sy] = seen[sx][sy]
    if sx + 1 < w and hw[sx+1][sy] == '#' and seen[sx+1][sy] > seen[sx][sy]+1:
        seen[sx+1][sy] = seen[sx][sy]+1
    if sy+1 < h and seen[sx][sy+1] == 200:
        todo.append((sx,sy+1))
    if sy + 1 < h and hw[sx][sy+1] == '.' and seen[sx][sy+1] > seen[sx][sy]:
        seen[sx][sy+1] = seen[sx][sy]
    if sy + 1 < h and hw[sx][sy+1] == '#' and seen[sx][sy+1] > seen[sx][sy]+1:
        seen[sx][sy+1] = seen[sx][sy]+1



print(seen[h-1][w-1])

### FIXED CODE ###

from collections import deque

h,w = map(int,input().split())
hw = []
for i in range(h):
    hw.append(input())

todo = deque([(0,0)])
seen = [[200 for j in range(w)] for i in range(h)]
sx = 0
sy = 0
if hw[0][0] == '.':
    seen[0][0] = 0
else:
    seen[0][0] = 1




while todo:
    sx,sy = todo.popleft()
    if sx + 1 < h and seen[sx+1][sy] == 200:
        todo.append((sx+1,sy))
    if sx + 1 < h and hw[sx+1][sy] == '.' and seen[sx+1][sy] > seen[sx][sy]:
        seen[sx+1][sy] = seen[sx][sy]
    if sx + 1 < h and hw[sx+1][sy] == '#' and seen[sx+1][sy] > seen[sx][sy]+1 and hw[sx][sy] == '.':
        seen[sx+1][sy] = seen[sx][sy]+1
    if sx + 1 < h and hw[sx+1][sy] == '#' and seen[sx+1][sy] > seen[sx][sy] and hw[sx][sy] == '#':
        seen[sx+1][sy] = seen[sx][sy]
    if sy+1 < w and seen[sx][sy+1] == 200:
        todo.append((sx,sy+1))
    if sy + 1 < w and hw[sx][sy+1] == '.' and seen[sx][sy+1] > seen[sx][sy]:
        seen[sx][sy+1] = seen[sx][sy]
    if sy + 1 < w and hw[sx][sy+1] == '#' and seen[sx][sy+1] > seen[sx][sy]+1 and hw[sx][sy] == '.':
        seen[sx][sy+1] = seen[sx][sy]+1
    if sy + 1 < w and hw[sx][sy+1] == '#' and seen[sx][sy+1] > seen[sx][sy] and hw[sx][sy] == '#':
        seen[sx][sy+1] = seen[sx][sy]



print(seen[h-1][w-1])
INPUT= input()
n, y = INPUT.strip().split(" ")
n = int(n)
y = int(y)
for i in range(n+2):
    for j in range(i+1,n+2):
        if flag == 1:
            break
        if y ==10000 *i + 5000* (j-i-1) + 1000 * (n-j+1):
            print("{} {} {}".format(i, j-i-1, n-j+1))
            flag = 1
            break
if flag == 0:
    print("-1 -1 -1")

### FIXED CODE ###

INPUT= input()
n, y = INPUT.strip().split(" ")
n = int(n)
y = int(y)
flag = 0
for i in range(n+2):
    for j in range(i+1,n+2):
        if flag == 1:
            break
        if y ==10000 *i + 5000* (j-i-1) + 1000 * (n-j+1):
            print("{} {} {}".format(i, j-i-1, n-j+1))
            flag = 1
            break
if flag == 0:
    print("-1 -1 -1")
A,B,N=map(int,input().split())

def g(t):
    return int(A*t/B)-A*int(t/B)

x=[i for i in range(0,N,1)]

y=[g(i) for i in x]

print(max(y))

### FIXED CODE ###

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

Ans='NG'

for i in range(A,B+1):
    if i%K==0:
        Ans='OK'
        break
        
print(Ans)
N, M = map(int, input().split())

group = []

MOD = 1000000007

if M == 0:
    group.append(N+1)
else:
    pre_a = int(input())
    group.append(pre_a)

    for i in range(M-1):
        a = int(input())
        tmp = a - pre_a - 1
        pre_a = a
        group.append(tmp)
    group.append(N - pre_a)

if 0 in group:
    print(0)
else:
    fiv = [0 for i in range(max(group))]
    fiv[0] = 1
    fiv[1] = 1
    for i in range(2, len(fiv)):
        fiv[i] = (fiv[i-1] + fiv[i-2]) % MOD
    ans = 1
    for g in group:
        ans *= fiv[g-1]
    print(ans%MOD)


### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N, M =map(int, input().split())
    a = [int(input()) for i in range(M)]

    sep = []
    pre = -1
    ok = True
    for t in a:
        tmp = t - pre - 1
        if tmp == 0:
            ok = False
            break
        sep.append(tmp)
        pre = t
    sep.append(N-pre)
    # print(sep)

    if not ok:
        print(0)
        return
    max_sep = max(sep)

    MOD = 1000000007
    fib = [1] * (max_sep)
    for i in range(2, max_sep):
        fib[i] = fib[i-2] + fib[i-1]
        fib[i] %= MOD
    
    ans = 1
    for s in sep:
        ans *= fib[s-1]
        ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()
m1, d1 = map(int, input().split)
m2, d2 = map(int, input().split)

if(m1 == m2):
    print('0')
    exit()
print('1')


### FIXED CODE ###

m1, d1 = map(int, input().split())
m2, d2 = map(int, input().split())

if(m1 == m2):
    print('0')
    exit()
print('1')
X=int(input())

for i in range(0, 1000):
    for j in range(-1000,0):
        if X == (i**5-j**5):
            print(i, j)
            exit()


### FIXED CODE ###

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

ans = [True]*N
ctr = 0

for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if H[a] >= H[b]: ans[b] = False
    if H[a] <= H[b]: ans[a] = False

for i in range(N):
    if ans[i]:
        ctr += 1

print(ctr)
from sys import stdin

lines = stdin.readlines()

n = int(lines[0].rstrip())
s = str(lines[1].rstrip())

counter = 0
for i in range(n-2):
if s[i] == 'A':
    if s[i+1] == 'B':
        if [i+2] == 'C':
            counter += 1
print(counter)

### FIXED CODE ###

from sys import stdin

lines = stdin.readlines()

n = int(lines[0].rstrip())
s = str(lines[1].rstrip())

counter = 0
for i in range(n-2):
    if s[i] == 'A':
        if s[i+1] == 'B':
            if s[i+2] == 'C':
                counter += 1
print(counter)
list1 = input().split(' ')
list1 = list(map(int, list1))
a = list1[0]
b = list1[1]


ans1 = a // b
ans1 = str(ans1)
ans2 = a % b
ans2 = str(ans2)
ans3 = a / b
ans3 = str(ans3)

print("{0} {1} {2:.5f}".format(ans1, ans2, ans3))

### FIXED CODE ###

list1 = input().split(' ')
list1 = list(map(int, list1))
a = list1[0]
b = list1[1]


ans1 = a // b
ans2 = a % b
ans3 = a / b

print("{0} {1} {2:.6f}".format(ans1, ans2, ans3))
s=input()
n=len(s)
for i in range(n):
  s[i]=x
print(s)

### FIXED CODE ###

s=input()
n=int(len(s))
print("x"*n)
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:
    Min = min(A,B)
    pr = primes(Min)
    c = 0
    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, y = map(int, input().split())
y = y/1000
answer= []

for rep1 in range(n + 1):
    for rep2 in range(n + 1):
        for rep3 in range(n + 1):
            if rep1 + rep2 + rep3 == n and rep1 * 10 + rep2 * 5 + rep3 == y:
                answer = ([rep1, rep2, rep3])
                break

print(counter) if counter != [] else print("-1 -1 -1")

### FIXED CODE ###

n, y = map(int, input().split())
y = y/1000
answer= []

for ten in range(n + 1):
    for five in range(n + 1 - ten):
        one = n - ten - five
        if ten * 10 + five * 5 + one == y:
            answer = [ten, five, one]
            break

print(answer[0], answer[1], answer[2]) if answer != [] else print("-1 -1 -1")
# アリ１からNまでの前後関係は不変。つまり、アリ１からNまでの順番は保たれる。
# アリの最終座標の昇順リストを用意して、アリ１からNに対応させればよい。

n,l,t=map(int,input().split())
x=[0 for i in range(n+1)]
w=[0 for i in range(n+1)]
ans=[]　# アリの最終座標リスト
w1=[]　# w=1のアリの初期座標リスト
w2=[]　# w=2のアリの初期座標リスト

for i in range(1,n+1):
    x[i],w[i]=map(int,input().split())
    if w[i]==1: a=(x[i]+t)%l; w1.append(x[i])
    if w[i]==2: a=(x[i]-t+l)%l; w2.append(x[i])
    ans.append(a)

# kはアリ同士がすれ違った数
k=0
for i in range(n):
    if w[i]==1:　# もしw=1のアリがいないならk=0のままで問題なし。
        if (x[i]+2*t)>=l:
            for j in range(x[i],x[i]+2*t+1): k+=w2.count(j)
            for j in range((x[i]+2*t+1)%l,x[i]): k+=w2.count(j)
        else:
            for j in range(x[i],x[i]+2*t+1): k+=w2.count(j)
        break　# １つw=1のアリ見つけたらそこで終了。

# ansをソートしてkだけ円順列的にずらして出力
ans.sort()
for i in range(n): print(ans[(i+k)%n])



### FIXED CODE ###


# アリ１からNまでの前後関係は不変。つまり、アリ１からNまでの順番は保たれる。
# アリの最終座標の昇順リストを用意して、アリ１からNに対応させればよい。

n,l,t=map(int,input().split())
x=[]
w=[]
ans=[]

crash=0
for i in range(n):
    xx,ww=map(int,input().split())
    x.append(xx); w.append(ww)
    if w[i]==1: anss=(x[i]+t)%l
    else: anss=(x[i]-t+l)%l
    ans.append(anss)
    if i!=0 and w[i] != w[0]:
        if w[0] == 1: crash += (t-((x[i]-x[0])/2)) // (l/2) + 1
        else: crash += (t-(l-(x[i]-x[0]))/2) // (l/2) + 1

# あり１の現在のゼッケン番号num0
if w[0]==1: num0 =int(crash)%n
else: num0 =int(-crash)%n
# あり１の現在地点に対応する昇順リストの番号num
nowplace = ans[0]
ans.sort()
num = ans.index(nowplace)
if w[0]==1 and ans.count(nowplace)==2: num += 1 # ２つ該当する場合の処理
# numがnum0の位置であるように調整したい
gap = num0-num
for i in range(n):
    i = (i-gap)%n
    print(ans[i])
N = int(input())
X = list(map(int, input().split()))
sum = 0
all = True
max = 0
for a in X:
    sum = sum + a
    if max <= a:
        max = a + 1
    for c in X:
        if(a != c):
            all = False
ans = 0
for b in X:
    ans = ans + (b-math.ceil(max))**2
if all == True:
    ans = 0
    print(ans)
else:
    print(ans)


### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
sum = 0
all = True
for a in X:
    sum = sum + a
C = int(sum / N + 0.5)
ans = 0
for b in X:
    ans = ans + (b-C)**2
print(ans)
import sys
sys.setrecursionlimit(200005)
n, q = map(int, input().split())

to = [[] for i in range(n+1)]


for i in range(n-1):
    a, b = map(int, input().split())
    to[a].append(b)
    to[b].append(a)

score = [0]*(n+1)
h = [0] * (n+1)
for i in range(q):
    p, x = map(int, input().split())
    h[p] += x


def down_tree(index, parent):
    global score
    score[index] += score[parent] + h[index]
    for i in to[index]:
        if i == parent:
            continue
        down_tree(i, index)
    return


down_tree(1, 1)

print(' '.join(map(str, score[1:])))

### FIXED CODE ###

a = int(input())
s = input()

if a >= 3200:
    print(s)
else:
    print("red")
A,B,C = map(int,input().split())
money = A+B
if C>money:
    print('No')
else:
    print('Yes)

### FIXED CODE ###

A,B,C = map(int,input().split())
money = A+B
if C>money:
    print('No')
else:
    print('Yes')
x,y,z = map(int,input().stlip())
x = int(x)
y = int(y)
z = int(z)
if x＊y > z:
  print(x＊y)
else:
  print(z)


### FIXED CODE ###

x,y,z = map(int,input().split())
x = int(x)
y = int(y)
z = int(z)
if x*y < z:
  print(x*y)
else:
  print(z)
def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0
    max_height = 0

    for height in A:
        if max_height < height:
            max_height = height
        else:
            count += max_height - height
    print(count)


if __name__ == '__

### FIXED CODE ###

def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = 0
    max_height = 0

    for height in A:
        if max_height < height:
            max_height = height
        else:
            count += max_height - height
    print(count)


if __name__ == '__main__':
    main()
#AGC C
import math
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(n-1):
    for j in range(i+1,n):
        s=(s+(a[i]*a[j])//(math.gcd(a[i],a[j])))%998244353
print(s) 

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
V=max(A)
mod=998244353
data=[0]*(V+1)
data[1]=1
for i in range(2,V+1):
    data[i]=-(mod//i)*data[mod%i]%mod
for i in range(1,V+1):
    for j in range(2,V//i+1):
        data[i*j]=(data[i*j]-data[i])%mod
lst=[0]*(V+1)
for a in A:
    lst[a]+=1
mod_2=pow(2,mod-2,mod)
ans=0
for i in range(1,V+1):
    sum_1=0
    sum_2=0
    for j in range(1,V//i+1):
        zzz=i*j
        sum_1+=zzz*lst[zzz]
        sum_2+=zzz**2*lst[zzz]
    ans=(ans+(sum_1**2-sum_2)*data[i]*mod_2)%mod
print(ans)
S = input()
atcg = ["A","T","C","G"]
num_lis =[]
for idx,s in enumerate(S):
  if s in atcg:
    num_lis.append(idx)

ans_lis =[]
x = 0

for i in range(len(S)):
  if i in num_lis:
    x += 1
  else:
    ans_lis.append(x)
    x = 0
    
print(max(ans_lis))
    

### FIXED CODE ###

s = input()
cnt = [0]*(len(s))
for i in range(len(s)):
  for j in range(i,len(s)):
    if s[j] in ["A","C","G","T"]:
      cnt[i] += 1
    else:
      break

print(max(cnt))