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

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

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

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

e = A("e")
b = B("b")
c = C("c")
a = D("a")
n = D("n")

e.p = a
e.y = a
e.v = b
e.s = b
b.t = c
b.x = a
c.p = n
a.y = b
a.s = c
a.o = n
a.x = n
n.y = b
n.s = c
n.o = a
n.x = a
assert c.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: B = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

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

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

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

e = A("e")
b = B("b")
c = C("c")
a = D("a")
n = D("n")

e.p = a
e.y = a
e.v = b
e.s = b
b.t = c
b.x = a
c.p = n
a.y = b
a.s = c
a.o = n
a.x = n
n.y = b
n.s = c
n.o = a
n.x = a
assert c.p.s.p.txt == "n"