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

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

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

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

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

a = A("a")
i = B("i")
k = C("k")
e = D("e")
b = E("b")
f = A("f")
m = D("m")

a.s = b
i.u = b
k.t = f
k.r = e
k.s = i
e.o = i
e.t = i
e.z = b
e.u = b
b.z = k
b.x = i
b.y = e
f.s = b
m.o = i
m.t = i
m.z = b
m.u = b
assert m.z.z.r.o.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

a = A("a")
i = B("i")
k = C("k")
e = D("e")
b = E("b")
f = A("f")
m = D("m")

a.s = b
i.u = b
k.t = f
k.r = e
k.s = i
e.o = i
e.t = i
e.z = b
e.u = b
b.z = k
b.x = i
b.y = e
f.s = b
m.o = i
m.t = i
m.z = b
m.u = b
assert m.z.z.r.o.u.y.txt == "e"