Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
    I = input().split()
     
    K = int(I[0])
    A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    print( A[K-1] )

Fixed submission:
I = input().split()
         
K = int(I[0])
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print( A[K-1] )

Buggy python submission (verdict: Runtime Error):
I = input().split()

K = int(I[0])
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print( A[K] )


Fixed submission:
I = input().split()
         
K = int(I[0])
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print( A[K-1] )

Buggy python submission (verdict: Runtime Error):
chars = ['a','b','c','d','e','f','g','h','i','j']
length = int(input())
def cals(words, num, length):
  work = words
  for val in range(0, length):
    temp = work + chars[val]
    if num + 1 == length:
      print(temp)
    else:
      cals(temp, num + 1, length)
      break
cals('',0 , length)
  

Fixed submission:
nums = [0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[int(input())])

Buggy python submission (verdict: Runtime Error):
value = input().split()
rows = int(value[0])
colmuns = int(value[1])
OddColNum = colmuns // 2 
EvenColNum = OddColNum
if (colmuns % 2) != 0:
  OddColNum = OddColNum + 1
if (colmuns == 1):
  OddColNum = 1

OddRowCount = rows // 2
EvenRowCount = rows // 2
if (OddRowCount % 2) != 0 and rows != 1:
  OddRowCount = OddRowCount + 1
if (rows == 1):
  OddRowCount = 1

print(OddColNum)
print(EvenColNum)
print(OddRowCount)
print(EvenRowCount)
counts = OddRowCount * OddColNum + EvenColNum * EvenRowCount
print(counts)

Fixed submission:
nums = [0, 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(nums[int(input())])
Buggy python submission (verdict: Runtime Error):
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))
colorsCount = counts[0]
hotsCount = counts[1]
ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = max(colors)
max_color_idx = colors.index(max_color)
max_hots = max(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
  
print(str(minPrice))

Fixed submission:
import re

pattern = '(hi)+'
compiled = re.compile(pattern)
input_value = input()
result = compiled.match(input_value)
if result == None:
  print('No')
elif result.group() == input_value:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))
colorsCount = counts[0]
hotsCount = counts[1]
ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = max(colors)
max_color_idx = colors.index(max_color)
max_hots = max(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
print(str(minPrice))

Fixed submission:
import re

pattern = '(hi)+'
compiled = re.compile(pattern)
input_value = input()
result = compiled.match(input_value)
if result == None:
  print('No')
elif result.group() == input_value:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def disscount(disscounts,x,y):
  minDisscounts = 0
  for i in disscounts:
    if int(i[0]) == x and int(i[1]) == y:
      if minDisscounts < int(i[2]):
        minDisscounts = int(i[2])
  return minDisscounts

counts = input().split()
colors = input().split()
hots = input().split()
disscounts = []
for i in range(int(counts[2])):
  disscounts.append(input().split())

minPrice = sys.maxsize
for i in range(0, len(colors)):
  for j in range(0, len(hots)):
    colorPrice = int(colors[i])
    hotPrice = int(hots[j])
    price = colorPrice + hotPrice - disscount(disscounts, i + 1 , j + 1)
    if price < minPrice:
      minPrice = price
print(str(minPrice))

Fixed submission:
import sys

counts = list(map(int,input().split()))
colors = list(map(int,input().split()))
hots = list(map(int,input().split()))

ticketCount = counts[2]

minPrice = sys.maxsize
# first. get disscount consider price
for i in range(ticketCount):
  values = input().split()
  x = int(values[0])
  y = int(values[1])
  dissPrice = int(values[2])
  colorPrice = colors[x-1]
  hotsPrice = hots[y-1]
  validPrice =  colorPrice + hotsPrice - dissPrice
  if minPrice > validPrice:
    minPrice = validPrice

max_color = min(colors)
max_color_idx = colors.index(max_color)
max_hots = min(hots)
max_hots_idx = hots.index(max_hots)
validPrice = max_color + max_hots
if minPrice > validPrice:
  minPrice = validPrice
print(str(minPrice))
Buggy python submission (verdict: Time Limit Exceeded):
import math
import sys
input = sys.stdin.readline

s = input().strip()
t = ''
for i in range(len(s)):
	if s[i] == '?':
		t += 'D'
	else: 
		t += s[i]
print(t)

Fixed submission:
import math
import sys
input = sys.stdin.readline

s = input().strip()
ans = []
for i in s:
	if i == '?':
		ans.append('D')
	else:
		ans.append(i)
print(''.join(ans))
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())

