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

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

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

b = A("b")
i = B("i")
n = C("n")
j = A("j")
g = C("g")
m = C("m")
h = A("h")
l = A("l")

b.x = n
b.z = i
i.t = h
n.v = i
n.r = m
n.s = m
j.x = g
j.z = i
g.v = i
g.r = m
g.s = n
m.v = i
m.r = g
m.s = n
h.x = g
h.z = i
l.x = m
l.z = i
assert l.z.t.x.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: B = None
        self.txt = txt

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

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

b = A("b")
i = B("i")
n = C("n")
j = A("j")
g = C("g")
m = C("m")
h = A("h")
l = A("l")

b.x = n
b.z = i
i.t = h
n.v = i
n.r = m
n.s = m
j.x = g
j.z = i
g.v = i
g.r = m
g.s = n
m.v = i
m.r = g
m.s = n
h.x = g
h.z = i
l.x = m
l.z = i
assert l.z.t.x.s.v.txt == "i"