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

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

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

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

j.t = e
k.x = l
k.v = l
i.q = j
d.q = j
l.q = j
c.x = l
c.v = d
e.x = l
e.v = d
h.x = d
h.v = d
f.x = d
f.v = l
n.x = l
n.v = l
assert n.v.q.t.v.q.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

j.t = e
k.x = l
k.v = l
i.q = j
d.q = j
l.q = j
c.x = l
c.v = d
e.x = l
e.v = d
h.x = d
h.v = d
f.x = d
f.v = l
n.x = l
n.v = l
assert n.v.q.t.v.q.t.x.txt == "l"