Harryxun/stf_run huggingface dataset:
s =input()
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

### FIXED CODE ###

s =input()
s += ' '
ACGT = ['A', 'C', 'G', 'T']

cnt_list = []
cnt = 0
for i in s:
    if i in ACGT:
        cnt += 1
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))
amap = {}
cnt = 0
n = int(input())
for i in range(n):
  s = "".join(sorted(input()))
  if s in amap:
    cnt += amap[s]
  amap[s] += 1

print(cnt)

### FIXED CODE ###

amap = {}
cnt = 0
n = int(input())
for i in range(n):
  s = "".join(sorted(input()))
  if s in amap:
    cnt += amap[s]
    amap[s] += 1
  else:
    amap[s] = 1

print(cnt)
a,b = map(int,input().split())
if (a+b)%3 == 0:
  n = (a+b)/3
  aa = math.factorial(a-n)
  bb = math.factorial(b-n)
  cc = math.factorial(n)
  print((cc/(bb*aa))%(10**9+7))
else:
  print(0)

### FIXED CODE ###

import math
import numpy as np

def cmb(n, r, mod):
  r = min(r, n-r)
  return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 
N = 10**6
g1 = [1, 1] 
g2 = [1, 1] 
inverse = [0, 1] 

for i in range( 2, N + 1 ):
  g1.append( ( g1[-1] * i ) % mod )
  inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
  g2.append( (g2[-1] * inverse[-1]) % mod )

x,y = map(int,input().split()) 

if (x+y) % 3 == 0:

  A = np.array([[1, 2],
                [2, 1]])

  b = np.array([x, y])

  N = np.linalg.solve(A, b)


  if N[0].is_integer() == True and N[1].is_integer() == True and N[0] >=0 and N[1] >=0:
        
      print(cmb(int(N[0]+N[1]),int(N[0]),mod))

  else:
      print(0)

else:
  print(0)
import math
 
a = []
for i in range(2):
    a.append(input())
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import math
 
a = []
for i in range(2):
    a.append(int(input()))
tmp = math.floor(a[0]/500)
tmp1 = a[0] - tmp*500
if a[1] >= tmp1:
    print('Yes')
else:
    print('No')
N = int(input())
lst = []
count = 0
st = []

for i in range(N):
  if i==0:
    in_pu = input()
    l = list(in_pu)
    lst.append(in_pu)
    st.append(set(l))
    continue
    
  in_pu = input()
  l = list(in_pu)
  lst.append(list(in_pu))
  
  if set(l) in st:
    count = count + 1 
print(count+len(list(set(lst))))

### FIXED CODE ###

N = int(input())

lst = []

for i in range(N):
    lst.append("".join(sorted(list(input()))))


d={}
count = 0

for i in lst:
  if not i in d:
    d[i] = 1
    continue
  else:
    d[i] = d[i] + 1
    count = count + d[i]-1


print(count)
/*
g++ main.cpp --std=c++14; ./a.out < input.txt
*/
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<tuple>

using namespace std;

const auto mod = 1000000007L;

typedef long long ll;

template<typename T>
using V = vector<T>;

template<typename K, typename V>
using M = map<K,V>;

ll sum(tuple<ll,ll,ll> const & t, V<ll> const & A, V<ll> const & B, V<ll> const & C) {
        auto a = get<0>(t);
        auto b = get<1>(t);
        auto c = get<2>(t);
        return A[a]+B[b]+C[c];
}

