Harryxun/stf_run huggingface dataset:
N = int(input())
S = input()
sint = [0]
si = 0
prev = S[0]

for s in S:
    if prev == s:
        sint[si] = sint[si] + 1
    else:
        prev = s
        si = si + 1
        sint.append(1)
if si % 2 == 0:
    if S[0] == '#':
        sint = [0] + sint
    else:
        sint.append(0)
    si = si + 1
elif S[0] == '#':
    sint = [0] + sint + [0]
    si = si + 2
#print(sint)

def count2(numSB,numSW):
    if len(sint) <= 2:
        return 0
    sint.pop(0)
    sint.pop()
    
    #この状態で偶数番号は黒、奇数番号は白(ゼロスタート)
    # numSB = 0
    # numSW = 0
    # for i,v in enumerate(sint):
        
    #     if i % 2 == 0:
    #         numSB = numSB + v
    #     else:
    #         numSW = numSW + v
    b = sint.pop(0)
    w = sint.pop()
    
    numSR =  b + w
    #print(numSB,numSW,numSR)
    if numSB <= numSW and numSB <= numSR:
        return numSB
    elif numSW <= numSB and numSW <= numSR:
        return numSW
    else:
        return numSR + count2(numSB-b,numSW-w)
    # if numSB <= numSW :
    #     return numSB
    # else:
    #     return numSW
    
    

def count(_S,_numSW,_numSB):
    _S = _S.lstrip('.').rstrip('#')
    if len(_S) == 0 :
        return 0
    numSW = _S.count('.')
    numSB = _S.count('#')
    SR = _S.lstrip('#').rstrip('.')
    numSR = len(_S) - len(SR)
    if numSW <= numSB and numSW <= numSR:
        return numSW
    elif numSB <= numSW and numSB <= numSR:
        return numSB
    else:
        return numSR + count(SR)


numSB = 0
numSW = 0
for i,v in enumerate(sint):
    if i % 2 == 1:
        numSB = numSB + v
    else:
        numSW = numSW + v
#print(sint,numSB,numSW)
print(min(numSB,numSW,count2(numSB,numSW)))
'''
22
#####.....####..###...
'''
# #intS = []
# def xor(A,B):
#     #print(A)
#     #print(B)
#     num = 0
#     for i in range(len(A)):
        
#         if A[i]!=B[i] :
#             num = num + 1
#     return num
# # for s in S :
# #     intS.append(0 if s=='.' else 1)
# minC = N

# mask = ['#' for j in range(len(S) + 1)]
# for i in range(len(S) + 1):
#     mask[i] = '.'
#     c = xor(mask[1::],S)
#     if c < minC:
#         minC = c

# print(minC)
# # def dl(_S):


# #     l = '.'
# #     r = '#'
    
# #     _S = _S.lstrip(l).rstrip(r)
# #     print(_S)
# #     if len(_S) == 0:
# #         return 0
# #     _S2W = _S.lstrip(r)
# #     _S2B = _S.rstrip(l)
# #     _S2 =  _S2W if len(_S2W) <= len(_S2B) else _S2B
# #     return len(_S) - len(_S2) + dl(_S2)
# # print(dl(S))






### FIXED CODE ###

_ = input()
S = input()
numc = S.count('.')
numcmin = numc
for s in S:
    if s == '#':
        numc = numc + 1
    else:
        numc = numc -1
        if numc < numcmin:
            numcmin = numc
print(numcmin)
class BIT:
    def __init__(self, n):
        #A1 ... AnのBIT(1-indexed)
        self.BIT = [0] * (n + 1)
        self.n = n

    #A1 ~ Aiまでの和 O(logN)
    def query(self, idx):
        res_sum = 0
        while idx > 0:
            res_sum += self.BIT[idx]
            idx -= idx & (-idx)
        return res_sum

    #Ai += x O(logN)
    def add(self, idx, x):
        while idx <= self.n:
            self.BIT[idx] += x
            idx += idx&(-idx)
        return
def get_int(f):
    if "." not in f:
        return int(f),0
    return int(f.replace(".","")),len(f)-f.index(".")-1
n = int(input())
p = []
for i in range(n):
    a, b = get_int(input())
    c, d = 0, 0
    while a % 2 == 0:
        c += 1
        a //= 2
    while a % 5 == 0:
        d += 1
        a //= 5
    c -= b
    d -= b
    p.append(c * 300000 + d)
