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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: D = None
        self.p: A = 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.o: A = None
        self.y: C = None
        self.txt = txt

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

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

l.p = m
l.z = d
e.w = m
e.q = i
e.p = l
m.u = c
i.o = l
i.y = m
d.u = a
d.w = m
d.t = e
d.p = b
c.p = m
c.z = d
b.w = a
b.q = f
b.p = l
f.o = l
f.y = a
k.p = m
k.z = d
a.u = c
assert e.w.u.z.w.u.z.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: D = None
        self.p: A = 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.o: A = None
        self.y: C = None
        self.txt = txt

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

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

l.p = m
l.z = d
e.w = m
e.q = i
e.p = l
m.u = c
i.o = l
i.y = m
d.u = a
d.w = m
d.t = e
d.p = b
c.p = m
c.z = d
b.w = a
b.q = f
b.p = l
f.o = l
f.y = a
k.p = m
k.z = d
a.u = c
assert e.w.u.z.w.u.z.t.w.txt == "m"