class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: C = None
        self.u: B = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: C = None
        self.u: A = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

h = A("h")
m = B("m")
f = C("f")
l = D("l")
a = E("a")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: C = None
        self.u: A = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.txt = txt

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

h = A("h")
m = B("m")
f = C("f")
l = D("l")
a = E("a")

h.t = l
h.q = l
h.y = f
h.u = m
m.x = l
m.y = l
m.s = f
m.u = h
m.q = h
f.y = a
l.x = h
l.o = h
a.y = h
a.z = m
a.s = l
assert a.s.x.u.s.txt == "f"