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

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

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

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

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

h = A("h")
e = B("e")
l = C("l")
a = D("a")
b = E("b")
m = C("m")
d = E("d")

h.o = e
h.t = a
h.v = l
h.s = l
e.t = h
e.w = l
l.x = b
l.s = m
a.v = l
a.q = l
a.w = e
a.x = b
b.z = m
b.u = e
m.x = b
m.s = l
d.z = l
d.u = e
assert d.z.s.s.s.s.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.v: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

h = A("h")
e = B("e")
l = C("l")
a = D("a")
b = E("b")
m = C("m")
d = E("d")

h.o = e
h.t = a
h.v = l
h.s = l
e.t = h
e.w = l
l.x = b
l.s = m
a.v = l
a.q = l
a.w = e
a.x = b
b.z = m
b.u = e
m.x = b
m.s = l
d.z = l
d.u = e
assert d.z.s.s.s.s.s.x.txt == "b"