p.sort()
for i in range(n):
    p[i] = (p[i] // 300000, p[i] % 300000)
now = n - 1
t = BIT(50)
ans = 0
for i in range(n):
    for j in range(now, i, -1):
        if p[i][0] + p[j][0] >= 0:
            t.add(-p[j][1] + 25, 1)
            now -= 1
        else:
            break
    if now < i:
        t.add(-p[i][1] + 25, -1)
    ans += max(0, t.query(25 + p[i][1]))

print(ans)

### FIXED CODE ###

class BIT:
    def __init__(self, n):
        #A1 ... AnのBIT(1-indexed)
        self.BIT = [0] * (n + 1)
        self.n = n

    #A1 ~ Aiまでの和 O(logN)
    def query(self, idx):
        res_sum = 0
        while idx > 0:
            res_sum += self.BIT[idx]
            idx -= idx & (-idx)
        return res_sum

    #Ai += x O(logN)
    def add(self, idx, x):
        while idx <= self.n:
            self.BIT[idx] += x
            idx += idx&(-idx)
        return
def get_int(f):
    if "." not in f:
        return int(f),0
    return int(f.replace(".","")),len(f)-f.index(".")-1
n = int(input())
p = []
for i in range(n):
    a, b = get_int(input())
    c, d = 0, 0
    while a % 2 == 0:
        c += 1
        a //= 2
    while a % 5 == 0:
        d += 1
        a //= 5
    c -= b
    d -= b
    p.append((c, d))
p.sort()
now = n - 1
t = BIT(200)
ans = 0
for i in range(n):
    for j in range(now, i, -1):
        if p[i][0] + p[j][0] >= 0:
            t.add(-p[j][1] + 100, 1)
            now -= 1
        else:
            break
    if now < i:
        t.add(-p[i][1] + 100, -1)
    ans += max(0, t.query(100 + p[i][1]))

print(ans)
fib=[0,0,1,2]
for i in range(4,100005):
  fib.append(fib[i-1]+fib[i-2])

n,m=map(int,input().split())
a=[input() for i in range(m)]

a.insert(0,0)
a.append(n)
ans=1
for i in range(m+1):
  ans*=fib[a[i+1]-a[i]]
print(ans)

### FIXED CODE ###

fib=[0,0,1,2]
for i in range(4,100005):
  fib.append(fib[i-1]+fib[i-2])

n,m=map(int,input().split())
a=[int(input()) for i in range(m)]

a=set(a)

p,q=0,1

for i in range(1,n+1):
  p,q=q,(p+q)%(10**9+7)*(not i in a)

print(q)
S = input()
T = input()

if T in S:
    ans = 0
else:
    for i in range(1, len(T)):
#         print(T[i:])
#         print(T[:-i])
#         print('--------------')
        if T[i:] in S or T[:-i] in S:
            ans = i
            break
print(ans)

### FIXED CODE ###

S = input()
T = input()

iteration = len(S) - len(T) + 1

if T in S:
    ans = 0
else:
    minimum = len(T)
    for i in range(iteration):
#         print('---------------')
        s = S[i:len(T)+i]
#         print(s)
#         print(T)
        count = 0
        for j in range(len(T)):
            if s[j] != T[j]:
                count += 1
#             print(count)
        minimum = min(minimum, count)
    ans = minimum
    
print(ans)
S = S.split()
if S[2]==S[3]:
  if S[4]==S[5]:
    return "Yes"
  else: return "No"
else: return "No"

### FIXED CODE ###

S = input()
#S = S.split()
if ((S[2]==S[3])&(S[4]==S[5])):
	print("Yes")
else: 
	print("No")
x, a=map(int, input().split())
if	x < a
	l = 0
else
	l = 10
print (l)   

### FIXED CODE ###

x, a=map(int, input().split())
if	x < a:
	l = 0
else:
	l = 10
print(l)
import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:

    ret = 2020
    for i in itertools.combinations(range(l,r+1,1),2):
        ret = min(ret,(i[0]*i[1])%2019)
        print(i,ret)
print(ret)


### FIXED CODE ###

import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
    for i in itertools.combinations(range(l,r+1,1),2):
        ret = min(ret,(i[0]*i[1])%2019)
    print(ret)
import numpy as np
import itertools
n,k = map(int,input().split())
ary = np.array([list(map(int,input().split())) for _ in range(n)],dtype=float)
a = list(itertools.combinations(ary,k))
ans = float("Inf")
for i in a:
    min_a = np.min(i,axis=0)
    max_a = np.max(i,axis=0)
    ans = min(ans,(max_a[0] - min_a[0]) * (max_a[1] - min_a[1]))
print(int(ans))

### FIXED CODE ###

n,k = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(n)]
ary.sort()

