Problem:


Score : 100 points

Problem Statement

In AtCoder City, there are three stations numbered 1, 2, and 3.

Each of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.

To improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.

Determine if there is a pair of stations that will be connected by a bus service.

Constraints

Each character of S is A or B.

|S| = 3

Input

Input is given from Standard Input in the following format:

S

Output

If there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.

Sample Input 1

ABA

Sample Output 1

Yes

Company A operates Station 1 and 3, while Company B operates Station 2.

There will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.

Sample Input 2

BBA

Sample Output 2

Yes

Company B operates Station 1 and 2, while Company A operates Station 3.

There will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.

Sample Input 3

BBB

Sample Output 3

No

Company B operates all the stations. Thus, there will be no bus service, so print No.



Sample input:
ABA


Sample output:
Yes

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Challenge A
"""

def bus(stations):
    a = np.array(("","",""))
    for i in range(3):
        a[i] = stations[i]
    s = np.unique(a)
    if len(s)==1:
        return "No"
    elif len(s) > 1:
        return "Yes"
    else:
        return "Problem"
        
"""
my_strings = np.array(("AAA","AAB","ABA","BAA","ABB","BBA","BBB"))
for i in my_strings:
    print(i)
    print(bus(i))
"""
    
i = input()
#print(i)
print(bus(i))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Challenge A
"""

def bus(stations):
    a = np.array(("","",""))
    for i in range(3):
        a[i] = stations[i]
    s = np.unique(a)
    if len(s)==1:
        return "No"
    elif len(s) > 1:
        return "Yes"
    else:
        return "Problem"
        
"""
my_strings = np.array(("AAA","AAB","ABA","BAA","ABB","BBA","BBB"))
for i in my_strings:
    print(i)
    print(bus(i))
"""
    
