Harryxun/stf_run huggingface dataset:
S=input()
K=int(input())
count=0
SS=S*K
flag=True
print(SS)
for i in range(1, len(SS)):
  if not flag:
    flag=True
    continue

### FIXED CODE ###

S=input()
K=int(input())
SS=S+S
SSS=SS+S
count_single=count_double=count_triple=0
flag=True
for i in range(1, len(S)):
  if not flag:
    flag=True
    continue
  if S[i-1]==S[i]:
    count_single+=1
    flag=False
flag=True
for i in range(1, len(SS)):
  if not flag:
    flag=True
    continue
  if SS[i-1]==SS[i]:
    count_double+=1
    flag=False
flag=True
for i in range(1, len(SSS)):
  if not flag:
    flag=True
    continue
  if SSS[i-1]==SSS[i]:
    count_triple+=1
    flag=False
if K==1:
  print(count_single)
elif K==2:
  print(count_double)
else:
  diff21=count_double-count_single
  diff32=count_triple-count_double
  print(count_single+(K//2)*diff21+((K-1)//2)*diff32)
s = input()

s[0] = '2'
s[1] = '0'
s[2] = '1'
s[3] = '7'

print s


### FIXED CODE ###

s = input()

print("2018"+s[4:])
a,b = input().strip()
if a=="H":
    print(b)
else:
    if b=="H":
        print("D")
    else:
        print("H")

### FIXED CODE ###

a,b = input().split()
if a=="H":
    print(b)
else:
    if b=="H":
        print("D")
    else:
        print("H")
line=input()

a=['R','U','D']
b=['L','U','D']
flag=True

for i in range(len(line)):
  if (i+1)%2==1:
    if line[i] not in a:
      fline=input()

a=['R','U','D']
b=['L','U','D']
flag=True

for i in range(len(line)):
  if not flag:
    print(flag)
    break
  if (i+1)%2==1:
    if line[i] not in a:
      flag=False
      print('No')
  else:
    if line[i] not in b:
      flag=False
      print('No')
if flag==True:
  print('Yes') lag==False
      print('No')
      break
  else:
    if line[i] not in b:
      flag==False
      print('No')
      break

if flag:
  print('Yes')         

### FIXED CODE ###

line=input()

a=['R','U','D']
b=['L','U','D']
flag=True

for i in range(len(line)):
  if not flag:
    break
  if (i+1)%2==1:
    if line[i] not in a:
      flag=False
      print('No')
  else:
    if line[i] not in b:
      flag=False
      print('No')
if flag==True:
  print('Yes')
o = input()
e = input()
ans_l = [0] * (len(o) + len(e))
for i in range(len(o)):
    ans_l[i*2] = o[i]
for j in range(len(e)):
    ans_l[j*2+1] = e[i]
print(''.join(ans_l))

### FIXED CODE ###

o = input()
e = input()
ans_l = [0] * (len(o) + len(e))
for i in range(len(o)):
    ans_l[i*2] = o[i]
for j in range(len(e)):
    ans_l[j*2+1] = e[j]
print(''.join(ans_l))
t, x = list(map(int, input()))

print(t/x)

### FIXED CODE ###

t, x = list(map(int, input().split(' ')))

print(t/x)
n, k = map(int,input().split())
for i in range(1,n):
  a=max(0,i-k)*(n//b)+max(0,n%i-k+1)
if k==0:
  a-=n
print(a)

### FIXED CODE ###

n, k = map(int,input().split())
a=0
for i in range(1,n+1):
  a+=max(0,i-k)*(n//i)+max(0,n%i-k+1)
if k==0:
  a-=n
print(a)
N,M = map(int,input().split())
G = [[] for _ in range(N)]

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

seen = [False]*(N)
ans = 0
def dfs(v):
    if seen[v]:
        return
    seen[v] = True
    for nv in G[v]:
        dfs(nv)

for v in range(N):
    if not seen[v]:
        dfs(v)
        ans += 1
print(ans)

### FIXED CODE ###

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

par = [-1]*(N+1)


def find(x):
    if par[x] < 0:
        return x
    else:
        par[x] = find(par[x])
        return par[x]


def unite(x,y):
    x = find(x)
    y = find(y)
    if x == y:
        return False
    else:
        if par[x] > par[y]:
            x,y = y,x
        par[x] += par[y]
        par[y] = x
        return True


def same(x,y):
    return find(x) == find(y)


def size(x):
    return -par[find(x)]

for i in range(M):
    x,y,z = map(int,input().split())
    unite(x,y)

ans = 0
counted = [False] * (N+1)
for i in range(1,N+1):
    root = find(i)
    if not counted[root]:
        ans += 1
        counted[root] = True
print(ans)
max = 0
i = 0
j = 0
k = 0
n_max = 0

n_max = int(raw_input())
price = []
for k in range(n_max):
    price.attend(int(raw_input())
    
for i in range(n_max)
    for j in range(k, n_max)
        if max <= price[j] - price[i]:
            max = price[j] - price[i]
print max

### FIXED CODE ###

import sys

n = int(raw_input())

min_R = int(raw_input())
nums = map(int, sys.stdin.readlines())

ans = -10**9

for num in nums:
    if num - min_R > ans:
        ans = num - min_R
    if num < min_R:
        min_R = num
        
print ans
def func(n):
    if n==0: return 1
    if n==1: return 1
    if dp[n]!=-1: return dp[n]
    f1 = func(n-1) if n-1 not in a else 0
    f2 = func(n-2) if n-2 not in a else 0
    dp[n] = (f1 + f2) % 1000000007
    return dp[n]
n,m = map(int, intput().split())
a={int(input()) for i in range(m)}
dp=[-1]*(n+1)
print(func(n))

### FIXED CODE ###

def func(n):
    if n==0: return 1
    if n==1: return 1
    if dp[n]!=-1: return dp[n]
    f1 = func(n-1) if n-1 not in a else 0
    f2 = func(n-2) if n-2 not in a else 0
    dp[n] = (f1 + f2) % 1000000007
    return dp[n]
import sys
sys.setrecursionlimit(1000000)
n,m = map(int, input().split())
a={int(input()) for i in range(m)}
dp=[-1]*(n+1)
print(func(n))
n, x, y = map(int, input().split())

ans = {}
for i in range(n-1):
  ans[i+1] = 0
  
for i in range(n):
  for j in range(i+1,n):
    if i <= x-i:
      if j <= x-1:
      	t=j-i
      	ans[t] += 1
      elif j <= y-1:
      	t = min(j-i, (x-1)-i + 1 + (y-1) -j)
      	ans[t] += 1
      else: #j > y-1
      	t = (x-1)-i + 1 + j -(y-1)
      	ans[t] += 1
    elif i < y-1:
      if j < y-1:
      	t = min(j-i, i-(x-1) + 1 + (y-1) -j)
      	ans[t] += 1
      elif j >= y-1:
      	t = min(j-i, i-(x-1) + 1 + j - (y-1))
      	ans[t] += 1
    elif i >= y-1:
      t=j-i
      ans[t] += 1
    else:
      print("error")

for i in range(1,n):
  print(ans[i])


### FIXED CODE ###

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

ans = {}
for i in range(n-1):
  ans[i+1] = 0
  
for i in range(n):
  for j in range(i+1,n):
    if i <= x-1:
      if j <= x-1:
      	t=j-i
      	ans[t] += 1
      elif j <= y-1:
      	t = min(j-i, (x-1)-i + 1 + (y-1) -j)
      	ans[t] += 1
      else: #j > y-1
      	t = (x-1)-i + 1 + j -(y-1)
      	ans[t] += 1
    elif i < y-1:
      if j < y-1:
      	t = min(j-i, i-(x-1) + 1 + (y-1) -j)
      	ans[t] += 1
      else: #j >= y-1:
      	t = min(j-i, i-(x-1) + 1 + j - (y-1))
      	ans[t] += 1
    elif i >= y-1:
      t=j-i
      ans[t] += 1
    else:
      print("error")

for i in range(1,n):
  print(ans[i])
n = int(input())
a = list(map(int, input().split()))
c = []

for i in range(n+1):
    c.append(a.index(i)+1)

print(' '.join(map(str, c)))


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
index=[0]*n

for i in range(n):
    index[a[i]-1] = i+1

print(' '.join(map(str, index)))
N,M=map(int,input().split())
S=list(map(int,input().split()))
S.sort()

TRADE=[[0 for j in range(2)] for i in range(M)]

for i in range(M):
    B,C=map(int,input().split())
    TRADE[i][0]=B
    TRADE[i][1]=C


T=sorted(TRADE,key=lambda x:x[1],reverse=True)


TLEN=0
pos=0
flag=True
while TLEN<M and flag==True:
    for i in range(T[TLEN][0]):
        if S[pos]<T[TLEN][1]:
            S[pos]=T[TLEN][1]
            pos+=1
        else:
            flag=False
            break
    TLEN+=1

print(sum(S))

### FIXED CODE ###

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

TRADE=[[0 for j in range(2)] for i in range(M)]

for i in range(M):
    B,C=map(int,input().split())
    TRADE[i][0]=B
    TRADE[i][1]=C


T=sorted(TRADE,key=lambda x:x[1],reverse=True)


TLEN=0
pos=0
flag=True
while TLEN<M and flag==True:
    for i in range(T[TLEN][0]):
        if S[pos]<T[TLEN][1]:
            S[pos]=T[TLEN][1]
            pos+=1
        else:
            flag=False
            break
        if pos>len(S)-1:
            flag=False
            break
    TLEN+=1

print(sum(S))
N,M=map(int,input().split())
PS=[list(input().split()) for i in range(M)]
AC=[0]*N
WA=[0]*N
for p,s in PS:
  p=int(p)
  if s=="AC" and AC[p]==0:
    AC[p]=1
  elif s=="WA":
    WA[p]+=1
wa=0
for i in WA:
  wa+=i
print(sum(AC),wa)
  

### FIXED CODE ###

N,M=map(int,input().split())
AC=[0]*N
WA=[0]*N
wa=0
for i in range(M):
    p,s=input().split()
    p=int(p)-1
    if AC[p]==0 and s=="AC":
        AC[p]=1
        wa+=WA[p]
    WA[p]+=1
print(sum(AC),wa)
import sys
def input():
    return sys.stdin.readline()[:-1]
N=int(input())
S = [list(map(int, input().split()))+[i] for i in range(N-1)]
A=[None]*(N-1)
l=[[] for i in range(N+1)]
t=[0]*N
t[0]=1
for i in S:
    l[i[0]].append((i[1],i[2]))
    l[i[1]].append((i[0],i[2]))
def haba(o,c):
    p=1
    for i in l[o]:
        if t[i[0]-1]==0:
            if c==p:
                p+=1
            A[i[1]]=p
            t[i[0]-1]=1
            haba(i[0],p)
            p+=1
haba(1,0)
print(max(A))
print(*A,sep="\n")

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
sys.setrecursionlimit(200000)
N=int(input())
S = [list(map(int, input().split()))+[i] for i in range(N-1)]
A=[None]*(N-1)
l=[[] for i in range(N+1)]
t=[0]*N
t[0]=1
for i in S:
    l[i[0]].append((i[1],i[2]))
    l[i[1]].append((i[0],i[2]))
def haba(o,c):
    p=1
    for i in l[o]:
        if t[i[0]-1]==0:
            if c==p:
                p+=1
            A[i[1]]=p
            t[i[0]-1]=1
            haba(i[0],p)
            p+=1
haba(1,0)
print(max(A))
print(*A,sep="\n")
def index_bin(l, x):
    n = len(l)
    b = 0
    e = n - 1
    while(b != e):
        if x > l[(b+e)//2]:
            b = (b+e)//2 + 1
        else:
            e = (b+e)//2
    return b


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

P = []
Y = []
PY = [[] for _ in range(M)]


for i in range(M):
    p, y = map(int, input().split())
    P.append(p)
    Y.append(y)
    PY[p-1].append(y)

for i in range(M):
    PY[i].sort()

for i in range(M):
    x = index_bin(PY[P[i]-1], Y[i]) + 1
    print("%06d%06d" % (P[i], x))

### FIXED CODE ###

from bisect import bisect_left

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

P = []
Y = []
PY = [[] for _ in range(N+1)]

for _ in range(M):
    p, y = map(int, input().split())
    P.append(p)
    Y.append(y)
    PY[p].append(y)

for i in range(N+1):
    PY[i].sort()

for i in range(M):
    x = bisect_left(PY[P[i]], Y[i]) + 1
    print("%06d%06d" % (P[i], x))
S = input()
T = input()

cnt = 0

for i in range(0,3):
  if S[i] == T[i]:
    cnt += 1

pirn(cnt)
  


### FIXED CODE ###

S = list(input())
T = list(input())

cnt = 0

for i in range(0,3):
  if S[i] == T[i]:
    cnt += 1

print(cnt)
N = int(input())
A = list(map(int, input().split()))
mod = (10**9) + 7
abc = [0] * 3
ans = 1
for i in range(N):
	pos = abc.count(A[i])
	ind = abc.index(A[i])
	ans *= pos
	ans %= mod
	abc[ind] += 1

print(ans)

### FIXED CODE ###

import sys

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

mod = (10**9) + 7
abc = [0] * 3
ans = 1
for i in range(N):
	pos = abc.count(A[i])
	if pos == 0:
		print(0)
		sys.exit()
	ind = abc.index(A[i])
	ans *= pos
	ans %= mod
	abc[ind] += 1

print(ans)
from operator import itemgetter

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC =[]

for i in range(M):
    BC.append(list(map(int,input().split())))

A.sort()
BC_sorted = sorted(BC, key=itemgetter(1), reverse=True)
# print(BC_sorted)

cur = 0

for i in range(M):
    if A[cur]>= BC_sorted[i][1]:
        break
    for j in range(BC_sorted[i][0]):
        for k in range(cur, N):
            if A[k] < BC_sorted[i][1]:
                A[k] = BC_sorted[i][1]
                cur = k+1
                break
            elif A[k] > BC_sorted[i][1]:
                cur = k+1
                break
    # print(i, ':', A, 'cur:', cur)


print(sum(A))

### FIXED CODE ###

from operator import itemgetter

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC =[]

for i in range(M):
    BC.append(list(map(int,input().split())))

A.sort()
BC_sorted = sorted(BC, key=itemgetter(1), reverse=True)
# print(BC_sorted)

cur = 0

for i in range(M):
    if cur == N or A[cur]>= BC_sorted[i][1]:
        break
    for j in range(BC_sorted[i][0]):
        for k in range(cur, N):
            if A[k] < BC_sorted[i][1]:
                A[k] = BC_sorted[i][1]
                cur = k+1
                break
            elif A[k] > BC_sorted[i][1]:
                cur = k+1
                break
    # print(i, ':', A, 'cur:', cur)


print(sum(A))
def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
    
def same(x,y):
  rx = root(x)
  ry = root(y)
  if rx == ry:
    print("Yes")
  else:
    print("No")
    
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
for i in range(n):
  par[i] = root(i)
maxi = 0
count = 1
par.sort()
#print(par)
for i in range(1, n + 1):
  if par[i] == par[i - 1]:
    count += 1
  else:
    maxi = max(maxi, count)
    count = 1
else:
  maxi = max(maxi, count)
print(maxi)

### FIXED CODE ###

import sys
import resource

def root(x):
  if par[x] == x:
    return x
  par[x] = root(par[x])
  return par[x]

def union(x, y):
  rx = root(x)
  ry = root(y)
  if rx != ry:
    par[rx] = ry
  return 0

sys.setrecursionlimit(10 ** 6)
n, m=map(int, input().split(" "))
par = list(range(n + 1))
for i in range(m):
  a, b = map(int, input().split(" "))
  union(a, b)
#print(par)
maxi = 0
count = 1
#print(par)
countpar = [0 for i in range(n + 1)]
#print(len(countpar), len(par))
for i in range(1, n + 1):
  countpar[root(par[i])] += 1
print(max(countpar))
#print(countpar, par)
print(len(filter(lambda s: s == '1', list(input()))))

### FIXED CODE ###

print(len(list(filter(lambda s: s == '1', list(input())))))
# -*- coding: utf-8 -*-
import sys,fractions
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    def dfs(res, flag, depth):
        if depth == N:
            return res
        if flag:
            return dfs(fractions.gcd(res, A[depth]), True, depth + 1)
        else:
            return max( dfs(res, True, depth + 1), dfs(fractions.gcd(res, A[depth]), False, depth + 1))

    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))
    print(dfs(0, False, 0) )
lines = [x.strip() for x in sys.stdin.readlines()]
solve(lines)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys,fractions
from functools import reduce
# ----------------------------------------------------------------
# Use Solve Function

def solve(lines):
    N = int(lines.pop(0))
    A = list(map(int, lines.pop(0).split(' ')))

    _l = 0
    L = []
    for i in range(N-1):
        _l = fractions.gcd(_l, A[i])
        L.append(_l)
    L.insert(0,0)

    _r = 0
    R = []
    for i in range(N-1):
        _r = fractions.gcd(_r, A[N-i-1])
        R.append(_r)
    R.reverse()
    R.append(0)

    print(max([fractions.gcd(l,r) for l, r in zip(L,R)]))



lines = [x.strip() for x in sys.stdin.readlines()]

#
# solve !!
#
solve(lines)
n = int(input())
cnt = 0

while True:
    if n == 2:
            break
    else:
        if n % 2 == 0:
            n = n // 2
            cnt += 1
        else:
            n = n // 2 + 1
            cnt += 1

l = [[] for _ in range(cnt+1)]
l[0] = list(map(int, input().split()))
l[0].sort()


for i in range(cnt):
    for j in range(0,n,2):
        l[i+1].append((l[i][j] + l[i][j+1]) / 2)
        if n // 2 == 1:
            l[i+1].append(l[i][n])

print((l[cnt][0] + l[cnt][1]) / 2)

### FIXED CODE ###

n = int(input())
v = sorted(list(map(int, input().split())))
 
ans = v[0]
for i in range(1,n):
  ans = (ans + v[i])/2
print(ans)
n,k=map(int,input().split())
d=list(map(int,input().split()))
d=d*2
ans=0
for i in range(1,k+1):
  
  for j in range(i+1):
    have=[d[n+c-j] for c in range(i)] #ここにi個の宝石を入れる
    have.sort()
    if i!=k:
      for h in range(k-i):
        if have==[] or have[0]>=0:
          break
        del have[0]
      #いらない宝石を可能な限り詰めた状態
    if sum(have)>ans:
      ans=sum(have)
print(ans)


### FIXED CODE ###

n,k=map(int,input().split())
d=list(map(int,input().split()))
d=d*2
ans=0
for i in range(1,min(k+1,n+1)):
  
  for j in range(i+1):
    have=[d[n+c-j] for c in range(i)] #ここにi個の宝石を入れる
    have.sort()
    if i!=k:
      for h in range(k-i):
        if have==[] or have[0]>=0:
          break
        del have[0]
      #いらない宝石を可能な限り詰めた状態
    if sum(have)>ans:
      ans=sum(have)
print(ans)
x=int(input())
i=1
while x!="0":
    print("Case %d: %s" %(i,x))
    x=int(input())
    i+=1

### FIXED CODE ###

x=int(input())
i=1
while x!=0:
    print("Case %d: %s" %(i,x))
    x=int(input())
    i+=1
N=int(input())
s=[input().split() for i in range(N)]
M=0
for i in range(N):
  p=int(i)
  if s[p][1]=="JPY":
    M=M+float(s[p][0])
  else:
    M=M+float(s[p][0])*380000.0
print(M)



### FIXED CODE ###

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

if a<2019:
    print("Heisei")
elif a>2019:
    print("TBD")
else :
    if b<5:
        print("Heisei")
    else:
        print("TBD")
n = int(input())
v = list(map(int,input().split()))

if max(v)==min(v):
	print(int(n/2))
else:
	dic1 = {}
	dic2 = {}
	
	for i in range(n):
		if i % 2 == 1:
			if str(v[i]) in dic1.keys():
				dic1[str(v[i])] = dic1[str(v[i])] + 1
			else:
				dic1[str(v[i])] = 1
	
		if i % 2 == 0:
			if str(v[i]) in dic2.keys():
				dic2[str(v[i])] = dic2[str(v[i])] + 1
			else:
				dic2[str(v[i])] = 1
	
	max1 = max(dic1, key=dic1.get)
	max2 = max(dic2, key=dic2.get)
	p1 = dic1[max1]
	p2 = dic2[max2]
	if max1 == max2:
		dic1.pop(max1)
		dic2.pop(max2)
		max3 = max(dic1, key=dic1.get)
		max4 = max(dic2, key=dic2.get)
		p3 = dic3[max3]
		p4 = dic4[max4]
		if p1 + p4 > p2 + p3:
			p2 = p4
		else:
			p1 = p3
	
	print(n-p1-p2)

### FIXED CODE ###

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

if max(v)==min(v):
	print(int(n/2))
else:
	dic1 = {}
	dic2 = {}
	
	for i in range(n):
		if i % 2 == 1:
			if str(v[i]) in dic1.keys():
				dic1[str(v[i])] = dic1[str(v[i])] + 1
			else:
				dic1[str(v[i])] = 1
	
		if i % 2 == 0:
			if str(v[i]) in dic2.keys():
				dic2[str(v[i])] = dic2[str(v[i])] + 1
			else:
				dic2[str(v[i])] = 1
	
	max1 = max(dic1, key=dic1.get)
	max2 = max(dic2, key=dic2.get)
	p1 = dic1[max1]
	p2 = dic2[max2]
	if max1 == max2:
		dic1.pop(max1)
		dic2.pop(max2)
		if dic1 == {}:
			p3 = 0
		else:
			max3 = max(dic1, key=dic1.get)
			p3 = dic1[max3]
		if dic2 == {}:
			p4 = 0
		else:
			max4 = max(dic2, key=dic2.get)
			p4 = dic2[max4]
		if p1 + p4 > p2 + p3:
			p2 = p4
		else:
			p1 = p3
	
	print(n-p1-p2)
l=[2,1]
for i in range(85):
    l.append(l[-1]+l[-2])
n=int(input

### FIXED CODE ###

l=[2,1]
for i in range(85):
    l.append(l[-1]+l[-2])
n=int(input())
print(l[n])
n,k = map(int, input().split())
*a, = map(int, input().split())
ans = 0
wer = 0

for i in range(n-1):
  for j in range(i, n):
  	if a[i] > a[j]:
      ans += 1
ans *= k

for i in range(n):
  for j in range(n):
    if a[i] > a[j]:
      wer += k-1
wer *= k*(k-1)//2

ans += wer
ans %= 10**9 + 7
  
print(ans)

### FIXED CODE ###

n,k = map(int, input().split())
*a, = map(int, input().split())
ans = 0
wer = 0

for i in range(n-1):
  for j in range(i+1, n):
    if a[i] > a[j]:
      ans += 1
ans *= k

for i in range(n):
  for j in range(n):
    if a[i] > a[j]:
      wer += 1
wer *= k*(k-1)//2

ans += wer
ans %= 10**9 + 7
  
print(ans)
class MyClass:
    patternCount = 0

    def skip(self, maxNum, currentIndex):
        if currentIndex > maxNum or currentIndex in brokenIndexList:
            return
        
        if maxNum == currentIndex:
            self.patternCount += 1
            return

        self.skip(maxNum, currentIndex + 1)
        self.skip(maxNum, currentIndex + 2)

maxNum, brokenCount= map(int, input().split())

brokenIndexList = []
for i in range(brokenCount):
    brokenIndexList.append(int(input()))

if maxNum == 0:
    print(0)

c = MyClass()
c.skip(maxNum, 0)

print(c.patternCount)



### FIXED CODE ###

maxNum, brokenCount= map(int, input().split())

brokenIndexSet= set([int(input()) for i in range(brokenCount)])

ans = [0]*(maxNum + 1)
ans[0] = 1

#print(ans[-1])

for i in range(1, maxNum + 1):
    if i in brokenIndexSet:
        ans[i] = 0
    else:
        ans[i] = (ans[i - 1] + ans[i - 2]) % 1000000007 

print(ans[maxNum])
while 1:
	e = input()
	if e == 0: break
	ans = 3*e
	for z in range(e+1):
		z3 = z**3
		if z3 > e: break
		for y in range(e+1):
			y2 = y**2
			x = e - y2 - z3
			if x >= 0:
				ans = min(ans,x+y+z)
			else:
				break
	print ans

### FIXED CODE ###

while 1:
	e = ans = input()
	if e == 0: break
	for z in range(e):
		z3 = z**3
		if z3 > e: break
		y = int((e-z3)**0.5)
		ans = min(ans,e+y+z-y**2-z3)
	print ans
a,b=map(int,input().split())
n=[1,2,3]
n.remove(a)
n.remove(b)
print(n[0])

### FIXED CODE ###

a=int(input())
b=int(input())
n=[1,2,3]
n.remove(a)
n.remove(b)
print(n[0])
# -*- coding: utf-8 -*-
# 整数の入力
# from functools import reduce
from collections import defaultdict


def main():
    # n, q
    n, q = map(int, input().split())

    trees = [[] for i in range(n+1)]
    # a, b
    for _ in range(0, n - 1):
        a, b = map(int, input().split())
        trees[a].append(b)
        trees[b].append(a)

    values = [0 for i in range(n+1)]
    # p, x
    for _ in range(0, q):
        p, x = map(int, input().split())
        values[p] += x
    process(1, -1, trees, values)
    print(*values[1:])


def process(i, parent, trees, values):
    for j in trees[i]:
        if j == parent:
            continue
        values[j] += values[i]
        process(j, i, trees, values)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
# from functools import reduce
import sys
from collections import defaultdict

sys.setrecursionlimit(1000000)


def main():
    # n, q
    n, q = map(int, input().split())

    trees = [[] for i in range(n+1)]
    # a, b
    for _ in range(0, n - 1):
        a, b = map(int, input().split())
        trees[a].append(b)
        trees[b].append(a)

    values = [0 for i in range(n+1)]
    # p, x
    for _ in range(0, q):
        p, x = map(int, input().split())
        values[p] += x
    process(1, -1, trees, values)
    print(*values[1:])


def process(i, parent, trees, values):
    for j in trees[i]:
        if j == parent:
            continue
        values[j] += values[i]
        process(j, i, trees, values)


if __name__ == "__main__":
    main()
S = input()

check = True
for i, s in enumerate(S):
  if (i+1)%2 == 0:
    if not(s == "L" or s == "U" or s == "D"):
      check = False
  else:
    if not(s == "R" or s == "U" or s ="D"):
      check = False

if check:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()

check = True
for i, s in enumerate(S):
  if (i+1)%2 == 0:
    if not(s == "L" or s == "U" or s == "D"):
      check = False
  else:
    if not(s == "R" or s == "U" or s == "D"):
      check = False

if check:
  print("Yes")
else:
  print("No")