int main() {
    int X,Y,Z,K;
    cin>>X>>Y>>Z>>K;
    auto A=V<ll>(X);
    for(size_t i = 0; i < X; i++)cin>>A[i];
    sort(A.begin(), A.end(), [](auto a, auto b){return a>b;});
    auto B=V<ll>(Y);
    for(size_t i = 0; i < Y; i++)cin>>B[i];
    sort(B.begin(), B.end(), [](auto a, auto b){return a>b;});
    auto C=V<ll>(Z);
    for(size_t i = 0; i < Z; i++)cin>>C[i];
    sort(C.begin(), C.end(), [](auto a, auto b){return a>b;});
    auto Q=multimap<ll, tuple<ll, ll, ll>, greater<ll>>();
    Q.insert(decltype(Q)::value_type(sum(make_tuple(0,0,0), A, B, C), make_tuple(0,0,0)));
    for(size_t k = 0; k < K; k++)
    {
        auto t = Q.begin();
        cout << t->first << "\n";
        auto a = get<0>(t->second);
        auto b = get<1>(t->second);
        auto c = get<2>(t->second);
        Q.erase(t) ;
        auto d=make_tuple(a, b, c+1);
        if (c+1<X) Q.insert(decltype(Q)::value_type(sum(d, A, B, C), d));
        auto e=make_tuple(a, b+1, c);
        if (c+1<Y) Q.insert(decltype(Q)::value_type(sum(e, A, B, C), e));
        auto f=make_tuple(a+1, b, c);
        if (c+1<Z) Q.insert(decltype(Q)::value_type(sum(f, A, B, C), f));
    }
}

### FIXED CODE ###

"""
python3 main.py < input.txt
"""
import math
import itertools as it
import heapq

X,Y,Z,K=map(int, input().split())
A=list(sorted(map(int, input().split()), reverse=True))
B=list(sorted(map(int, input().split()), reverse=True))
C=list(sorted(map(int, input().split()), reverse=True))

def evaluate(x,y,z): return (-A[x]-B[y]-C[z], x,y,z)

Q=[]
heapq.heappush(Q, evaluate(0,0,0))
for i in range(1,K+1):
    (e,x,y,z) = heapq.heappop(Q)
    print(-e)
    if x+1 < X and evaluate(x+1, y, z) not in Q:
        heapq.heappush(Q, evaluate(x+1, y, z))
    if y+1 < Y and evaluate(x, y+1, z) not in Q:
        heapq.heappush(Q, evaluate(x, y+1, z))
    if z+1 < Z and evaluate(x, y, z+1) not in Q:
        heapq.heappush(Q, evaluate(x, y, z+1))
number = 2^3:
    return = number
print("number")


### FIXED CODE ###

x = int(input())
print(x**3)
a = [int(x) for x in input().split()]
if a[0] >= a[1]:
  if a[0] >= a[2] and a[2] >= a[1]:
    print(Yes)
  else:
    print(No)
else:
  if a[1] >= a[2] and a[2] >= a[0]:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

a = [int(x) for x in input().split()]
if a[0] >= a[1]:
  if a[0] >= a[2] and a[2] >= a[1]:
    print("Yes")
  else:
    print("No")
else:
  if a[1] >= a[2] and a[2] >= a[0]:
    print("Yes")
  else:
    print("No")
a = str(input())

  
if len(a) == 5 or a[1:4] == "000":
  print(0)
  
elif len(a) == 3:
  print(1000 - int(a))
  
else:
  z = a[1:4]
  if z == "000":
    print(0)
  else:
    print(1000 - int(z))


### FIXED CODE ###

a = input()

st = str(a)


if st[-3:] == "000":
  print(0)


else:
  z = st[-3:]
  print(1000 - int(z))
N=int(input())
P=list(map(int,input().split()))
import math
min_num = math.inf
count=0
for p in P:
    if p <= min_num:
        min_num = p
        count += 1
print(count)


### FIXED CODE ###

N=int(input())
P=list(map(int,input().split()))
count=0
for i,p in enumerate(P):
    if i ==0:
        min_num=p
        count += 1
        continue
    if p <= min_num:
        min_num = p
        count += 1
print(count)
def euclid(x, y):
    c0, c1 = x, y
    a0, a1 = 1, 0
    b0, b1 = 0, 1
 
    while c1 != 0:
        m = c0 % c1
        q = c0 // c1
 
        c0, c1 = c1, m
        a0, a1 = a1, (a0 - q * a1)
        b0, b1 = b1, (b0 - q * b1)
 
    return a0, b0

