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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

e = A("e")
a = B("a")
f = C("f")
l = D("l")

e.o = f
e.w = f
e.v = a
a.x = l
f.t = e
l.z = f
assert f.t.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

e = A("e")
a = B("a")
f = C("f")
l = D("l")

e.o = f
e.w = f
e.v = a
a.x = l
f.t = e
l.z = f
assert f.t.v.x.txt == "l"