class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: C = None
        self.w: E = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.txt = txt

n = A("n")
c = B("c")
d = C("d")
a = D("a")
l = E("l")

n.t = c
n.s = l
c.u = a
c.y = d
c.s = d
c.w = l
c.v = n
d.u = l
a.z = l
l.v = n
l.u = d
assert n.t.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: C = None
        self.w: E = None
        self.v: A = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: C = None
        self.txt = txt

n = A("n")
c = B("c")
d = C("d")
a = D("a")
l = E("l")

n.t = c
n.s = l
c.u = a
c.y = d
c.s = d
c.w = l
c.v = n
d.u = l
a.z = l
l.v = n
l.u = d
assert n.t.s.u.txt == "l"