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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.p: D = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

d = A("d")
k = B("k")
h = C("h")
m = D("m")
i = E("i")
c = A("c")

d.v = k
d.s = k
d.x = k
d.y = i
k.y = i
k.w = i
k.q = m
k.r = m
k.u = c
h.t = m
h.z = m
h.s = m
h.p = k
h.y = i
m.w = i
m.x = h
i.r = k
i.x = k
i.u = k
i.p = m
i.q = c
c.v = k
c.s = k
c.x = k
c.y = i
assert k.q.x.z.w.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.p: D = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

d = A("d")
k = B("k")
h = C("h")
m = D("m")
i = E("i")
c = A("c")

d.v = k
d.s = k
d.x = k
d.y = i
k.y = i
k.w = i
k.q = m
k.r = m
k.u = c
h.t = m
h.z = m
h.s = m
h.p = k
h.y = i
m.w = i
m.x = h
i.r = k
i.x = k
i.u = k
i.p = m
i.q = c
c.v = k
c.s = k
c.x = k
c.y = i
assert k.q.x.z.w.r.txt == "k"