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

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

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

i = A("i")
n = B("n")
j = C("j")
a = B("a")
l = A("l")
c = A("c")

i.p = a
i.x = n
n.t = j
n.o = a
j.x = n
j.v = n
a.t = j
a.o = n
l.p = a
l.x = n
c.p = n
c.x = n
assert a.o.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.txt = txt

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

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

i = A("i")
n = B("n")
j = C("j")
a = B("a")
l = A("l")
c = A("c")

i.p = a
i.x = n
n.t = j
n.o = a
j.x = n
j.v = n
a.t = j
a.o = n
l.p = a
l.x = n
c.p = n
c.x = n
assert a.o.t.x.txt == "n"