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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: B = None
        self.x: A = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
l = C("l")
h = D("h")
d = E("d")
f = A("f")
e = D("e")
i = B("i")
m = E("m")
n = E("n")

k.z = i
k.q = f
k.w = e
k.v = m
a.r = l
l.r = n
l.w = a
l.x = k
l.t = k
l.u = d
h.v = i
d.t = h
d.p = e
f.z = a
f.q = k
f.w = h
f.v = n
e.v = i
i.r = l
m.t = h
m.p = e
n.t = e
n.p = e
assert k.z.r.u.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: A = None
        self.w: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: B = None
        self.x: A = None
        self.t: A = None
        self.u: E = None
        self.txt = txt

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

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

k = A("k")
a = B("a")
l = C("l")
h = D("h")
d = E("d")
f = A("f")
e = D("e")
i = B("i")
m = E("m")
n = E("n")

k.z = i
k.q = f
k.w = e
k.v = m
a.r = l
l.r = n
l.w = a
l.x = k
l.t = k
l.u = d
h.v = i
d.t = h
d.p = e
f.z = a
f.q = k
f.w = h
f.v = n
e.v = i
i.r = l
m.t = h
m.p = e
n.t = e
n.p = e
assert k.z.r.u.t.v.txt == "i"