class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: E = None
        self.txt = txt

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

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

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