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

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

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

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

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

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

e.t = i
e.y = a
e.r = m
e.o = k
e.v = c
a.p = i
i.t = d
c.y = a
k.y = i
k.w = a
d.y = a
m.y = a
assert d.y.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: B = None
        self.r: D = None
        self.o: E = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

e.t = i
e.y = a
e.r = m
e.o = k
e.v = c
a.p = i
i.t = d
c.y = a
k.y = i
k.w = a
d.y = a
m.y = a
assert d.y.p.t.txt == "d"