i = input("give station: ")
print(i)
print(bus(i))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
Challenge A
"""

def bus(stations):
    a = np.array(("","",""))
    for i in range(3):
        a[i] = stations[i]
    s = np.unique(a)
    if len(s)==1:
        return "No"
    elif len(s) > 1:
        return "Yes"
    else:
        return "Problem"
        
my_strings = np.array(("AAA","AAB","ABA","BAA","ABB","BBA","BBB"))
for i in my_strings:
    print(i)
    print(bus(i))

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem,A)
print(ans)

Submission status: Runtime Error

Solution code:
# 初期入力
N,A,B = (int(x) for x in input().split(" "))

# 赤と青を並べる
retu = ""
for j in range(10100):
    for i in range(A):
        retu += "b"
    for i in range(B):
        retu += "r"

b_num = retu[:N].count("b")
print(b_num)

Submission status: Runtime Error

Solution code:
in = input()
str = list(in)

ca = str.count("A")
cb = str.count("B")

if ca == 3 or cb == 3:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

import sys

def prob_a(args):
    s = args[1]
    chars = list(s)
    tmpc = chars[0]
    for c in chars[1:]:
        if c == tmpc:
            continue
        else:
            print('Yes')
            return 0
    print('No')

if __name__ == '__main__':
    args = sys.argv
    prob_a(args)

Submission status: Runtime Error

Solution code:
in = input()
str = list(in)

bef = str[0]
for i in range(3):
  if bef != str[i]:
    print("Yes")
    exit()
print("No")

Submission status: Runtime Error

Solution code:
a = input()
if a == "AAA" or b == "BBB":
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
print('Yes' if all(input().count(c) > 0 for c in 'AB') else 'No')

Submission status: Runtime Error

Solution code:
n,a,b=map(int,input().split())

tmp1,tmp2=divmod(n,a+b)

blue=tmp1*a
if(tmp2>a):
  blue=blue+a
else:
  blue=blue+tmp2
  
print(blue)

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())

q = int(N / (A+B))
r = N%(A+B)
#print((q+1)*A if r>A else q*A+r)
print(q*A + min(A, r))

Submission status: Runtime Error

Solution code:
S = list(input())
if S[0]==S[1] and S[0]==S[3]:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
A = input()
if A[1] == A[2] or A[2] == A[3] or A[1] == A[3]:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
_, p = input().split()
s = input()
ss = []
for b in range(len(s)):
    for e in range(len(s)-b+1):
        ss.append(s[b:b+e])
filtered = [int(i) for i in ss if i != '']
print(len([i for i in filtered if i % int(p) == 0]))

Submission status: Runtime Error

Solution code:
from collections import deque

S = deque(input())
Q = int(input())
flg = True
for _ in range(Q):
    query = input()
    if query[0] == "1":
        flg = not flg
    else:
        _,F,C = query.split()
        if (F == "1" and flg) or (F == "2" and not flg):
            S.appendleft(C)
        else:
            S.append(C)
if not flg:
    S.reverse()

print(''.join(S))

Submission status: Runtime Error

Solution code:
s = input()
if s == "AAA" or s === "BBB":
    print("no")
else:
    print("yes")

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
P8, P10 = map(int, input().split())


import math
price1_min = math.ceil(P8/0.08)

price1_max = math.floor((P8+1)//0.08)

price2_min = math.ceil(P10/0.10)

price2_max = math.floor((P10+1)//0.10)



if (price1_max >= price2_min) and (price2_max >= price1_min):
    print(max(price2_min, price1_min))
else: 
    print(-1)

Submission status: Runtime Error

Solution code:
P8, P10 = map(int, input().split())

import math


price1_min = math.floor(P8/0.08)

price1_max = math.floor((P8+1)/0.08)-1

price2_min = math.floor(P10/0.10)

price2_max = math.floor((P10+1)/0.10)-1



if (price1_max >= price2_min) and (price2_max >= price1_min):
    print(max(price2_min, price1_min))
else: 
    print(-1)

Submission status: Runtime Error

Solution code:
data = input().split()
 
a = int(data[0])
b = int(data[1])
 
pricea = a // 0.08
priceb = b // 0.1
 
if pricea == priceb:
  ans = pricea
elif pricea + 1 == priceb:
  ans = priceb
elif pricea == priceb + 1:
  ans = pricea
else:
  ans = -1
  
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
if s == 'AAA' or S === 'BBB':
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
isReversed = False
s = input()
q = int(input())
for i in range(q):
  t = list(input().split())
  if t[0] =='1':
    isReversed = not bool(isReversed)
  else:
    if (t[1] =='1' and isReversed == False) or (t[1] =='2' and isReversed == True) :
      s = t[2] +s
    else:
      s = s + t[2]
                                              
      
if isReversed:
  s = s[::-1]
      
print(s)

Submission status: Runtime Error

Solution code:
a,b,c = (str(x) for x in input().split())
if a == b == c:
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
a,b,c = (str(x) for x in input().split())
if a == b == c:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
a,b,c = (str(x) for x in input().split())
if a == b == c:
    print(No)
else:
    print(Yes)

Submission status: Runtime Error

Solution code:
a,b,c = (str(x) for x in input().split())
if a == b == c
    print(No)
    else
        print(Yes)

Submission status: Runtime Error

Solution code:
a,b =map(int,input().split())

ans = b * 10
status = ''
for i in range(10):
  8*(ans + i)//100
  if(a == 8*(ans + i)//100):
    ans += i
    status = 'ok'
    break;

if status =='ok':
  print(ans)
  
else:
  print(-1)

Submission status: Runtime Error

Solution code:
n,a,b =map(int,input().split())
c = a+b

ans = n//c
l = n%c
if a>l:
  ans += l
else:
  ans += a
  
print(ans)

Submission status: Runtime Error

Solution code:
n,a,b =map(int,input().split())
c = a+b

sum1 = n//c
l = n%c
if a>l:
  sum2 = l
else:
  sum2 = a
  
print(sum1+sum2)

Submission status: Runtime Error

Solution code:
n,a,b =map(int,input().split())
c = a+b

sum1 = c/n
l = c%n
if a>l:
  sum2 = l
else:
  sum2 = a
  
print(sum1+sum2)

Submission status: Runtime Error

Solution code:
S = input()
if S = "AAA" or "BBB":
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
S2 = ""
Q = int(input())
reverse = 1
for i in range(Q):
    list = input()
    if list[0] == "1":
        reverse *= -1
    else:
        if reverse == 1:
            if list[2] == "2":
                S += list[4]
            else:
                S2 += list[4]
        else:
            if list[2] == "2":
                S2 += list[4]
            else:
                S += list[4]
if reverse == 1:
    print(S2[::-1] + S)
else:
    print(S[::-1] + S2)

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
reverse = 1
for i in range(Q):
    list = input()
    if list[0] == "1":
        reverse *= -1
    else:
        list = list.split()
        if reverse == 1:
            if list[1] == "2":
                S = S + list[2]
            else:
                S = list[2] + S
        else:
            if list[1] == "2":
                S = list[2] + S
            else:
                S = S + list[2]
if reverse == 1:
    print(S)
else:
    print(reversed(S))

Submission status: Runtime Error

Solution code:
a = input()
b = a[0]
c = False
for i in range(len(a)):
    if a[i] != b:
        c = True
        print("Yes")
        return
print("No")

Submission status: Runtime Error

Solution code:
a=list(input())

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

Times = N // (A + B)
rest = N - Times * (A + B)

if rest < A:
        ans = A * Times + rest
else:
        ans = A * Times + A

print(ans)

Submission status: Runtime Error

Solution code:
a,b,c=input()
if a==b and b==C:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

Solution code:
s1,s2,s3 = input()
if(s1==s2 and s2==s3):
  print('NO')
elif:
  print('YES')

Submission status: Runtime Error

Solution code:
a=list(input())

IN=[int(x) for x in a if x != " "]
N=IN[0]
A=IN[1]
B=IN[2]

ALL=A+B

cnt=0
num=N
while True:
        num = num - ALL
        if num > 0:
                cnt += 1
        else:
                break

if ALL - num > A:
        ans = A * cnt + A
else:
        ans = A * cnt + ALL - num

print(ans)

Submission status: Runtime Error

Solution code:
def f():
	S = input()
    for idx, s in enumerate(S):
      if s == 'A':
        a = 1
      if s == 'B':
        b = 1
      if a == 1 and b == 1:
        break
    return 'Yes' if a == 1 and b == 1 else 'No'
    
      
  
print(f())

Submission status: Runtime Error

Solution code:
from decimal import *
import math

i = list(map(int, input().split()))
A = Decimal(i[0])
B = Decimal(i[1])

A_min = A // Decimal("0.08")
A_max = math.ceil(Decimal(A + 1) / Decimal("0.08"))
B_min = B // Decimal("0.1")
B_max = math.ceil(Decimal(B+1) / Decimal(0.1))

if A_max < B_min:
    print(-1)
elif A_min > B_max:
    print(-1)
elif A_min < B_min:
    print(B_min)
else:
    print(A_min)

Submission status: Runtime Error

Solution code:
import sys

args=sys.argv
S=args[1]
if S[0] == S[1]:
        if S[1] == S[2]:
                print("No")
        else:
                print("Yes")
else:
        print("Yes")

Submission status: Runtime Error

Solution code:
#!~/anaconda3/bin/python

import sys

args=sys.argv
S=args[1]
if S[0] == S[1]:
        if S[1] == S[2]:
                print("No")
        else:
                print("Yes")
else:
        print("Yes")

Submission status: Runtime Error

Solution code:
i = list(map(int, input().split()))

N = int(i[0])
A = int(i[1])
B = int(i[2])

count_blue = 0

syou = N // (A + B)
amari = N % (A + B)

if amari > A:
    count_blue = A * syou + A
else:
    count_blue = A * syou + amari
   
print(count_blue)

Submission status: Runtime Error

Solution code:
i = list(map(int, input().split()))

N = int(i[0])
A = int(i[1])
B = int(i[2])

count_blue = 0

syou = N // (A + B)
amari = N % (A + B)

if amari > A:
    count_blue = A * syou + A
else:
    count_blue = A * syou + amari
    
count_blue

Submission status: Runtime Error

Solution code:
import numpy as np

info = np.array(input().split(" "), dtype="int64")
o = info[1] + info[2]
if o == 0:
    print(0)
else:
    q, mod = divmod(info[0], o)
    if mod > info[1]:
        print((q+1)* info[1])
    else:
        print(q*info[1] + mod)

Submission status: Runtime Error

Solution code:
import numpy as np
s = np.array(list(input()))
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
import numpy as np
s = np.array(input().split())
if s[0] == s[1] and s[1] == s[2]:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
c = sorted(list(map(int, input())))

if c[0]==A and c[2]==B:
  print('Yes')
else:
  print('No')

Submission status: Runtime Error

Solution code:
s = input()
if s == "AAA" or s == "BBB":
  return True
else:
  return False

Submission status: Runtime Error

Solution code:
S = input()

if (s=='AAA') or (S=='BBB'):
  print('No')
  exit()
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
print("No" if S.count(A) == 3 or S.count(B)  ==3 else "Yes")

Submission status: Runtime Error

Solution code:
s=input()
if s[0]=s[1] and s[1]==s[2]:
  print("Yes")
  
else :
  print("No")

Submission status: Runtime Error

Solution code:
s=input()

if s[0]!==s[1] or s[1]==s[2]:
  print("Yes")
  
else :
  print("No")

Submission status: Runtime Error

Solution code:
s=input()

for i in range(0,1):
    if s[i]!=s[i+1]:
        X=Yse
        break
    else :
        X=No

print(X)

Submission status: Runtime Error

Solution code:
s=input()

for i in range(0,1):
    if s[i]!=s[i+1]:
        X=Yes
        break
    else :
        X=No

print(X)

Submission status: Runtime Error

Solution code:
s=input()

for i in range(0,2):
    if s[i]!=s[i+1]:
        X=Yes
        break
    else :
        X=No

print(X)

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
Q = N//(A + B)
if N - Q * (A + B) > A:
  print(Q * A + A)
else:
  print(Q * A + N - Q * (A + B))

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('NO")
else:
        print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
a=S[0]
flag=0
for i in range(3):
  if (S[0]!=S[i]):
    fgag=1
if (flag=0):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
a=S[0]
flag=0
for i in range(3):
  if (S[0]!=S[i]):
    fgag=1:
if (flag=0):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
a=S[0]
flag=0
for i in range(3):
  if(S[0]!=S[i]):
    fgag=1:
if(flag=0):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S=input()
a=S[0]
flag=1
for i in range(3):
  if!(S[0]==S[i]):
    fgag=0:
if(flag=0):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
if s == 'AAA' or s == 'BBB'
  print('No')

else print('Yes')

Submission status: Runtime Error

Solution code:
s = input()
if s == 'AAA' or s = 'BBB'
  print('No')

else print('Yes')

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split())
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

Submission status: Runtime Error

Solution code:
s=map(str,input().split())
if A not in s or B not in s:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
2 if S[0] == S[1] and S[1] == S[2]:
3 print('No')
4 else:
5 print('Yes')

Submission status: Runtime Error

Solution code:
# p = input()
n,a,b = map(int,raw_input().split())
if a ==0 and b==0 :
    print 0
elif a+b>=n:
    print a
else:
    print n%(a+b)+a * (n/(a+b))

Submission status: Runtime Error

Solution code:
from collections import deque
S = deque(list(input().strip()))
Q = int(input().strip())
flag = 1
for i in range(Q):
  line = input().strip()
  if len(line) == 1:
    flag = 1 - flag
  else:
    _, F, C = line.strip().split()
    if flag:
      if int(F) == 1:
        S.appendleft(C)
      else:
        S.append(C)
    else:
      if int(F) == 1:
        S.append(C)
      else:
        S.appendleft(C)

if flag:
  print(''.join(S))
else:
  print(''.join(S[::-1]))

Submission status: Runtime Error

Solution code:
fun main()
{
    val given = readLine()!!
    println(if ( given.contains("AB") || given.contains("BA")) "Yes" else "No")
}

Submission status: Runtime Error

Solution code:
import sys
N, A, B = map(int, input().split())

if N <=A:
    print(N)
    sys.exit()
if N <= (A+B):
    print(A)
    sys.exit()

count = 0

most = N//(A+B)
amari = (N - (A+B)*most)

if amari <= A:
    print((most*A) + amari)
else:
    print((most*A) + A)

Submission status: Runtime Error

Solution code:
if input()=="AAA" or input()=="BBB":
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
s=input()

for i in range(3):
  if s[i]==s[i+1]:
    print("Yes")
  else :
    print("No")

Submission status: Runtime Error

Solution code:
a=input()
p1=a[0]
p2=a[1]
p3=a[3]
 
if p1==p2==p3:
 print("No")
else:
 print("Yes")

Submission status: Runtime Error

Solution code:
a=input()
p1=a[0]
p2=a[1]
p3=a[3]
 
if p1==p2==p3:
	print("No")
else:
	print("Yes")

Submission status: Runtime Error

Solution code:
a=input()
p1=a[0]
p2=a[1]
p3=a[3]

if p1==p2==p3:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
import sys

s = input()

if s = 'AAA' or s = 'BBB':
  print('No')
  sys.exit()
 
print('Yes')

Submission status: Runtime Error

Solution code:
data=set([input() for i in range(3)])
if len(data)==1:
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
n,a,b = map(int, input().split())
m = 0
ans = 0
c = 0

while m < n:
    if c == 0:
        if m + a <= n:
            ans = ans + a
        else:
            ans = ans + n - m
        c = 1
        m = m + a
    else:
        c = 0
        m = m + b
    
print(ans)

Submission status: Runtime Error

Solution code:
import math
a, b = map(int, input().split())
for n in range(10000):
    x = math.floor(n * 0.08)
    y = math.floor(n * 0.1)
    if a == x and b == y:
        print(n)
        exit()
print(-1)

Submission status: Runtime Error

Solution code:
s = gets.rstrip
a = s.split("")
u = a.uniq

if u.length > 1 then
    puts "Yes"
else
    puts "No"
end

Submission status: Runtime Error

Solution code:
s = gets
a = s.split("")
u = a.uniq

if u.length > 1 then
    puts "Yes"
else
    puts "No"
end

Submission status: Runtime Error

Solution code:
s = input()
if s[0] == s[1] or s[1] == s[2]: print('No')
  else: print('Yes')

Submission status: Runtime Error

Solution code:
s = imput ()
if s [0] == s[1] or s[1] == s[2]:print('No')
else: print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
  else:
    print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == S[1] and S[1] == S[2]:
  print('No')
 else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
if S[0] == S[1] and S[1] == S[2]:
 print('No')
else
 print('Yes')

Submission status: Runtime Error

Solution code:
a = input()
	if a == 'AAA':
    	print('NO')
    elif a == 'BBB':
    	print('NO')
    else:
    	print('YES')

Submission status: Runtime Error

Solution code:
S = input()
if (S == AAA) or (S == BBB):
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
if S = AAA or S = BBB:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
S = input()
if S = 'AAA' or S = 'BBB':
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
s = list(input().split())

if s[0] == s[1] and s[1] == s[2]:
  print('No')
else:
  print('Yes')

Submission status: Runtime Error

Solution code:
n = list(map(input().split()))
if len(set(n)) == 1:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
n = list(map(input().split()))
if len(set(n)) == 2:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
n = list(map(input().split()))
if len(set(n)) == 3:
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
s = input()
q = int(input())
for _ in range(q):
    split = input().split()
    if split[0] == '1':
        s = s[::-1]
    else:
        if split[1] == '1':
            s = split[2] + s
        else:
            s = s + split[2]
print(s)

Submission status: Runtime Error

Solution code:
input = input().split()
N = int(input[0])
A  = int(input[1])
B  = int(input[2])
arr = []
for index in range(A):
  arr.append('a')
for index in range(B):
  arr.append('b')

for index in range(0,N):
  if arr[index] == 'b':
    print(index)
    break
  elif index + 1 == N:
    print(N)
    break

Submission status: Runtime Error

Solution code:
N, A, B = map(int, input().split()) 
ans = N // (A + B) * A
rem = N % (A + B)
ans += min(rem, A)
print(ans)

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())
c = 0
d = a+b
if a==0 and b==0:
    print(0)
elif a==0:
    print(0)
elif b==0:
    print(a)
else:   
    q, mod = divmod(n, d)      
    print(q*a + mod)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())


sum=0

if A==0:
    print(0)
else:
    a=N//(A+B)
    b=N%(A+B)

    # print(a)
    # print(b)
    if b>A:
        sum=A*a+A
        print(sum)
    else:
        sum=A*a+b
        print(sum)

Submission status: Runtime Error

Solution code:
S=str(input())
Q=int(input())
which=0
front=""
back=""
for i in range(Q):
    a=list(map(str,input().split()))
    if a==["1"]:
        which+=1
        which%=2
        continue
    else:
        if which==0:
            if a[1]=="1":
                front=a[2]+front
            if a[1]=="2":
                back+=a[2]
        if which==1:
            if a[1]=="1":
                back+=a[2]
            if a[1]=="2":
                front=a[2]+front
S=front+S+back
if which==1:
    print(S[::-1])
if which==0:
    print(S)

Submission status: Runtime Error

Solution code:
a=input()
if (a=="AAA" || a=="BBB"):
    print("No")
else:
    print("Yes")

Submission status: Runtime Error

Solution code:
S=(str(input())
if S.count('A')>=1:
    print('Yse')
else:
  print('No')

Submission status: Runtime Error

Solution code:
  args = input()
  print(args)
  if 'A' in args:
    if 'B' in args:
      print('Yes')
      exit()
  print('No')

Submission status: Runtime Error

Solution code:
args = input()
if 'A' not in args:
  print('No')
  return
if 'B' not in args:
  print('No')
  return
print('yes')

Submission status: Runtime Error

Solution code:
    s = input()
    if s[0] == s[1] and s[1] == s[2]:
        print("No")
    else:
        print("Yes")

Submission status: Runtime Error

Solution code:
def tax_increase(a,b):
    t8  = 0.08
    t10 = 0.1
    
    al = [a + (i / 10) for i in range(0,10,1)]
    bl = [b + (i / 10) for i in range(0,10,1)]

    atx8 = list(map(lambda x: int(x/t8) ,al))
    btx10 = list(map(lambda x: int(x/t10) ,bl))

    #print(atx8)
    #print(btx10)
    
    for i in atx8:
        if i in btx10:
            return i
        else:
            pass
    return -1

if __name__ == '__main__':
    a,b = map(int,input().split())
    ans = int(tax_increase(a,b))
    print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;


int main (){
    string s;
    cin >> s;
    int flag_A=0, flag_B=0;
    for ( int i=0; i<s.size(); i++){
        if ( s[i] == 'A'){
            flag_A = 1;
        }
        if (s[i] == 'B'){
            flag_B = 1;
        }
    }

    if ( flag_A and flag_B){
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }

    return 0;
}

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;

bool check(string s){
    int flag_A=0, flag_B=0;
    for ( int i=0; i<s.size(); i++){
        if ( s[i] == 'A'){
            flag_A = 1;
        }
        if (s[i] == 'B'){
            flag_B = 1;
        }
    }

    if ( flag_A and flag_B){
        return true;
    }
    else {
        return false;
    }
}

int main (){
    string s;
    cin >> s;
    if (check(s)){
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }

    return 0;
}

Submission status: Runtime Error

Solution code:
s = input()
if s = AAA and s = BBB :
    print('No')
else:
    print('Yes')

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

# スペース区切りの文字列の入力
st = input().split()

for i in range(1000):
  #切り捨て
  a = int(i * 0.08)
  b = int(i * 0.1)
  if(a == int(st[0]) and b == int(st[1])):
    print(i)
    break;
  elif(i == 999):
    print('-1')

Submission status: Runtime Error

Solution code:
n,a,b = map(int,input().split())
if a==0:
    print(0)
else :
    x = n/(a+b)
    y =n%(a+b)
    print(x*a+y)

Submission status: Runtime Error

Solution code:
S = input()
S_list = [S]
if S_list[1] == S_list[2] == S_list[3] :
  print("No")
else :
  print("Yes")

Submission status: Runtime Error

Solution code:
S = input()
S_list = [S]
if S_list[1] = S_list[2] = S_list[3] :
  print("No")
else :
  print("Yes")

Submission status: Runtime Error

Solution code:
n, a, b = map(int, input().split())

f = n // (a+b)
g = n % (a+b)

if g <= a:
    print(a * f + g)
    
else:
    print(a * (f+1))

Submission status: Runtime Error

Solution code:
N=int(input());R,d,f,s,x=sorted(list(map(int,input().split()))for i in range(N))+[(2e9,0)],[0]*N+[1],[0]*N,1,N
for i in range(N-1,-1,-1):
	while R[x][0]<sum(R[i]):x=f[x]
	d[i]=s=(s+d[x])%998244353;f[i],x=x,i
print(s)

Submission status: Runtime Error

Solution code:
str=imput()
if(str[0]!=atr[1]||str[1]!=str[2]):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
from collections import deque
S=deque(input())
q=int(input())
rev=False
for i in range(q):
  c=list(input().split())
  if c[0]=='1':
    rev=not rev
  elif c[1]=='1' and rev:
    S.appendleft(c[2])
  elif c[1]=='2' and not rev:
    S.appendleft(c[2])
  else:
    S.append(c[2])
if rev:
  S.reverse()
ans=''.join(S)
print(ans)

Submission status: Runtime Error

Solution code:
from collections import deque
S=deque(input())
q=int(input())
for i in range(q):
  c=list(input().split())
  if c[0]=='1':
    S.reverse()
  elif c[1]=='1':
    S.appendleft(c[2])
  elif c[1]=='2':
    S.append(c[2])
ans=''.join(S)
print(ans)

Submission status: Runtime Error

Solution code:
n,a,b = map(int,input().split())

if 0 <= n%(a+b) <= a:
    print(int(n/(a+b))*a+n%(a+b))
else:
    print(int(n/(a+b))*a+a)

Submission status: Runtime Error

Solution code:
from collections import deque
S=deque(input())
q=int(input())
for i in range(q):
  c=list(input().split())
  if c[0]=='1':
    S.reverse()
  elif c[0]=='2':
    if c[1]=='1':
      S.appendleft(c[2])
    elif c[1]=='2':
      S.append(c[2])
ans=''.join(S)
print(ans)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
i=(N//(A+B))*A
if N%(A+B)>A:
    i=i+A
else:
    i=i+(N%(A+B))
print(i)

Submission status: Runtime Error

Solution code:
N, A, B = [int(i) for i in input().split()]
i=(N//(A+B))*A
if N%(A+B)>A:
    i=i+A
else:
    i=i+(N%(A+B))
print(i)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
i=N//(A+B)*A
if N%(A+B)>A:
    i=i+A
else:
    i=i+(N%(A+B))
print(i)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
i=N//((A+B)*(10**100))*A
if N%((A+B)*(10**100))>A:
    i=i+A
else:
    i=i+(N%(A+B)*(10**100))
print(i)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
i=N//((A+B)*(10**100))*A
if N%((A+B)*(10**100))>A:
    i=i+A
else:
    i=i+(N%(A+B)*(10**100))
print(i)

Submission status: Runtime Error

Solution code:
s=set(list(input()))

if les(s)==1:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
flag = 1

if (S[0] == S[1]) & (S[1] == S[2]):
  	print("No")
else: 
	print("Yes")

Submission status: Runtime Error

Solution code:
S

Submission status: Runtime Error

Solution code:
if set(input()) == 2:
	print('yes')
else
	print('No')

Submission status: Runtime Error

Solution code:
N,A,B = map(int,input().split())
if A ==0 :
    print(0)
elif B==0:
    print(N)
else:
    m = N % (A+B)
    n = N // (A+B)
    ans = A * n
    if m > A:
        print(ans+A)
    else:
        print(ans+m)

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
for i in range(Q):
    q = input()
    if q == '1':
        S = S[::-1]
    else:
        F, C = q.split()[1:]
        if F == '1':
            S = C + S
        else:
            S = S + C
print(S)

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
head = True # True: left side is head
for i in range(Q):
  Query_i = list(map(str, input().split()))
  if Query_i[0]=='1':
    head = not head
  elif Query_i[1] == '1' and head:
    S = Query_i[2] + S
  elif Query_i[1] == '1' and not head:
    S = S + Query_i[2]
  elif Query_i[1] == '2' and head:
    S = S + Query_i[2]
  else Query_i[1] == '2' and not head:
    S = Query_i[2] + S
  if not head:
    S = S[::-1]
print(S)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
i=(N//((A+B)*(10**100)))*A
if N%((A+B)*(10**100))>A:
    i=i+A
else:
    i=i+(N%(A+B)*(10**100))
print(i)

Submission status: Runtime Error

Solution code:
S = input()
Q = int(input())
for i in range(Q):
  Query_i = list(map(str, input().split()))
  if Query_i[0]=='1':
    S = S[::-1]
  elif Query_i[1] == '1':
    S = Query_i[2] + S
  else:
    S = S + Query_i[2]
print(S)

Submission status: Runtime Error

Solution code:
N,A,B=map(int,input().split())
i=((A+B)*(10**100)//N)*A
if ((A+B)*(10**100))%N>A:
    i=i+A
else:
    i=i+((A+B)*(10**100)%N)
print(i)

Submission status: Runtime Error

Solution code:
ans=input()
n=int(input())
for i in range(n):
  t=input()
  if t=="1":
    ans=ans[::-1]
  else:
    if t[2]=="1":
      ans=t[4]+ans
    else:
      ans=ans+t[4]
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
#import math

# 整数の入力
station = input()

if(station[0] != station[1] || station[0] != station[2]):
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n=input()

if n="AAA" or n="BBB":
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
a = input()
Q = int(input())
Qy = [list(map(str,input().split())) for i in range(Q)]

for i in range(Q):
    if Qy[i][0] == "1":
        a = a[::-1]
    elif Qy[i][1] == "1":
        a = Qy[i][2] + a
    else :
        a += Qy[i][2]
print(a)

Submission status: Runtime Error

Solution code:
s = int(input())
if s in "AAA-BBB":
    print("No")
else:
    print("Yes")