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

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

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

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

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

k = A("k")
a = B("a")
m = C("m")
d = D("d")
h = E("h")
b = D("b")
c = D("c")
f = E("f")
e = D("e")

k.u = a
k.t = f
a.s = m
a.r = m
a.x = e
a.o = k
m.w = f
d.y = m
d.p = k
d.u = c
h.p = m
h.s = k
h.y = a
b.y = m
b.p = k
b.u = d
c.y = m
c.p = k
c.u = e
f.p = m
f.s = k
f.y = a
e.y = m
e.p = k
e.u = b
assert d.p.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.txt = txt

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

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

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

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

k = A("k")
a = B("a")
m = C("m")
d = D("d")
h = E("h")
b = D("b")
c = D("c")
f = E("f")
e = D("e")

k.u = a
k.t = f
a.s = m
a.r = m
a.x = e
a.o = k
m.w = f
d.y = m
d.p = k
d.u = c
h.p = m
h.s = k
h.y = a
b.y = m
b.p = k
b.u = d
c.y = m
c.p = k
c.u = e
f.p = m
f.s = k
f.y = a
e.y = m
e.p = k
e.u = b
assert d.p.u.s.txt == "m"