Harryxun/stf_run huggingface dataset:
a=int(input())
import math
print(sum(gcd(gcd(i,j),k)for i in range(1,a+1) for j in range(1,a+1) for k in range(1,a+1)))

### FIXED CODE ###

a=int(input())
import math
print(sum(math.gcd(math.gcd(i,j),k)for i in range(1,a+1) for j in range(1,a+1) for k in range(1,a+1)))
a,b,c,d=map(int,input().split())
def gcd(x,y):
  if x%y==0:
    return y
  else:
    return gcd(x%y,y)
    
r=(c*d)/gcd(c,d)    
s=(b//c)-((a-1)//c)
t=(b//d)-((a-1)//d)
u=(b//r)-((a-1)//r)

print(int(b-a+1-s-t+u))


### FIXED CODE ###

a,b,c,d=map(int,input().split())
def gcd(x,y):
  if x%y==0:
    return y
  else:
    return gcd(y,x%y)
    
r=int((c*d)/gcd(c,d)) 
s=(b//c)-((a-1)//c)
t=(b//d)-((a-1)//d)
u=(b//r)-((a-1)//r)

print(int(b-a+1-s-t+u))
paper = [0 for i in range(100)]
white_points = None
deep_points = None

def small(x, y):
    p = [[x, y]]
    for i, j in zip([-1, 0, 1, 0], [0, -1, 0, 1]):
        p.append([x + i, y + j])
    return p

def middle(x, y):
    p = small(x, y)
    for i, j in zip([1, -1] * 2, [1, 1, -1, -1]):
        p.append([x + i, y + j])
    return p

def big(x, y):
    p = middle(x, y)
    for i, j in zip([-2, 0, 2, 0], [0, -2, 0, 2]):
        p.append([x + i, y + j])
    return p

while True:
    try:
        x, y, size = map(int, input().split(','))
    except:
        print(paper.count(0))
        print(max(paper))
        break

    if size == 1:
        bp = small(x, y)
    elif size == 2:
        bp = middle(x, y)
    elif size == 3:
        bp = big(x, y)
    for p in bp:
        paper[p[0] * 10 + p[1]] += 1

### FIXED CODE ###

#!/usr/bin/python

paper = [[0] * 10 for i in range(10)]

def small(x, y):
    p = [[x, y]]
    for i, j in zip([-1, 0, 1, 0], [0, -1, 0, 1]):
        p.append([x + i, y + j])
    return p

def middle(x, y):
    p = small(x, y)
    for i, j in zip([1, -1, 1, -1], [1, 1, -1, -1]):
        p.append([x + i, y + j])
    return p

def big(x, y):
    p = middle(x, y)
    for i, j in zip([-2, 0, 2, 0], [0, -2, 0, 2]):
        p.append([x + i, y + j])
    return p

while True:
    try:
        x, y, size = map(int, input().split(','))
    except:
        break

    if size == 1:
        bp = small(x, y)
    elif size == 2:
        bp = middle(x, y)
    elif size == 3:
        bp = big(x, y)
    for p in bp:
        if 0 <= p[0] < 10 and 0 <= p[1] < 10:
            paper[p[1]][p[0]] += 1

print(sum(paper[y][x] == 0 for y in range(10) for x in range(10)))
print(max(paper[y][x] for y in range(10) for x in range(10)))
from scipy.special import comb

n, k = map(int, input().split())

for i in range(k):
    print(int(comb(n - k + 1, i + 1) * comb(k - 1, i) % MOD))

### FIXED CODE ###

def factorial_mod(n, mod):
    a = 1
    for i in range(1, n + 1):
        a *= i
        a %= mod
    return a


def cmb(n, k, mod):
    if k > n or k < 0:
        return 0
    fact_n = factorial_mod(n, mod)
    fact_k = factorial_mod(k, mod)
    fact_n_k = factorial_mod(n - k, mod)
    return (fact_n * pow(fact_k, mod - 2, mod) * pow(fact_n_k, mod - 2, mod)) % mod


n, k = map(int, input().split())
MOD = 10**9 + 7

for i in range(k):
    print(int(cmb(n - k + 1, i + 1, MOD) * cmb(k - 1, i, MOD) % MOD))
n=int(input())
print(":".join(map(str,[n/3600,n%3600/60,n%60]))

### FIXED CODE ###

S=int(input())
print(S//3600,(S%3600)//60,S%60,sep=":")
H,W=map(int,input().split())
G=[list(input()) for i in range(H)]
G_t=[list(x) for x in list(zip(*G))]
Paired_y=[False]*H
def Check(G,H,W):
  for y1 in range(H):
    if Paired_y[y1]:
      continue
    for y2 in range(H):
      if y1==y2 or Paired_y[y2]:
        continue
      Paired_x=[False]*W
      for x1 in range(W):
        if Paired_x[x1]:
          continue
        for x2 in range(W):
          if x1==x2 or Paired_x[x2]:
            continue
          if G[y1][x1]==G[y2][x2] and G[y1][x2]==G[y2][x1]:
            Paired_x[x1]=True
            Paired_x[x2]=True
            break
      if W%2==1:
        if Paired_x.count(False)==1:
          Paired_y[y1]=True
          Paired_y[y2]=True
      else:
        if Paired_x.count(False)==0:
          Paired_y[y1]=True
          Paired_y[y2]=True
  if H%2==1:
    if Paired_y.count(False)==1:
      return True
    else:
      return False
  else:
    if Paired_y.count(False)==0:
      return True
    else:
      return False
  
if Check(G,H,W) and Check(G_t,W,H):
  print("YES")
else:
  print("NO")

      
      
        
                         
      
    


### FIXED CODE ###

H,W=map(int,input().split())
G=[list(input()) for i in range(H)]
G_t=[list(x) for x in list(zip(*G))]
def Check(G,H,W):
  Paired_y=[False]*H
  for y1 in range(H):
    if Paired_y[y1]:
      continue
    for y2 in range(H):
      if y1==y2 or Paired_y[y2]:
        continue
      Paired_x=[False]*W
      for x1 in range(W):
        if Paired_x[x1]:
          continue
        for x2 in range(W):
          if x1==x2 or Paired_x[x2]:
            continue
          if G[y1][x1]==G[y2][x2] and G[y1][x2]==G[y2][x1]:
            Paired_x[x1]=True
            Paired_x[x2]=True
            break
      if W%2==1:
        if Paired_x.count(False)==1:
          r=Paired_x.index(False)
          if G[y1][r]==G[y2][r]:
            Paired_y[y1]=True
            Paired_y[y2]=True
            break
      else:
        if Paired_x.count(False)==0:
          Paired_y[y1]=True
          Paired_y[y2]=True
          break
  if H%2==1:
    if Paired_y.count(False)==1:
      return True
    else:
      return False
  else:
    if Paired_y.count(False)==0:
      return True
    else:
      return False
  
if Check(G,H,W) and Check(G_t,W,H):
  print("YES")
else:
  print("NO")
isExist = [False]*2001 
n = int( input() )
A = [ int( val ) for val in input().split( ' ' ) ]

q = int( input() )
M = [ int( val ) for val in input().split( ' ' ) ]
for i in range( 0, q ):
	print( "yes" )

### FIXED CODE ###

def solve( p, t ):
	global isExist, n, A
	isExist[ t ] = True
	if p < n:
		solve( p+1, t-A[p] )
		solve( p+1, t )
	else:
		return

isExist = [False]*2001 
n = int( input() )
A = [ int( val ) for val in input().rstrip().split( ' ' ) ]
q = int( input() )
M = [ int( val ) for val in input().rstrip().split( ' ' ) ]
s = sum( A )
solve( 0, s )
for i in range( 0, q ):
	if isExist[ M[i] ]:
		print( "yes" )
	else:
		print( "no" )
H,W = map(int,input().split())
C = [0]*10
for i in range(10):
    C[i] = list(map(int,input().split()))
A = [0]*10
for i in range(H):
    A[i] = list(map(int,input().split()))
for k in range(10):
    for i in range(10):
        for j in range(10):
            C[i][j] = min(C[i][j],C[i][k]+C[k][j])
Ans = 0
for i in range(H):
    B = A[i]
    for b in B:
        if b > 1:
            Ans += C[b][1]
print(Ans)

### FIXED CODE ###

H,W = map(int,input().split())
c,A,s = [],[],0
for i in range(10):
    c.append(list(map(int,input().split())))
for i in range(H):
    A.append(list(map(int,input().split())))
for i in range(10):
    for j in range(10):
        for k in range(10):
            c[j][k] = min(c[j][k], c[j][i]+c[i][k])
for i in range(10):
    for j in range(H):
        s = s + A[j].count(i) * c[i][1]
print(s)
X=int(input())
for i in range(10**4,1):
    for t in range(-1000,1000):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)

### FIXED CODE ###

X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)
            exit()
l = map(int, input().split())
print("Yes" if l.sort() == [5, 5, 7] else "No")

### FIXED CODE ###

l = input().split()
print("YES" if sorted(l) == ['5', '5', '7'] else "NO")
a, b = raw_input()
if a < b:
  print(unsafe)
else:
  print(safe)

### FIXED CODE ###

s = input()
l = [int(item) for item in s.split()]
if l[0] <= l[1]:
  print('unsafe')
else:
  print('safe')
for i in range(3000):
    a, b = map(int, input().split())
    
    if a == 0 and b == 0
        break
    elif a < b:
        print(a, b)
    else
        print(b, a)
    
    
    


### FIXED CODE ###

for i in range(3000):
    a, b = map(int, input().split())
    
    if a == b == 0:
        break
    elif a < b:
        print(a, b)
    else:
        print(b, a)
from collections import Counter

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

ans = [0]*n
d = Counter(a)
k = list(d.keys())[::-1]
for i in range(len(k)-1):
    ind = a.index(k[i])
    ans[ind] += d[k[i]]*(k[i]-k[i+1])
    d[k[i+1]] += d[k[i]]
ans[k[-1]-1] += n
for i in ans:
    print(i)

### FIXED CODE ###

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

b = sorted([(i+1, a[i]) for i in range(n)], key=lambda x: -x[1])
ans = [0]*(n+1)
m = float('inf')
for i in range(n-1):
    m = min(m, b[i][0])
    if b[i][1] == b[i+1][1]:
        continue
    ans[m] += (i+1)*(b[i][1]-b[i+1][1])
ans[1] += sum(a) - sum(ans)
for i in range(1, n+1):
    print(ans[i])
N, T = map(int, input().split())
nums = list(map(int, input().split()))
INF = 10**10
min_num = INF
max_diff = 0
cnt = 0
for num in nums:
  if num-min_num > max_diff:
    cnt = 1
    max_diff = num-min_num
  elif num-min_num == max_diff:
    cnt += 1
  if num < min_num:
    min_num = num
print(min(cnt, T//2))

### FIXED CODE ###

a, b, c = map(int, input().split())
if a+b == c or c+a == b or b+c == a:
  print('Yes')
else:
  print('No')
print(2*N if N%2==0 else N)

### FIXED CODE ###

N = int(input())

if N%2 == 0:
    print(N)
else:
    print(2*N)
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def fact(self, n):
        '''
        n!の値を返す
        '''
        return self.f[n]

    def comb(self, n, r):
        '''
        nCrの値を返す
        '''
        ret = self.f[n] * self.inv[n-r]*self.inv[r]
        ret %= self.mod
        return ret

    def perm(self, a, b):
        ret = self.f[a]*self.inv[a-b]
        ret %= self.mod
        return ret


MOD = 10**9+7
N, K = map(int, input().split())
edges = [list(map(lambda x:int(x)-1, input().split())) for _ in range(N-1)]
adj = [[] for _ in range(N)]

F = FactMod(N, MOD)

for a, b in edges:
    adj[a].append(b)
    adj[b].append(a)

# current parent
Q = []
for a in adj[0]:
    Q.append((a, 0))
ans = F.perm(K, len(adj[0])+1)
ans %= MOD

while Q:
    current, prev = Q.pop()
    child = len(adj[current])-1
    ret = F.perm(K-2, child)
    ans *= ret

    ans %= MOD
    for a in adj[current]:
        if a == prev:
            continue
        else:
            Q.append((a, current))
print(ans)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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


class FactMod():
    '''
    modの値が素数の時のfactと組み合わせを求める
    フェルマーの小定理を用いているため、modが素数以外の時は使えない
    '''

    def __init__(self, n, mod):
        '''
        コンストラクタ
        f:nまでの i!の値を　配列に入れる
        inv: (i!)^-1　の値を配列に入れる
        '''
        self.mod = mod
        self.f = [1]*(n+1)
        for i in range(1, n+1):
            self.f[i] = self.f[i-1]*i % mod

        self.inv = [pow(self.f[-1], mod-2, mod)]
        for i in range(1, n+1)[::-1]:
            self.inv.append(self.inv[-1]*i % mod)
        self.inv.reverse()

    def perm(self, a, b):
        if a < b or a < 0 or b < 0:
            return 0
        ret = self.f[a]*self.inv[a-b]
        ret %= self.mod
        return ret


MOD = 10**9+7
N, K = map(int, input().split())
edges = [list(map(lambda x:int(x)-1, input().split())) for _ in range(N-1)]
adj = [[] for _ in range(N)]

F = FactMod(K+1, MOD)

for a, b in edges:
    adj[a].append(b)
    adj[b].append(a)

# current parent
Q = []
for a in adj[0]:
    Q.append((a, 0))
ans = F.perm(K, len(adj[0])+1)
ans %= MOD

while Q:
    current, prev = Q.pop()
    child = len(adj[current])-1
    ret = F.perm(K-2, child)
    ans *= ret
    ans %= MOD
    for a in adj[current]:
        if a == prev:
            continue
        else:
            Q.append((a, current))
print(ans)
n=input()
m=len(n)
n=int(n)

if n%2==1:
    print(0)
else:
    if m==1:
        print(0)
    else:
        ans=0
        i=1
        while True:
            ans_plus=n//(2*5**i)
            if ans_plus==0:
                break
            ans+=ans_plus

            i+=1
    print(ans)

### FIXED CODE ###

n=input()
m=len(n)
n=int(n)

if n%2==1:
    print(0)
else:
    if m==1:
        print(0)
    else:
        ans=0
        i=1
        while True:
            ans_plus=n//(2*5**i)
            if ans_plus==0:
                break
            ans+=ans_plus

            i+=1
        print(ans)
for i in range(N):
    print(i)
    if x >= sort_a[i]:
        count += 1
        x -= sort_a[i]
        # print(x)
        continue
    break
print(count)

### FIXED CODE ###

N,x = map(int,input().split())
a = list(map(int,input().split()))
count = 0
#昇順に並べ替える
# sort_a = sorted(a)
a.sort(reverse=False)
for i in range(N):
    if x >= a[i]:
        count += 1
        x -= a[i]
    else:
        break

if (x!=0)and(count == N):
    count -= 1
print(count)
import scipy

n, k = list(map(int, input().split()))
dekai = 10**9+7

def mycomb(a, b) :
    return int(scipy.special.comb(a, b))%dekai

def usless(tukau, i) :
    if tukau-i+1 < 0 :
        return 0
    else :
        return mycomb(k-1, i-1)*mycomb(tukau-1,i-2)

def sousa(i) :
    if i == 1 :
        return n-k+1
    else :
        wa = 0
        for utan in range(n-k+1) :
            for satan in range(n-k+1-utan) :
                tukau = n-k-utan-satan
                wa += usless(tukau, i)
        return wa%dekai

for ii in range(k) :
    print(sousa(ii+1))

### FIXED CODE ###

n, k = map(int, input().split())


def comb(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7
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 )


for i in range(k) :
    ans = comb(n-k+1, i+1)*comb(k-1, i)%mod
    print(ans)
A, B, C, D, E, F= (int(i) for i in input().split())

dens=0
for a in range(30+1):
  for b in range(30+1):
    waterA=100*a*A
    waterAB=waterA+100*b*B
    if  waterA<= F and 0 < waterAB <= F:
      for c in range(100+1):
        for d in range(100+1):
          if waterAB+c*C+d*D <= F and c*C+d*D <= (a*A+b*B)*E:
            if dens < (c*C+d*D)/(waterAB+c*C+d*D):
              dens=(c*C+d*D)/(waterAB+c*C+d*D)
              max1=waterAB+c*C+d*D
              max2=c*C+d*D
              
print(max1,max2)

### FIXED CODE ###

a, b, c, d, e, f= (int(i) for i in input().split()) 

waterlist=[]
for i in range(0,f+100*a,100*a):
  for j in range(0,f+100*b,100*b):
    if i+j <=f:
      waterlist+=[i+j]
waterlist=list(set(waterlist))
#print(x)

sugarlist=[]
for i in range(int(f/c)+1):
  for j in range(int(f/d)+1):
    if c*i+d*j <=f:
      sugarlist+=[c*i+d*j]
sugarlist=list(set(sugarlist))
#print(y)

density=0

for i in range(len(waterlist)):
  for j in range(len(sugarlist)):
    if 0 < waterlist[i]+sugarlist[j] <= f and sugarlist[j]<=waterlist[i]/100*e:
      tmp=sugarlist[j]/(waterlist[i]+sugarlist[j])
      if density <= tmp:
        density = tmp
        ans1=waterlist[i]+sugarlist[j]
        ans2=sugarlist[j]
        
print(ans1,ans2)
a,b=map(int and float ,input().split())
b=100*b
c=a*b
print(int(c/100))

### FIXED CODE ###

N=int(input())
A = list(map(int,input().split()))
A.sort()
x=1
y=True
for i in A:
    x= x*i
    if x > 10**18:
        print('-1')
        y=False
        break
if y:
    print(x)
yandy
N = input()
a = list(map(int, input().split()))

a.sort(reverse=True)

Alice = a[0::2]
Bob = a[1::2]

print(sum(Alice) - sum(Bob))


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
#print(a)
b=[]
c=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  else:
    c.append(a[i])
print(sum(b)-sum(c))
l = map(int, raw_input().split())
l1 = [int(i) for i in l]
sum = (l1[0] + l1[1])
import math
print(int(math.log10(sum) + 1))

### FIXED CODE ###

while True:
    try:
        a,b = map(int, input().split())
        print(len(str(a+b)))
    except EOFError:
        break
S, T, U = map(input().split())
A, B = map(int,input().split)

if S == U:
    print(S-1 " " T)
else:
    print(S " " T-1)


### FIXED CODE ###

S, T = input().split()
A, B = map(int,input().split())
U = input()
 
if S == U:
    print(A-1 , B)
else:
    print(A , B-1)
A, B, K = map(int, input().split())
try:
    small = list(range(A, B + 1))[:K]
    big = list(range(A, B + 1))[-K:]
    nums = small + big
except:
    nums = list(range(A, B + 1))
for num in sorted(list(set(nums))):
    print(num)


### FIXED CODE ###

A, B, K = map(int, input().split())
num_range = range(A, B + 1)
for i in sorted(set(num_range[:K]) | set(num_range[-K:])):
    print(i)
# coding: utf-8
# hello worldと表示する
import sys
import numpy
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

a,b,c,d,e,f=MI()
wasser=[]
g=f//100
for i in range(int(f/a)+1):
    for j in range(int(f/a)+1):
        if a*i+b*j<=f//100:
            wasser.append(100*(a*i+b*j))
water=list(set(wasser))
water.sort()
#print(water)
sugar=[]
for x in water:
    sugar.append((min(f-x,e*x//100)))
#print(sugar)
sugmx=[]
for s in sugar:
    mx=0
    for i in range(s//c+1):
        for j in range(s//c+1):
            if mx<=c*i+d*j<=s:
                mx=c*i+d*j
    sugmx.append(mx)
#print(sugmx)
mx=0
for i in range(1,len(water)):
    u=sugmx[i]/water[i]
    #print(u)
    if u>mx:
        mx=u
        ans1=sugmx[i]
        ans2=water[i]
print(ans2+ans1,ans1) 

### FIXED CODE ###

# coding: utf-8
# hello worldと表示する
import sys
import numpy
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
from copy import deepcopy
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

a,b,c,d,e,f=MI()
wasser=[]
g=f//100
for i in range(int(f/a)+1):
    for j in range(int(f/a)+1):
        if a*i+b*j<=f//100:
            wasser.append(100*(a*i+b*j))
water=list(set(wasser))
water.sort()
#print(water)
sugar=[]
for x in water:
    sugar.append((min(f-x,e*x//100)))
#print(sugar)
sugmx=[]
for s in sugar:
    mx=0
    for i in range(s//c+1):
        for j in range(s//c+1):
            if mx<=c*i+d*j<=s:
                mx=c*i+d*j
    sugmx.append(mx)
#print(sugmx)
mix=-inf
for i in range(1,len(water)):
    u=sugmx[i]/water[i]
    #print(u)
    if u>=mix:
        mix=u
        ans1=sugmx[i]
        ans2=water[i]
print(ans2+ans1,ans1)
a,b,k=map(int, input().split())
for i in range(min(a,b)):
  if a%i==0 and b%i==0:
    k=k-1
  if k==0:
    print(i)
    break

### FIXED CODE ###

a,b,k=map(int, input().split())
for i in reversed(range(1,min(a,b)+1)):
  if a%i==0 and b%i==0 :
    k=k-1
  if k==0:
    print(i)
    break
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in len(S):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')


### FIXED CODE ###

S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')
import sys
from bisect import *
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
P = [[] for _ in range(N)]
Q = [[] for _ in range(N)]
for i in range(N):
    for j in range(N):
        for k in range(N):
            P[i].append((A[i]+A[j]+A[k],j+1,k+1))
B = [-float("inf")]
print(2*N)
for i in range(N):
    P[i].sort(key=lambda x:x[0])
    tmp = [p for p, _, _ in P[i]]
    k = bisect_left(tmp,B[-1])
    B.append(P[i][k][0])
    b,c = P[i][k][1], P[i][k][2]
    print(b,i+1)
    print(c,i+1)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
mi, ma = min(A), max(A)
print(2*N)
if abs(mi)<=ma:
    k = A.index(ma)
    print(k+1,1)
    print(k+1,1)
    for i in range(N-1):
        print(i+1,i+2)
        print(i+1,i+2)
else:
    k = A.index(mi)
    print(k+1,N)
    print(k+1,N)
    for i in reversed(range(N-1)):
        print(i+2,i+1)
        print(i+2,i+1)
list = sorted(map(int,raw_input().split()))
strlist = map(str,list)
print strlist[0] + ' ' + strlist[1] + ' ' + strlist[2]


### FIXED CODE ###

a, b, c= map(int, input().split())
if a<=b<=c:print(a, b, c)
if b<a<=c:print(b, a, c)
if a<=c<b:print(a, c, b)
if b<c<a:print(b, c, a)
if c<a<b:print(c, a, b)
if c<=b<=a:print(c, b, a)
s = input().split()
N = int(s[0])
M = int(s[1])

AB = {}
for i in range(N):
  data = input().split()
  AB[int(data[0])] = int(data[1])

money = 0
num = 0
for A,B in sorted(AB.items()):
  if num+B < M:
    money += A*B
  	num += B
  else:
    money += A*(M-num)
    break
  
print(money)

### FIXED CODE ###

s = input().split()
N = int(s[0])
M = int(s[1])
 
AB = {}
for i in range(N):
  data = input().split()
  if int(data[0]) in AB.keys():
    AB[int(data[0])] += int(data[1])
  else:
    AB[int(data[0])] = int(data[1])
AB = sorted(AB.items())
money = 0
num = 0
for A,B in AB:
  for b in range(B):
    num += 1
    money += A
    if num == M:
      break
      
  if num == M:
    break
  
print(int(money))
n,m,*ab = map(int, open(0).read().split())
to = [[] for _ in range(m+1)]

for i in range(0, m*2, 2):
    a = ab[i]
    b = ab[i+1]
    to[a].append(b)
    to[b].append(a)

checked = set()
ans = [None for _ in range(n+1)]
def fill(k):
    if k in checked:
        return
    checked.add(k)
    for i in to[k]:
        if ans[i] is None:
            ans[i] = k
    for i in to[k]:
        fill(i)
fill(1)

print("Yes")
print("\n".join(map(str, ans[2:])))

### FIXED CODE ###

from collections import deque
n,m,*ab = map(int, open(0).read().split())

to = [[] for _ in range(n+1)]
ans = [None] * (n+1)
for i in range(0, m*2, 2):
    a = ab[i]
    b = ab[i+1]
    to[a].append(b)
    to[b].append(a)

q = deque([1])
while q:
    p = q.pop()
    children = to[p]
    for child in children:
        if ans[child] is None:
            ans[child] = p
            q.appendleft(child)

print("Yes")
print("\n".join(map(str, ans[2:])))