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

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

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

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

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

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

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

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

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

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

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

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

e.r = c
g.v = m
g.y = c
m.u = e
m.z = g
b.o = l
b.r = m
i.t = g
k.o = e
k.r = m
c.t = g
a.o = l
a.r = m
l.r = c
d.t = g
assert m.u.r.t.v.z.y.t.y.txt == "c"