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

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

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

i = A("i")
f = B("f")
b = C("b")
e = A("e")
d = B("d")
j = C("j")
n = A("n")
k = B("k")

i.w = k
i.z = e
f.o = i
b.v = f
e.w = k
e.z = i
d.o = e
j.v = k
n.w = k
n.z = e
k.o = i
assert e.z.w.o.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: A = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
b = C("b")
e = A("e")
d = B("d")
j = C("j")
n = A("n")
k = B("k")

i.w = k
i.z = e
f.o = i
b.v = f
e.w = k
e.z = i
d.o = e
j.v = k
n.w = k
n.z = e
k.o = i
assert e.z.w.o.w.o.w.txt == "k"