class A:
    def __init__(self, txt: str):
        self.z: 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.s: B = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

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

e = A("e")
m = B("m")
l = C("l")
n = D("n")

e.z = l
m.x = n
l.s = m
l.o = e
l.u = n
n.z = l
assert n.z.s.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: 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.s: B = None
        self.o: A = None
        self.u: D = None
        self.txt = txt

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

e = A("e")
m = B("m")
l = C("l")
n = D("n")

e.z = l
m.x = n
l.s = m
l.o = e
l.u = n
n.z = l
assert n.z.s.x.z.txt == "l"