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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.r: B = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: C = None
        self.r: B = None
        self.y: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

k.y = l
a.y = i
i.r = k
i.z = m
i.q = a
i.o = l
c.o = m
c.u = e
c.r = b
c.y = l
c.v = k
l.r = a
l.s = i
l.v = e
m.o = c
m.u = e
m.r = b
m.y = l
m.v = k
b.y = i
e.r = k
e.z = c
e.q = b
e.o = l
assert m.y.s.z.o.o.o.txt == "c"