n=int(input())
n*=2
soinsu=[]

num=n
for i in range(2,n):
    if(i*i>n):
        if(num!=1):
            soinsu.append([num,1])
        break
    if(num%i!=0):
        continue
    cnt=0
    while(num%i==0):
        cnt+=1
        num//=i
    soinsu.append([i,cnt])

kazu=len(soinsu)


ans=[]
for i in range(2**(kazu-1)):
    a=1
    for j in range(kazu):
        if((i&1<<j)!=0):
            a*=soinsu[j][0]**soinsu[j][1]
    b=n//a
    c,d=euclid(a,b)
    if(c*d==0):
        c+=b
        d+=a
    ans.append(max(a*c,b*d))

print(min(ans)-1)

### FIXED CODE ###

def euclid(x, y):
    c0, c1 = x, y
    a0, a1 = 1, 0
    b0, b1 = 0, 1
 
    while c1 != 0:
        m = c0 % c1
        q = c0 // c1
 
        c0, c1 = c1, m
        a0, a1 = a1, (a0 - q * a1)
        b0, b1 = b1, (b0 - q * b1)
 
    return a0, b0

n=int(input())
n*=2
soinsu=[]

num=n
for i in range(2,max(10,n)):
    if(i*i>n):
        if(num!=1):
            soinsu.append([num,1])
        break
    if(num%i!=0):
        continue
    cnt=0
    while(num%i==0):
        cnt+=1
        num//=i
    soinsu.append([i,cnt])

kazu=len(soinsu)
#print(soinsu,kazu)


ans=[]
for i in range(2**(kazu-1)):
    a=1
    for j in range(kazu):
        if((i&1<<j)!=0):
            a*=soinsu[j][0]**soinsu[j][1]
    b=n//a
    c,d=euclid(a,b)
    if(c*d==0):
        c+=b
        d+=a
    ans.append(max(a*c,b*d))
    #print(a,b,c,d)


if(kazu==1):
    print(min(ans)-2)
else:
    print(min(ans)-1)
c_list = list(map(int, input().split()))
c_list.sort()
if sort[0] + sort[1] == sort[2]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

c_list = list(map(int, input().split()))
c_list.sort()

if c_list[0] + c_list[1] == c_list[2]:
  print('Yes')
else:
  print('No')
N , Q = map(int,input().split())

D = [0]*Q
Input = []
length = [-1]*Q

for i in range(N):
    Input.append(list(map(int,input().split())))

# 距離順でソート
dist = lambda A : A[2]
Input.sort(key=dist)

for i in range(Q):
    D[i] = [i,int(input())]

# 出発時刻でソート
time = lambda A : A[1]
D.sort(key=time)

# i番目の人の座標を計算
skip = 0
for start in D:
    for j in range(N-skip):
        if(Input[j][1] <= start[1]): # 工事終了時刻 <= 出発時刻
            Input.pop(j)
            skip += 1
            continue

        stopTime = Input[j][2] + start[1] # 出発時刻 + 距離/速度

        if(stopTime >= Input[j][0] - 0.5 and stopTime <= Input[j][1] - 0.5): # 工事期間内
            length[start[0]] = Input[j][2]
            break

for i in range(Q):
    print(length[i])


### FIXED CODE ###

import sys
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

N, Q = map(int, input().split())
INF = float('inf')

events = []
for i in range(N):
    S, T, X = map(int, input().split())
    events.append((S - X, 0, X))
    events.append((T - X, 1, X))

for _ in range(Q):
    events.append((int(input()), 2, 0))

events.sort()

cnt = defaultdict(int)
cnt[INF] += 1
que = [INF]