if n == 1:
    print("Hello World")
if n == 2:
    print(A + B)


Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")
if n == 2:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())
if n == 1:
    print("Hello World")
elif n == 2:
    print(A + B)


Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")
if n == 2:
    a = int(input())
    b = int(input())
    print(a + b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
A = int(input())
B = int(input())
if n == 1:
    print("Hello World")
else:
    print(A + B)


Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")
if n == 2:
    a = int(input())
    b = int(input())
    print(a + b)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
if  abs(c-a) =< d:
	print("Yes")
elif abs(a-b) =< d and abs(b-c) =< d:
	print("Yes")
else:
	print("No")

Fixed submission:
a, b, c, d = map(int, input().split())
if  abs(c-a) <= d:
	print("Yes")
elif abs(a-b) <= d and abs(b-c) <= d:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
n = input()
for i in n:
    a = list(map(int,input().split()))
a.sort(reverse = True)
print(sum(a[0::2]) - sum(a[1::2]))



Fixed submission:
input()
a = list(map(int,input().split()))
a.sort(reverse = True)
print(sum(a[0::2]) - sum(a[1::2]))

Buggy python submission (verdict: Runtime Error):
n = input()
for i in n:
    a = list(map(int,input().split()))
a.sort(reverse = True)
Bob = sum(a[1::2])
Alice = sum(a[0::2])
print(Alice - Bob)



Fixed submission:
input()
a = list(map(int,input().split()))
a.sort(reverse = True)
print(sum(a[0::2]) - sum(a[1::2]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
count = 0
A = [int(x) for x in input().split()]
while all(i % 2 == 0 for i in A):
    A = [i/2 for i in A]
    count += 1
print(count)

Fixed submission:
s1 = input()
print(s1.count('1'))

Buggy python submission (verdict: Runtime Error):
s1,s2,s3 = map(int,input().split())
l = []
l += [s1,s2,s3]
print(l.count(1))

Fixed submission:
s1 = input()
print(s1.count('1'))
Buggy python submission (verdict: Runtime Error):
price = int(input()).split()
if  price > B:
  print(B)
else:
  print(N * A)


Fixed submission:
price =input().split()
if int(price[0]) *  int(price[1]) > int(price[2]) :
	print(int(price[2]))
else :
	print(int(price[0]) * int(price[1]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if  price > B:
  print(B)
else:
  print(N * A)


Fixed submission:
price =input().split()
if int(price[0]) *  int(price[1]) > int(price[2]) :
	print(int(price[2]))
else :
	print(int(price[0]) * int(price[1]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
price = N * A
if  price > B:
  print(B)
else:
  print(price)

Fixed submission:
price =input().split()
if int(price[0]) *  int(price[1]) > int(price[2]) :
	print(int(price[2]))
else :
	print(int(price[0]) * int(price[1]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
price = N * A
if  price > B:
  print(B)
else:
  print(price)

Fixed submission:
price =input().split()
if int(price[0]) *  int(price[1]) > int(price[2]) :
	print(int(price[2]))
else :
	print(int(price[0]) * int(price[1]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
price =N * A
if  price > B:
  print(B)
else:
  print(price)

Fixed submission:
price =input().split()
if int(price[0]) *  int(price[1]) > int(price[2]) :
	print(int(price[2]))
else :
	print(int(price[0]) * int(price[1]))
Buggy python submission (verdict: Runtime Error):
a = int(input())
if "9" in a:
  print("Yes")
else :
  print("NO")

Fixed submission:
a = input()
if "9" in a:
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Runtime Error):
S = input()
for i in range(len(S) -1,-1,-1):
  if i % 2 != 0:
    continue
  if s[:i // 2] == s[i // 2:i]:
    print(i)
    break



Fixed submission:
s = input()

for l in range(len(s) -1, 1, -1):
    if l % 2 != 0:
        continue
    if s[:l // 2] == s[l // 2:l]:
        print(l)
        break
Buggy python submission (verdict: Runtime Error):
N = int(input())
T = list(map(int,input().split()))
M = int(input())
P,X  = [],[]
for i in range(M):
	p,x = map(int,input().split())
	P.append(p - 1)
	X.append(x)
sumA = sum(T)
for lack in range(M):
	print(T + X[i] + T[P[i]] )

Fixed submission:
n = int(input())
t = list(map(int,input().split()))
sumt = sum(t)
m = int(input())
l = []
for i in range(m):
    p, x = map(int,input().split())
    a = sum(t)+x-t[p-1]
    l.append(a)
for o in l:
    print(o)
Buggy python submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
for i in range(H):
    C = input()
    print(C)
    print(C)



Fixed submission:
text = input()
list1 = ['a','e','i','o','u']
if text in list1:
	print("vowel")
else:
	print("consonant")
Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
count = 0
for i in range(a ,b + 1):
    if i % x == 0:
        count += 1
    else:
        continue
print(count)



Fixed submission:
a,b,x = map(int,input().split())
print(b // x - (a - 1) // x)
Buggy python submission (verdict: Time Limit Exceeded):
#coding: UTF-8

if __name__ == "__main__":
    N = int(input())

    fruits = []

    for i in range(N):
        fruits.append(input())

    count = 0
    fruitsCount = []
    fruitsCount.append(fruits[0])


    for f in fruits:
        if f in fruitsCount:
            count = count + 1
        else:
            fruitsCount.append(f)

    print(len(fruitsCount))

Fixed submission:
#coding: UTF-8

if __name__ == "__main__":
    N = int(input())

    fruits = []

    for i in range(N):
        fruits.append(input())

    print(len(set(fruits)))
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print((b-a-1)*(b-a)/2-a)

Fixed submission:
a=int(input())
if (a>999):
    print('ABD')
else:
    print('ABC')

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print((b-a-1)*(b-a)//2-a)

Fixed submission:
a=int(input())
if (a>999):
    print('ABD')
else:
    print('ABC')

Buggy python submission (verdict: Runtime Error):
a=input()
if a>999:
    print('ABD')
else:
    print('ABC')

Fixed submission:
a=int(input())
if (a>999):
    print('ABD')
else:
    print('ABC')
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
sum=0
cnt=0
while(cnt<b-a):
    cnt+=1
    l+=cnt
print(l-b)

Fixed submission:
a,b = map(int,input().split())
sum=0
cnt=0
while(cnt<b-a):
    cnt+=1
    sum+=cnt
print(sum-b)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print((b-a-1)*(b-a)//2-a)

Fixed submission:
a,b = map(int,input().split())
sum=0
cnt=0
while(cnt<b-a):
    cnt+=1
    sum+=cnt
print(sum-b)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print((b-a-1)*(b-a)//2-a)

Fixed submission:
a,b = map(int,input().split())
sum=0
cnt=0
while(cnt<b-a):
    cnt+=1
    sum+=cnt
print(sum-b)
Buggy python submission (verdict: Runtime Error):
s = input()
if len(s) >= 4 && s[:4] == "YAKI":
    print("Yes")
else:
    print("No");


Fixed submission:
s = input()
if len(s) >= 4 and s[:4] == "YAKI":
    print("Yes")
else:
    print("No");
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
A=list(map(int,input().split()))
a=1

for i in range(K):
  a=a*A[i]
  
for j in range(N-K):
  b=a*A[K+j]//A[j]
  
  if (a < b ):
    print("Yes")
    a=b
    continue
  else:
    print("No")
    a=b
    continue
    

Fixed submission:
N,K=map(int,input().split())
A=list(map(int,input().split()))

for i in range(K,N):
  if (A[i] <= A[i-K] ):
    print("No")
    continue
  else:
    print("Yes")
    continue
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
b=0
c=N//2

for i in range(c+1):
  if (a[2*i] %2 !=0):
    b +=1

print(b)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
b=0

if (N%2 == 0):
  c=N//2
else:
  c=N//2 + 1

for i in range(c):
  if (a[2*i] %2 !=0):
    b +=1

print(b)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
def main():
    h, w = map(int, raw_input().split())
    s = [raw_input().strip() for _ in xrange(h)]
    q = deque()
    a = [100000] * (h * w)
    for i, r in enumerate(s):
        for j, c in enumerate(r):
            if c == '#':
                q.append((i, j))
                a[i*w+j] = 0
    dd = ((0, -1), (0, 1), (1, 0), (-1, 0))
    while q:
        x, y = q.popleft()
        z = a[x*w+y] + 1
        for dx, dy in dd:
            nx, ny = x + dx, y + dy
            if 0 <= nx < h and 0 <= ny < w and a[nx*w+ny] > z:
                a[nx*w+ny] = z
                q.append((nx, ny))
    print max(a)
main()


Fixed submission:
from collections import deque
def main():
    h, w = map(int, raw_input().split())
    s = [raw_input().strip() for _ in xrange(h)]
    q = deque()
    po = q.popleft
    pu = q.append
    a = [100000] * (h * w)
    for i, r in enumerate(s):
        for j, c in enumerate(r):
            if c == '#':
                pu((i, j))
                a[i*w+j] = 0
    dd = ((0, -1), (0, 1), (1, 0), (-1, 0))
    while q:
        x, y = po()
        z = a[x*w+y] + 1
        for dx, dy in dd:
            nx, ny = x + dx, y + dy
            if 0 <= nx < h and 0 <= ny < w and a[nx*w+ny] > z:
                a[nx*w+ny] = z
                pu((nx, ny))
    print z - 1
main()
Buggy python submission (verdict: Runtime Error):
from sys import stdin
def main():
    n = int(stdin.readline())
    e = [[] for _ in xrange(n)]
    for line in stdin:
        x, y = map(int, line.split())
        x -= 1
        y -= 1
        e[x].append(y)
        e[y].append(x)
    d = [None] * n
    st = []
    pu = st.append
    po = st.pop
    pu(0)
    d[0] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    y = 0
    for i, x in enumerate(d):
        if y < x:
            y = x
            j = i
    d = [None] * n
    pu(j)
    d[j] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    x = max(d)
    print 'Second' if x % 3 == 1 else 'First'
main()


Fixed submission:
from sys import stdin
def main():
    n = int(stdin.readline())
    e = [[] for _ in xrange(n)]
    for line in stdin:
        x, y = map(int, line.split())
        x -= 1
        y -= 1
        e[x].append(y)
        e[y].append(x)
    d = [None] * n
    st = []
    pu = st.append
    po = st.pop
    pu(0)
    d[0] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    y = -1
    for i, x in enumerate(d):
        if y < x:
            y = x
            j = i
    d = [None] * n
    pu(j)
    d[j] = 0
    while st:
        x = po()
        for y in e[x]:
            if d[y] is None:
                d[y] = d[x] + 1
                pu(y)
    x = max(d)
    print 'Second' if x % 3 == 1 else 'First'
main()
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin.readline().split())
    w = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 3 * m))
    e = [(dat[i*3+2], dat[i*3] - 1, dat[i*3+1] - 1) for i in xrange(m)]
    e.sort()
    p = range(n)
    ok = [0] * n
    h = [None] * n
    g = [None] * m
    st = []
    pu = st.append
    for i, z in enumerate(e):
        c, u, v = z
        x = u
        while x != p[x]:
            pu(x)
            x = p[x]
        pu(x)
        t = x
        x = v
        while x != p[x]:
            pu(x)
            x = p[x]
        for y in st:
            p[y] = x
        del st[:]
        if x != t:
            w[x] += w[t]
            if w[x] >= c:
                ok[i] = 1
            g[i] = (h[x], h[t])
            h[x] = i
        elif w[x] >= c:
            ok[i] = 1
            g[i] = (h[x],)
            h[x] = i
    d = [0] * m
    po = st.pop
    for i in xrange(m - 1, -1, -1):
        if d[i]:
            continue
        pu(i)
        while st:
            x = po()
            d[x] = 1
            if g[x] is None:
                continue
            for y in g[x]:
                if y is not None:
                    ok[y] |= ok[x]
                    pu(y)
    print m - sum(ok)
main()


Fixed submission:
from sys import stdin
from itertools import repeat
def main():
    n, m = map(int, stdin.readline().split())
    w = map(int, stdin.readline().split())
    dat = map(int, stdin.read().split(), repeat(10, 3 * m))
    e = [(dat[i*3+2], dat[i*3] - 1, dat[i*3+1] - 1) for i in xrange(m)]
    e.sort()
    p = range(n)
    ok = [0] * m
    h = [None] * n
    g = [tuple() for i in xrange(m)]
    st = []
    pu = st.append
    for i, z in enumerate(e):
        c, u, v = z
        x = u
        while x != p[x]:
            pu(x)
            x = p[x]
        pu(x)
        t = x
        x = v
        while x != p[x]:
            pu(x)
            x = p[x]
        for y in st:
            p[y] = x
        del st[:]
        if x != t:
            w[x] += w[t]
            if w[x] >= c:
                ok[i] = 1
            g[i] = (h[x], h[t])
            h[x] = i
        else:
            if w[x] >= c:
                ok[i] = 1
            g[i] = (h[x],)
            h[x] = i
    d = [0] * m
    po = st.pop
    for i in xrange(m - 1, -1, -1):
        if d[i]:
            continue
        pu(i)
        while st:
            x = po()
            d[x] = 1
            for y in g[x]:
                if y is not None:
                    ok[y] |= ok[x]
                    pu(y)
    print m - sum(ok)
main()
Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from collections import deque
n = int(raw_input())
q = deque()
x = 2
s = 0
for i in xrange(n - 1):
    for j in xrange(x, 30001):
        if j % 2 == 0 or j % 3 == 0 or j % 5 == 0:
            q.append(j)
            x = j + 1
            s += j
            break
while 1:
    for j in xrange(x, 30001):
        if (s + j) % 30 == 0 and gcd(s, j) != 1:
            q.append(j)
            break
    else:
        for i in xrange(x, 30001):
            if j % 2 == 0 or j % 3 == 0 or j % 5 == 0:
                q.append(j)
                s -= q.popleft()
                x = j + 1
                s += j
                break
        continue
    break
while q:
    print q.popleft(),


Fixed submission:
from fractions import gcd
from collections import deque
n = int(raw_input())
q = deque()
x = 2
s = 0
for i in xrange(n - 1):
    for j in xrange(x, 30001):
        if j % 2 == 0 or j % 3 == 0 or j % 5 == 0:
            q.append(j)
            x = j + 1
            s += j
            break
while 1:
    for j in xrange(x, 30001):
        if (s + j) % 30 == 0 and gcd(s, j) != 1:
            q.append(j)
            break
    else:
        for j in xrange(x, 30001):
            if j % 2 == 0 or j % 3 == 0 or j % 5 == 0:
                q.append(j)
                s -= q.popleft()
                x = j + 1
                s += j
                break
        continue
    break
while q:
    print q.popleft(),
Buggy python submission (verdict: Runtime Error):
h, w, k = map(int, raw_input().split())
b = [[0] * w for i in xrange(h)]
c = "YGBR"
for i in xrange(h):
    for j in xrange(w):
        b[i][j] = c[(i+j)/k%2+(i-j)/k%2*2]
    print "".join(b[i])


Fixed submission:
print "Yes" if raw_input().startswith("YAKI") else "No"
Buggy python submission (verdict: Runtime Error):
h, w, k = map(int, raw_input().split())
b = [[0] * w for i in xrange(w)]
c = "YGBR"
for i in xrange(h):
    for j in xrange(w):
        b[i][j] = c[(i+j)/k%2+(i-j)/k%2*2]
    print "".join(b[i])


Fixed submission:
h, w, k = map(int, raw_input().split())
b = [[0] * w for i in xrange(h)]
c = "YGBR"
for i in xrange(h):
    for j in xrange(w):
        b[i][j] = c[(i+j)/k%2+(i-j)/k%2*2]
    print "".join(b[i])