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

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

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

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

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

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

e.p = i
i.o = c
l.r = c
l.s = i
l.v = k
c.t = k
c.y = e
c.p = i
k.x = i
k.o = i
assert l.v.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

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

e.p = i
i.o = c
l.r = c
l.s = i
l.v = k
c.t = k
c.y = e
c.p = i
k.x = i
k.o = i
assert l.v.x.o.txt == "c"