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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.txt = txt

k = A("k")
b = B("b")
e = C("e")
d = D("d")
m = E("m")

k.y = d
k.u = d
k.z = d
k.q = m
k.t = m
b.w = k
b.v = d
e.q = k
e.w = d
d.x = m
m.s = e
m.p = d
assert d.x.p.x.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: E = None
        self.u: D = None
        self.z: D = None
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: D = None
        self.txt = txt

k = A("k")
b = B("b")
e = C("e")
d = D("d")
m = E("m")

k.y = d
k.u = d
k.z = d
k.q = m
k.t = m
b.w = k
b.v = d
e.q = k
e.w = d
d.x = m
m.s = e
m.p = d
assert d.x.p.x.s.q.txt == "k"