for t, flag, x in events:
    if flag == 0:
        if cnt[x] == 0:
            heappush(que, x)
        cnt[x] += 1
    elif flag == 1:
        cnt[x] -= 1
    else:
        while cnt[que[0]] == 0:
            heappop(que)
        print(que[0] if que[0] != INF else -1)
N = int(input())
A = list(map(int, input().split()))
A.sort()
B = [0] * (2 * 10 ** 5 + 1)
M = max(A)

for a in A:
	B[a] += 1

if max(B) == N:
	print(0)
else:
	for a in A:
		pass

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
M = max(A)
B = [0] * (M + 1)

for a in A:
    B[a] += 1

for a in A:
    if B[a] > 0:
        i = 2
        b = a * i
        while b <= M:
            B[b] = 0
            i += 1
            b = a * i
for i in range(M + 1):
    if B[i] > 1:
        B[i] = 0
print(sum(B))
# -*- coding: utf-8 -*-

def get_count(S, H, W, i, j):
    num = 0
    start_i = start_j = -1
    end_i = end_j = 2
    if i == 0:
        start_i = 0
    elif i == W-1:
        end_i = 1
    if j == 0:
        start_j = 0
    elif j == H-1:
        end_j = 1

    for y in range(start_j, end_j, 1):
        for x in range(start_i, end_i, 1):
            if S[j+y][i+x] == "#":
                num += 1

    return num


H,W = map(int, input().split())
S = []
for i in range(H):
    S.append(list(input()))

for y in range(H):
    for x in range(W):
        if S[y][x] == ".":
            num = get_count(S, H, W, x, y)
            S[y][x] = str(num)

for y in range(H):
    print("".join(S[y]))            


### FIXED CODE ###

# -*- coding: utf-8 -*-

def get_count(S, H, W, i, j):
    num = 0
    start_i = start_j = -1
    end_i = end_j = 2
    if W == 1:
        start_i = 0 
        end_i = 1
    else:
        if i == 0:
            start_i = 0
        elif i == W-1:
            end_i = 1
    if H == 1:
        start_j = 0
        end_j = 1
    else:
        if j == 0:
            start_j = 0
        elif j == H-1:
            end_j = 1

    for y in range(start_j, end_j, 1):
        for x in range(start_i, end_i, 1):
            if S[j+y][i+x] == "#":
                num += 1

    return num


H,W = map(int, input().split())
S = []
for i in range(H):
    S.append(list(input()))

for y in range(H):
    for x in range(W):
        if S[y][x] == ".":
            num = get_count(S, H, W, x, y)
            S[y][x] = str(num)

for y in range(H):
    print("".join(S[y]))
print(x^3)

### FIXED CODE ###

x=int(input())
print(x**3)
print(min(int(input(),int(input()))+min(int(input(),int(input()))))

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a,b)+min(c,d))
a,b,c,d = [int(x) for x in input()]
s = a+b
t = c+d
if s==t:
    print("Balanced")
elif s>t:
    print("Left")
else:
    print("Right")


### FIXED CODE ###

a,b,c,d = [int(x) for x in input().split()]
s = a+b
t = c+d
if s==t:
    print("Balanced")
elif s>t:
    print("Left")
else:
    print("Right")
t=list(input())
n=len(t)
if t[0]=="?":
    if t[1]=="P":
            t[0]="D"
    if t[1]=="D":
            t[0]="P"
    elif t[1]=="?":
        t[0]="P"
for i in range(1,n):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        if t[i-1]=="D":
            t[i]="P"
print("".join(t))

### FIXED CODE ###

t=list(input())
n=len(t)
for i in range(n):
    if t[i]=="?":
        t[i]="D"
print("".join(t))
n = int(input())
g = [[] for _ in range(n * n)]
v = [0] * (n * n)
for i in range(n):
    a = list(map(int, input().split()))
    for j in range(n - 2):
        p, q = min(i, a[j] - 1), max(i, a[j] - 1)
        s, t = min(i, a[j + 1] - 1), max(i, a[j + 1] - 1)
        g[p * n + q].append(s * n + t)
        v[s * n + t] += 1
