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

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

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

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

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

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

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

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

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

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

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

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

m.s = e
f.x = h
f.p = e
h.u = m
i.x = k
i.t = e
e.u = f
e.o = k
e.t = b
e.p = b
b.x = k
b.t = e
k.u = d
k.o = e
k.t = i
k.p = b
d.x = h
d.p = k
c.u = m
assert h.u.s.o.p.t.o.p.txt == "b"