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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.t: A = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

c.w = g
g.s = d
l.w = c
l.o = g
j.w = g
j.u = l
j.t = l
j.s = c
j.q = c
d.o = g
d.r = j
d.z = j
d.u = j
d.t = c
a.w = g
assert a.w.s.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: D = None
        self.t: A = None
        self.z: D = None
        self.u: D = None
        self.txt = txt

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

c.w = g
g.s = d
l.w = c
l.o = g
j.w = g
j.u = l
j.t = l
j.s = c
j.q = c
d.o = g
d.r = j
d.z = j
d.u = j
d.t = c
a.w = g
assert a.w.s.z.w.txt == "g"