s = []
vs = [1] * (n * n)
l = []
for i in range(n):
    for j in range(i + 1, n):
        if v[i * n + j] == 0:
            s.append(i * n + j)
            vs[i * n + j] = 0
ans = 0
while s:
    p = s.pop()
    l.append(p)
    vs[p] = 0
    for node in g[p]:
        if vs[node]:
            v[node] -= 1
            if v[node] == 0:
                s.append(node)
if len(l) * 2 != n * (n - 1):
    print(-1)
    exit(1)
d = [0] * (n * n)
for x in l:
    for node in g[x]:
        d[node] = d[x] + 1
print(d[l[-1]] + 1)


### FIXED CODE ###

n = int(input())
g = [[] for _ in range(n ** 2)]
inv = [0] * (n ** 2)
for i in range(n):
    a = list(map(lambda x: int(x)-1, input().split()))
    for j in range(n - 2):
        p, q = min(i, a[j]), max(i, a[j])
        r, s = min(i, a[j + 1]), max(i, a[j + 1])
        g[p * n + q].append(r * n + s)
        inv[r * n + s] += 1
s = []
for i in range(n):
    for j in range(i + 1, n):
        if inv[i * n + j] == 0:
            s.append(i * n + j)
d = [0] * (n ** 2)
while s:
    p = s.pop()
    for node in g[p]:
        d[node] = max(d[node], d[p] + 1)
        inv[node] -= 1
        if inv[node] == 0:
            s.append(node)
for i in range(n):
    for j in range(i + 1, n):
        if inv[i * n + j] > 0:
            print(-1)
            exit(0)
print(max(d) + 1)
A,B = map(int,input().split())
def prime_number_set(n):
  N = n
  result = set()
  for i in range(2,int(N**0.5)+1):
    while n%i == 0:
      n /= i
      result.add(i)
    if n <= 1:
      break
  return result

arrayA = prime_number_set(A)
arrayB = prime_number_set(B)
array = arrayA & arrayB
print(len(array)+1)

### FIXED CODE ###

a = int(input())
if (a % 2)== 0:
  result = 0.5
else:
  result = ((a-1)/2 +1)/a
  
print(result)
def gcd(a,b):
    if a<b:
        a,b = b,a
    while b:
        a,b = b,a%b
    return a

N = int(input())
A = list(map(int,input().split()))
def L(i):
    if i == 0 or i == 1:
        return 0
    else:
        return(gcd(L(i-1),A[i-2]))
def R(i):
    if i == N+1:
        return 0
    else:
        return(gcd(R(i+1),A[i-1]))
gcd_max = 0
for i in range(N):
    gcd_max = max(gcd_max,gcd(L(i),R(i+1)))
print(gcd_max)

### FIXED CODE ###

def gcd(x,y):
    while y != 0:
        x,y = y,x%y
    return x
n = int(input())
a = list(map(int,input().split()))

L,R = [0],[0]
for i in range(1,n+1): #L[i]は左i個,R[i]は右i個
    L.append(gcd(L[-1],a[i-1]))
    R.append(gcd(R[-1],a[n-i]))
print(max(gcd(L[i],R[n-i-1]) for i in range(n)))
N = int(input())
H = []

for k in range(N):
    H.append(input())
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, -1, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if k == 0:
        print("Yes")
        

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
    
if N == 1:
    print("Yes")
    
else:
    for i in range(N - 1, 0, -1):
        if H[i] - H[i - 1] == -1:
            H[i - 1] -= 1
            
        elif H[i] - H[i - 1] < -1:
            print("No")
            break
            
    if i == 1:
        print("Yes")
n,k=map(int,input().split())
p=list(map(int,input().split()))
p2=p.sort()
print(sum(p2[:k]))

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
p2=sorted(p)
print(sum(p2[:k]))
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	ans := 0
	for i := 1; i < n; i++ {
		ans += i
	}

	fmt.Println(ans)
}

