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

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

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

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

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

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

a.y = n
a.o = e
a.u = e
a.z = m
m.o = n
l.r = e
l.z = m
e.y = m
n.y = a
n.o = e
n.u = e
n.z = m
assert m.o.y.y.u.y.txt == "m"