class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = 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.w: B = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

c = A("c")
h = B("h")
j = C("j")
k = B("k")
i = B("i")
n = B("n")
e = C("e")
d = B("d")

c.t = d
c.o = e
h.p = e
j.w = n
j.u = c
j.x = e
k.p = e
i.p = j
n.p = j
e.w = d
e.u = c
e.x = j
d.p = e
assert n.p.x.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = 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.w: B = None
        self.u: A = None
        self.x: C = None
        self.txt = txt

c = A("c")
h = B("h")
j = C("j")
k = B("k")
i = B("i")
n = B("n")
e = C("e")
d = B("d")

c.t = d
c.o = e
h.p = e
j.w = n
j.u = c
j.x = e
k.p = e
i.p = j
n.p = j
e.w = d
e.u = c
e.x = j
d.p = e
assert n.p.x.u.t.txt == "d"