### FIXED CODE ###

n = int(input())
print(n*(n-1)//2)
import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] = "##":
            print("No")
            exit()
    if c > d:
        print("Yes")
        break
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0

if __name__ == "__main__":
    solve()

### FIXED CODE ###

import math
import collections
import fractions
import itertools
import functools
import  operator

def solve():
    n, a, b, c, d = map(int, input().split())
    s = input()
    for i in range(a, max(c,d)):
        if s[i-1:i+1] == "##":
            print("No")
            exit()
    if c < d:
        print("Yes")
        exit()
    for i in range(b-1, d):
        if s[i-1:i+2] == "...":
            print("Yes")
            exit()
    print("No")
    return 0

if __name__ == "__main__":
    solve()
A,B,C = map(int,input().split())
x = C-A+B
if X < 0:
X = 0
print(X)

### FIXED CODE ###

A,B,C = map(int,input().split())
X = C - A + B
if X < 0:
    X = 0
print(X)
class Node(object):
    def __init__(self, V):
        self.V = V
        self.d = float('inf')
        self.p = -1
        self.state = -1
        # -1 -> undiscovered
        #  1 -> finished
        #  0 -> found(not finished)


M = [float('inf')] * 5
for i in range(5):
    M[i] = [float('inf')] * 5

n = int(input())
nodes = [0] * 100
for i in range(n):
    V = [int(x) for x in input().split()] 
    for (j,m) in enumerate(V):
        M[i][j] = m if not m == -1 else float('inf') 
    nodes[i] = Node([])

nodes[0].d = 0
while True:
    mincost = float('inf')
    u = -1
    for i in range(n):
        node = nodes[i]
        if (mincost > node.d) and (node.state != 1):
            u = i
            mincost = node.d

    if u == -1:
        break

    nodes[u].state = 1
    for v in range(n):
        node = nodes[v]
        if (node.state != 1) and (M[u][v] != float('inf')):
            if node.d > M[u][v]:
                node.d = M[u][v]
                node.p = u
                node.state = 0

sum = 0
for i in range(n):
    if nodes[i].p != -1:
        sum += M[i][nodes[i].p]

print(sum)

### FIXED CODE ###

class Node(object):
    def __init__(self, V):
        self.V = V
        self.d = float('inf')
        self.p = -1
        self.state = -1
        # -1 -> undiscovered
        #  1 -> finished
        #  0 -> found(not finished)


M = [float('inf')] * 100
for i in range(100):
    M[i] = [float('inf')] * 100

n = int(input())
nodes = [0] * 100
for i in range(n):
    V = [int(x) for x in input().split()] 
    for (j,m) in enumerate(V):
        M[i][j] = m if not m == -1 else float('inf') 
    nodes[i] = Node([])

nodes[0].d = 0
while True:
    mincost = float('inf')
    u = -1
    for i in range(n):
        node = nodes[i]
        if (mincost > node.d) and (node.state != 1):
            u = i
            mincost = node.d

    if u == -1:
        break

    nodes[u].state = 1
    for v in range(n):
        node = nodes[v]
        if (node.state != 1) and (M[u][v] != float('inf')):
            if node.d > M[u][v]:
                node.d = M[u][v]
                node.p = u
                node.state = 0

sum = 0
for i in range(n):
    if nodes[i].p != -1:
        sum += M[i][nodes[i].p]

