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

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

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

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

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

h = A("h")
l = B("l")
c = C("c")
k = D("k")
a = E("a")

h.z = l
h.p = l
h.w = l
h.u = a
h.q = k
l.t = a
c.v = a
c.o = a
c.z = h
c.r = h
c.x = h
k.z = c
k.y = l
k.w = h
k.r = h
a.o = c
a.v = c
a.u = l
assert l.t.u.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: E = None
        self.q: D = None
        self.p: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

h = A("h")
l = B("l")
c = C("c")
k = D("k")
a = E("a")

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