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

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

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

n = A("n")
e = B("e")
d = C("d")
l = A("l")

n.p = e
n.s = d
e.v = d
e.o = d
d.u = e
l.p = e
l.s = d
assert e.v.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.txt = txt

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

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

n = A("n")
e = B("e")
d = C("d")
l = A("l")

n.p = e
n.s = d
e.v = d
e.o = d
d.u = e
l.p = e
l.s = d
assert e.v.u.o.u.txt == "e"