ans = float("Inf")
for i in range(n-k+1):
    for j in range(k,n-i+1):
        xmin = ary[i][0]
        xmax = ary[i+j-1][0]
        ary_y = sorted(ary[i:i+j], key=lambda x: (x[1]))
        for l in range(len(ary_y)-k+1):
            ymin = ary_y[l][1]
            ymax = ary_y[l+k-1][1]
            ans = min(ans,(xmax - xmin) * (ymax - ymin))
print(ans)
import sys

for line in sys.stdin:
    a,b,c = [int(x) for x in line.split()]
    if (a**2+b**2) == c**2:
        print('YES')
    else:
        print('NO')

### FIXED CODE ###

import sys

for line in sys.stdin:
    try:
        a,b,c = [int(x) for x in line.split()]
        if (a**2+b**2) == c**2:
            print('YES')
        elif (a**2+c**2) == b**2:
            print('YES')
        elif (b**2+c**2) == a**2:
            print('YES')
        else:
            print('NO')
    except(ValueError):
        continue
n=input()
  print('ABC'+n)

### FIXED CODE ###

n=input()
s='ABC'+str(n)
print(s)
import math
n=int(input())
for i in range(1,n+1):
  for j in range(1,n+1):
    for k in range(1,n+1):
      ans+=math.gcd(i,math.gcd(j,k))
print(ans)

### FIXED CODE ###

import math
n=int(input())
ans=0
for i in range(1,n+1):
  for j in range(1,n+1):
    for k in range(1,n+1):
      ans+=math.gcd(i,math.gcd(j,k))
print(ans)
def main():
    n = int(input())
    a = sorted(list(map(int, input().split())))
    pool = set()
    count = 0
    limit = 10 ** 6 // 2 +1
    for i in range(n):
        t = a[i]
        if t in pool:
            continue
        for j in range(1, limit):
            x = t*j
            if x > limit:
                break
            pool.add(x)
        if not (n > i+1 and t == a[i+1]):
            count += 1
    print(count)

if __name__ == '__main__':
    main()

### FIXED CODE ###

print(list(map(int,input().split())).index(0)+1)
n=int(input())

A=list(map(int,input().split()))
        
A.sort(reverse=True)

X=[]

t=None

for i in A:
    if i==t:
        t=None
        X.append(t)
        if len(X)==2:
            break
    else:
        t=i
        
print(X[0]*X[1] if len(X)>1 else 0)

### FIXED CODE ###

import collections

n=int(input())

A=list(map(int,input().split()))
        
X=collections.Counter(A)

ans=1
cnt_1=0
cnt_2=0

for k,v in sorted(X.items(),key=lambda x:x[0],reverse=True):
    if v>=2:
        cnt_1+=1
        ans*=k
        if cnt_1==2:
            break
        if v>=4:
            ans*=k
            break
    else:
        cnt_2+=1
        if cnt_2==n or cnt_2==n-2 or cnt_2==n-3:
            ans=0
            break
print(ans)
a=input()
len=len(a)
a_cnt=0
b_cnt=0
for i in range(len):
    if a[i]='A':
        a_cnt+=1
    else :
        b_cnt+=1
if a_cnt>0 and b_cnt>0:
    print('Yes')
else :
    print('No')


### FIXED CODE ###

a=input()
len=len(a)
a_cnt=0
b_cnt=0
for i in range(len):
    if a[i]=='A':
        a_cnt+=1
    else :
        b_cnt+=1
if a_cnt>0 and b_cnt>0:
    print('Yes')
else :
    print('No')
N, M = [int(k) for k in input().split()]
nodes = {k:set() for k in range(1,N+1)}
visited = [False for i in range(N+1)]

for i in range(M):
  a, b = [int(k) for k in input().split()]
  nodes[a].add(b)
  nodes[b].add(a)
  
def dfs(i):
  visited[i] = True
  cnt = 1
  for j in nodes[i]:
    if not visited[j]:
      cnt += dfs(j)
      
  return cnt
  
   
ans = 1
if M > 0:
  for i in nodes:
    if not visited[i]:
      ans = max(dfs(i),ans)

print(ans)


### FIXED CODE ###

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]    
      
def program():
  N, M = map(int, input().split())
  uf = UnionFind(N)
  for i in range(M):
    a, b = map(int, input().split())
    uf.union(a-1,b-1)
  
  ans = max([uf.size(i) for i in range(N)])
  return ans

