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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: D = None
        self.t: E = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

e = A("e")
l = B("l")
c = C("c")
b = D("b")
f = E("f")
h = E("h")
m = B("m")

e.t = l
e.w = b
e.r = b
l.q = f
l.r = h
c.z = f
b.u = c
b.w = l
f.z = h
f.t = h
f.q = b
f.s = b
f.w = m
h.z = f
h.t = f
h.q = b
h.s = b
h.w = l
m.q = h
m.r = h
assert c.z.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: D = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: D = None
        self.t: E = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

e = A("e")
l = B("l")
c = C("c")
b = D("b")
f = E("f")
h = E("h")
m = B("m")

e.t = l
e.w = b
e.r = b
l.q = f
l.r = h
c.z = f
b.u = c
b.w = l
f.z = h
f.t = h
f.q = b
f.s = b
f.w = m
h.z = f
h.t = f
h.q = b
h.s = b
h.w = l
m.q = h
m.r = h
assert c.z.q.u.txt == "c"