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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

h.o = f
h.t = l
h.q = b
h.y = d
a.t = f
a.p = h
a.u = h
a.v = b
a.s = l
l.z = a
l.t = h
f.r = d
f.s = h
f.w = a
d.r = h
b.t = f
b.p = h
b.u = h
b.v = a
b.s = l
assert l.z.p.y.r.o.s.txt == "h"