print(program())
s =input()
ans = re.finditer(r'(A|T|G|C)+',s)
max=0
for a in ans:
    temp=len(a.group())
    if temp>=max:
        max=temp
print(max)

### FIXED CODE ###

s=input()
import re
ans=re.findall("[A,T,G,C]+",s)#findall、なかったら[]が帰ってくる。matchのようにNoneが帰ってくるわけではない。
if ans==[]:
    print(0)
else:
    print(len(max(ans,key=len)))#このときfindallで返される行列は先頭から見つかったもの順に並べられることに注意すること。
N,M=map(int,input().split())
A=list(map(int,input().split()))
x=sum(A)
if sum([i if a>=x/4/M else 0 for a in A])>=M:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N,M=map(int,input().split())
A=list(map(int,input().split()))
x=sum(A)
if sum([1 if a>=x/4/M else 0 for a in A])>=M:
  print('Yes')
else:
  print('No')
S = int(input())
h = s // 3600
m = (s // 60) % 60
s = S % 60
print(h,":",m,":",s,sep="")

### FIXED CODE ###

S = int(input())
h = S // 3600
m = (S // 60) % 60
s = S % 60
print(h,":",m,":",s,sep="")
# coding: utf-8

import math
import sys
input = sys.stdin.readline

def gcd(num):
    if len(num) == 1:
        return num[0]
    else:
        return math.gcd(gcd(num[0:1]), gcd(num[1:]))

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

print(gcd(A))



### FIXED CODE ###

# coding: utf-8

import sys
input = sys.stdin.readline

def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)

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

first_gcd = A[0]
for i in range(len(A)):
    first_gcd = gcd(first_gcd, A[i])

print(first_gcd)
n = int(input())
a = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))

result = 0
sum_a = sum(a)
for i in range(n):
    if a[i] <= b[i]:
        b[i] -= a[i]
        a[i] = 0
        if a[i+1] <= b[i]:
            a[i+1] = 0
        else:
            a[i+1] -= b[i]
    else:
        a[i] -= b[i]
    print('a',a)
    print('b',b)
print(sum_a-sum(a))

### FIXED CODE ###

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

sum_a = sum(a)
for i in range(n):
    if a[i] <= b[i]:
        b[i] -= a[i]
        a[i] = 0
        if a[i+1] <= b[i]:
            a[i+1] = 0
        else:
            a[i+1] -= b[i]
    else:
        a[i] -= b[i]
print(sum_a-sum(a))
n, d = map(int, input().split())
xy = 0
for i in range(n):
  a, b = map(int, input().split())
  xy += xi**2 + yi**2 <= d**2 for xi, yi in xy

print(xy)

### FIXED CODE ###

n, d = map(int, input().split())
x, y = [], []
for i in range(n):
  a, b = map(int, input().split())
  x.append(a)
  y.append(b)

count = 0
for xi, yi in zip(x, y):
  if xi**2 + yi**2 <= d**2:
    count += 1

print(count)
n,*aa = map(int, open(0).read().split())

from itertools import accumulate
from collections import Counter
from math import comb

c = Counter(accumulate(aa))
c[0] += 1

ans = 0
for i,v in c.items():
    if v > 1:
        ans += comb(v,2)

print(ans)

### FIXED CODE ###

n,*aa = map(int, open(0).read().split())

from itertools import accumulate
from collections import Counter
from math import comb

c = Counter(accumulate(aa))
c[0] += 1

ans = 0
for i,v in c.items():
    if v > 1:
        ans += comb(v,2)

print(ans)
from collections import defaultdict
from itertools import product
from sys import stdin
def gen_b(x,B):
	if x < 3: lb = 2
	else: lb = x - 1
	if x > B-2: ub = B-1
	else: ub = x + 1
	return xrange(lb,ub+1)
def solve():
	count = defaultdict(int)
	ans = [0]*10
	L = map(lambda x:map(int,x.split()),stdin.readlines())
	H,W,N = L[0]
	for i in xrange(1,N+1):
		for x,y in product(gen_b(L[i][0],H),gen_b(L[i][1],W)):
			count[x+(y<<34)] += 1
	for v in count.itervalues():ans[v] += 1
	ans[0] = (H-2)*(W-2) - sum(ans[1:])
	for c in ans: print c
solve()

### FIXED CODE ###

