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

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

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

c = A("c")
f = B("f")
b = C("b")
a = B("a")
e = A("e")
l = C("l")
j = B("j")
i = B("i")
n = C("n")

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

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

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

c = A("c")
f = B("f")
b = C("b")
a = B("a")
e = A("e")
l = C("l")
j = B("j")
i = B("i")
n = C("n")

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