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

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

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

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

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

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

h.o = i
h.t = e
i.t = c
i.o = l
c.x = l
l.z = k
e.u = k
e.w = c
e.z = c
e.s = c
k.t = c
k.o = l
b.t = c
b.o = l
n.o = b
n.t = e
f.o = b
f.t = e
assert f.t.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

h.o = i
h.t = e
i.t = c
i.o = l
c.x = l
l.z = k
e.u = k
e.w = c
e.z = c
e.s = c
k.t = c
k.o = l
b.t = c
b.o = l
n.o = b
n.t = e
f.o = b
f.t = e
assert f.t.z.x.txt == "l"