def b1():
    global b1_ctr
    if b1_ctr%3 == 0:
        b1_ctr+=1
        b2()
    elif b1_ctr%3 == 1:
        b1_ctr+=1
        b3()
    elif b1_ctr%3 == 2:
        b1_ctr+=1
        b4()

def b2():
    global b2_ctr
    if b2_ctr%2 == 0:
        b2_ctr+=1
        b5()
    elif b2_ctr%2 == 1:
        b2_ctr+=1
        b6()

def b3():
    global b3_ctr
    if b3_ctr%3 == 0:
        b3_ctr+=1
        b2()
    elif b3_ctr%3 == 1:
        b3_ctr+=1
        b5()
    elif b3_ctr%3 == 2:
        b3_ctr+=1
        b6()

def b4():
    global b4_ctr
    if b4_ctr%2 == 0:
        b4_ctr+=1
        b3()
    elif b4_ctr%2 == 1:
        b4_ctr+=1
        b6()

def b5():
    global b5_ctr
    if b5_ctr%2 == 0:
        b5_ctr+=1
        print("R", end='')
    elif b5_ctr%2 == 1:
        b5_ctr+=1
        print("E", end='')

def b6():
    global b6_ctr
    if b6_ctr%3 == 0:
        b6_ctr+=1
        b5()
    elif b6_ctr%3 == 1:
        b6_ctr+=1
        print("G", end='')
    elif b6_ctr%3 == 2:
        b6_ctr+=1
        b4()

b1_ctr = 0
b2_ctr = 0
b3_ctr = 0
b4_ctr = 0
b5_ctr = 0
b6_ctr = 0
for i in range(100):
    b1()
