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

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

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

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

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

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

i.x = c
i.z = c
e.z = l
e.y = k
e.q = c
e.w = h
c.v = e
h.o = f
h.v = e
h.w = i
h.t = m
h.u = c
l.z = c
l.r = c
l.w = h
l.x = m
m.x = c
m.z = c
a.v = e
f.x = c
f.z = a
k.x = c
k.z = c
assert k.x.v.w.w.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

i.x = c
i.z = c
e.z = l
e.y = k
e.q = c
e.w = h
c.v = e
h.o = f
h.v = e
h.w = i
h.t = m
h.u = c
l.z = c
l.r = c
l.w = h
l.x = m
m.x = c
m.z = c
a.v = e
f.x = c
f.z = a
k.x = c
k.z = c
assert k.x.v.w.w.z.v.txt == "e"