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

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

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

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

j.t = d
j.w = i
l.y = i
l.s = i
l.u = k
c.x = n
k.x = c
i.t = l
i.w = j
d.y = j
d.s = i
d.u = k
n.x = k
assert j.t.s.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: A = None
        self.txt = txt

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

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

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

j.t = d
j.w = i
l.y = i
l.s = i
l.u = k
c.x = n
k.x = c
i.t = l
i.w = j
d.y = j
d.s = i
d.u = k
n.x = k
assert j.t.s.t.u.txt == "k"