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

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

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

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

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

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

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

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

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

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

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

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

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