from itertools import permutations as perm
S = raw_input()
n = len(S)
dp = [[] for i in xrange(n)]
dp[0].append(int(S[0]))
for i in xrange(1,n):
	dp[i].append(int(S[:i+1]))
	for j in xrange(i):
		for k in dp[j]:
			dp[i].append(k+int(S[j+1:i+1]))
print sum(dp[n-1])
N, K = map(int, input().split())
mod = 10**9+7

def combination(a, b):
    minb = min(a-b, b)
    r = 1
    for i in range(1, minb+1):
        r = r * (a-minb+i)/i
    return int(r)

for i in range(1, K+1):
    if N==K and i!=1:
        print(0)
        continue
    must = combination(K-1, i-1)
    left_ball = N-K-i+1
    if left_ball < 0:
        print(0)
        continue
    can = combination(left_ball+i, i)
    print((must*can)%mod)

### FIXED CODE ###

N, K = map(int, input().split())
mod = 10**9+7

import math

def combination(a, b):
    minb = min(a-b, b)
    r = 1
    for j in range(1, minb+1):
        r = r * (a-minb+j)//j
    return int(r)

for i in range(1, K+1):
    if N==K and i!=1:
        print(0)
        continue
    must = combination(K-1, i-1)
    if must is None:
        print("K:"+str(K)+", i:"+str(i))
    left_ball = N-K-i+1
    if left_ball < 0:
        print(0)
        continue
    can = combination(left_ball+i, i)
    print((must*can)%mod)
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n =< k:
    answer = k * x
else: 
    answer = (n-k) * y + int(answer)

print(answer) 

### FIXED CODE ###

n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n <= k:
    answer = n * x
else: 
    answer = (n-k) * y + k*x

print(answer)
# import bisect
# import copy
# import fractions
# import math
import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    n=int(input())
    A=np.array(list(map(int,input().split())))

    cnt=0
    while all(i%2==0 for i in A):
        A = A//2
        cnt+=1
    print(cnt)



resolve()

### FIXED CODE ###

# import bisect
# import copy
# import fractions
# import math
import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    n=int(input())
    A=np.array(list(map(int,input().split())))

    cnt=0
    while all(i%2==0 for i in A):
        A = A//2
        cnt+=1
    print(cnt)



resolve()
X=int(input())

if X<4:
    print('1')
    exit(0)

n=2
p=2
max=0
b_flag=True
while True:

    #print(n)
    while b_flag:
        if n**p>X:
            b_flag=False
        elif max<n**p:
            max=n**p
        p+=1
    n+=1
    p = 2
    b_flag=True
    if n**p>X:
        break
print(max)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
direct_distance=abs(c-a)
AtB=abs(b-a)
BtC=abs(c-b)

if direct_distance<=d or (AtB <= d and BtC <= d):
    print('Yes')
else:
    print('No')
S = input()

alpha = [chr(i) for i in range(97, 97+26)]

remain = list(set(alpha) - set(S))
remain.sort()
print(remain[0])


### FIXED CODE ###

S = input()

alpha = [chr(i) for i in range(97, 97+26)]

remain = list(set(alpha) - set(S))

if remain == []:
    print("None")
else:
    remain.sort()
    print(remain[0])
N = int(input())
S,T = list(map(str, input().split()))
for i in range(N):
    print(S[i],end='')
    print(T[i],end='')

### FIXED CODE ###

A = int(input())
B = int(input())
print(6-A-B)
import numpy as np
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import dijkstra

def resolve():
    N, M = map(int, input().split())
    G = np.zeros((N + 1, N + 1), dtype=np.int64)

    for _ in range(M):
        x, y = map(int, input().split())
        G[x, y] += 1
        G[y, x] += 1
    csr = csr_matrix(G)
    dist, pred = dijkstra(csgraph=csr ,return_predecessors=True)

    ans = pred[1,2:]
    impos = any(ans >=0)
    if impos:
        print("Yes")
        print(*ans, sep="\n")
    else:
        print("No")

if __name__ == "__main__":
    resolve()

### FIXED CODE ###


from collections import deque
def resolve():
    N, M = map(int, input().split())
    G = [[] for _ in range(N)]
    for _ in range(M):
        x, y = map(lambda x:int(x)-1, input().split())
        G[x].append(y)
        G[y].append(x)

    dist = [-1]*N
    ans = [0]*N
    q = deque()
    q.append(0)
    while q:
        fm = q.popleft()
        for to in G[fm]:
            if dist[to] != -1:
                continue
            dist[to] += 1
            ans[to] = fm
            q.append(to)

    print("Yes")
    for i in range(1, N):
        print(ans[i] + 1)
        