print(sum)
n = int(input())
a = [0] + list(map(int, input().split()))
for i in range(n // 2, 0, -1):
    a[i] = sum(a[i::i]) % 2
print(sum(a))
print(*(i for i, b in enumerate(a) if b))

### FIXED CODE ###

r = int(input())
print(3*r**2)
import heapq
def main():
    H, W, M = map(int, input().split())

    bn_h = {}
    bn_v = {}

    for i in range(M):
        h, w = map(int, input().split())
        bn_h.setdefault(h, set())
        bn_h[h].add(w)
        bn_v.setdefault(w, set())
        bn_v[w].add(h)

    b1 = sorted(bn_h.items(), key = lambda x:len(x[1]), reverse=True)
    b2 = sorted(bn_v.items(), key = lambda x:len(x[1]), reverse=True)

    m1 = len(b1[0][1])
    m2 = len(b2[0][1])

    max_result = 0
    for i in b1:
        h, sh = i
        if len(sh) < m1:
            break
        for j in b2:
            v, sv = j
            if len(sv) < m2:
                break
            result = len(sh) + len(sv) - 1
            if h not in sv:
                result += 1
            flag = True
            max_result = max(max_result, result)
            if flag = True:
                break
        if flag = True:
            break
    print(max_result)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import heapq
def main():
    H, W, M = map(int, input().split())

    bn_h = {}
    bn_v = {}

    for i in range(M):
        h, w = map(int, input().split())
        bn_h.setdefault(h, set())
        bn_h[h].add(w)
        bn_v.setdefault(w, set())
        bn_v[w].add(h)

    b1 = sorted(bn_h.items(), key = lambda x:len(x[1]), reverse=True)
    b2 = sorted(bn_v.items(), key = lambda x:len(x[1]), reverse=True)

    m1 = len(b1[0][1])
    m2 = len(b2[0][1])

    flag = False
    max_result = 0
    for i in b1:
        h, sh = i
        if len(sh) < m1:
            break
        for j in b2:
            v, sv = j
            if len(sv) < m2:
                break
            result = len(sh) + len(sv) - 1
            if h not in sv:
                result += 1
                flag = True
            max_result = max(max_result, result)
            if flag == True:
                break
        if flag == True:
            break
    print(max_result)

if __name__ == '__main__':
    main()
n=int(input())
dic = dict()

a = 0
for i in range(n):
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for in in range(len(ans)):
    print(ans)

### FIXED CODE ###

n=int(input())
dic = dict()

a = 0
for i in range(n):
    s = str(input())
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
    if dic[s] > a:
        a = dic[s]
box= []
for i in dic:
    if dic[i] == a:
        box.append(i)

ans = sorted(box)
for i in range(len(ans)):
    print(ans[i])
import math
A,B,C,D=map(int,input().split())


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


#print(len([x for x in range(A,B) if x%2!=0 and x%3!=0]))

size=B-A+1
#C
C2=A%C
if C2 is 0:
    Csize=size
else:
    C2=C-C2
    Csize=size-C2

#D
D2=A%D
if D2 is 0:
    Dsize=size
else:
    D2=D-D2
    Dsize=size-D2

cd =lcm(C,D)

#c,dの最小公倍数
cd2=A%cd
if cd2 is 0:
    CDsize=size
else:
    cd2=cd-cd2
    CDsize=size-cd2

#Cの個数
Cq=Csize//C

#Dの個数
Dq=Dsize//D

#CDの個数
CDq=CDsize//cd

Q=size-(Cq+Dq-CDq)
print(Q)












"""
listsize=B-A-1
Q=0
for i in range(listsize+1):
    number=i+A
    if number % C is not 0 and number % D is not 0:
        Q+=1
print(Q)
"""




### FIXED CODE ###

from fractions import gcd
A,B,C,D=map(int,input().split())


def lcm(x, y):
    return (x * y) // gcd(x, y)

size=B

cd=lcm(C,D)
allC=size//C
allD=size//D
allcd=size//cd
ALL=size-(allC+allD-allcd)

size=A-1
cd=lcm(C,D)
pC=size//C
pD=size//D
pcd=size//cd
P=size-(pC+pD-pcd)

print(ALL-P)
s = [input()]
print(s[2], s[0], s[1])

### FIXED CODE ###

a,b,c=map(int,input().split())
print(c, a, b)