class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

j = A("j")
k = B("k")
i = A("i")
b = B("b")
f = B("f")
e = B("e")
l = A("l")
h = A("h")
n = B("n")
c = A("c")

j.r = b
j.o = k
k.w = b
i.r = f
i.o = f
b.w = f
f.w = k
e.w = k
l.r = e
l.o = n
h.r = b
h.o = b
n.w = k
c.r = f
c.o = n
assert l.o.w.w.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

j = A("j")
k = B("k")
i = A("i")
b = B("b")
f = B("f")
e = B("e")
l = A("l")
h = A("h")
n = B("n")
c = A("c")

j.r = b
j.o = k
k.w = b
i.r = f
i.o = f
b.w = f
f.w = k
e.w = k
l.r = e
l.o = n
h.r = b
h.o = b
n.w = k
c.r = f
c.o = n
assert l.o.w.w.w.w.w.w.w.w.txt == "b"