if __name__ == "__main__":
    resolve()
h a = map(int, input().split(' '))
if h % a == 0:
    print(h // a)
else:
    print(h // a + 1)

### FIXED CODE ###

h, a = map(int, input().split(' '))
if h % a == 0:
    print(h // a)
else:
    print(h // a + 1)
n = int(input())
t = list(map(int,input().split()))
for _ in int(input()):
  p,x = map(int,input().split())
  l=t.copy()
  l[p-1] = x
  print(sum(l))



### FIXED CODE ###

n = int(input())
t = list(map(int,input().split()))
for _ in range(int(input())):
  p,x = map(int,input().split())
  l=t.copy()
  l[p-1] = x
  print(sum(l))
a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  input('red')

### FIXED CODE ###

a=int(input())
s=input()
if a>=3200:
  print(s)
else:
  print('red')
list = list(map(int,input().split()))
A = list[0]
B = list[1]
K = list[2]

for num in range(K):
    if(A < 1 && B < 1):
        break
    elif(A > 1):
        A -= 1
    elif(B < 1):
        B -= 1

print(A, B)


### FIXED CODE ###

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

if A >= K:
    A = A - K
elif (A + B) >= K:
    B = B - K + A
    A = 0
else:
    A = B = 0

print(A, B)
S=input()
total=0

for i in range(ren(S)):
    if  i%2==0:
        if  (S[i]=='R')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1
    else:
        if  (S[i]=='L')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1

if  total==0:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

S=input()
total=0

for i in range(len(S)):
    if  (i%2)==0:
        if  (S[i]=='R')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1
    else:
        if  (S[i]=='L')or(S[i]=='U')or(S[i]=='D'):
            pass
        else:
            total+=1

if  total==0:
    print('Yes')
else:
    print('No')
def dfs(i,p,edges,num):
    
    for j in edges[i]:
        if(j!=p):
            
            num[j] += num[i]
            
            dfs(j,i,edges,num)
    

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


a=[]
b=[]

p=[]
x=[]

#隣接リスト
edges = [ [] for i in range(N)]
num = [0]*N


for i in range(N-1):
    a0,b0 = map(int,input().split())
    a.append(a0)
    b.append(b0)
    
    edges[a0-1].append(b0-1)
    edges[b0-1].append(a0-1)
    
for i in range(Q):
    p0,x0 = map(int,input().split())
    p.append(p0)
    x.append(x0)
    num[p0-1] += x0
    
dfs(0,-1, edges, num)
    
for i in range(N):
    print(num[i], end=" ")

### FIXED CODE ###

# https://atcoder.jp/contests/abc138/tasks/abc138_d
import sys
sys.setrecursionlimit(2*2*10**5)

def dfs(i,p,edges,num):
    
    for j in edges[i]:
        if(j!=p):
            
            num[j] += num[i]
            
            dfs(j,i,edges,num)
    
def input():
    return sys.stdin.readline()[:-1]

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


#隣接リスト
edges = [ [] for i in range(N)]
num = [0]*N


for i in range(N-1):
    a0,b0 = map(int,input().split())

    edges[a0-1].append(b0-1)
    edges[b0-1].append(a0-1)
    
for i in range(Q):
    p0,x0 = map(int,input().split())

    num[p0-1] += x0
    
dfs(0,-1, edges, num)
    
for i in range(N):
    print(num[i], end=" ")
def main():
    n,a,b=mi()
    s=list(input())
    nover=0
    tot=0
    for i in range(n):
        if tot<a+b:
            if s[i]=='a':
                print('Yes')
                tot+=1
            elif s[i]=='b' and nover<b:
                print('Yes')
                nover+=1
                tot+=1
            else:
                print('No')
        else:
            print('No')
main()                

### FIXED CODE ###

n,a,b=map(int,input().split())
s=list(input())
nover=0
tot=0
for i in range(n):
    if tot<a+b:
        if s[i]=='a':
            print('Yes')
            tot+=1
        elif s[i]=='b' and nover<b:
            print('Yes')
            nover+=1
            tot+=1
        else:
            print('No')
    else:
        print('No')
A=set(list(map(int,input().split())))
print('YES' if A==set(list(1,9,7,4)) else 'NO')

### FIXED CODE ###

A=list(map(int,input().split()))
L=[1,9,7,4]
print('YES' if set(A)==set(L) else 'NO')