class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.x: D = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

h = A("h")
l = B("l")
d = C("d")
k = D("k")
b = E("b")

h.t = k
h.x = k
h.o = k
h.z = d
h.q = b
l.u = k
d.t = l
d.u = l
d.o = l
d.y = b
d.x = h
k.q = b
k.z = b
k.x = d
b.s = k
b.o = h
b.y = d
assert d.t.u.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.z: C = None
        self.x: D = None
        self.o: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

h = A("h")
l = B("l")
d = C("d")
k = D("k")
b = E("b")

h.t = k
h.x = k
h.o = k
h.z = d
h.q = b
l.u = k
d.t = l
d.u = l
d.o = l
d.y = b
d.x = h
k.q = b
k.z = b
k.x = d
b.s = k
b.o = h
b.y = d
assert d.t.u.x.t.txt == "l"