class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

e.p = i
a.o = e
a.z = l
a.s = i
l.w = i
i.p = e
i.o = l
assert a.z.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: C = None
        self.txt = txt

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

e.p = i
a.o = e
a.z = l
a.s = i
l.w = i
i.p = e
i.o = l
assert a.z.w.o.txt == "l"