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

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

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

j = A("j")
h = B("h")
i = C("i")
e = C("e")
d = B("d")
g = B("g")
l = A("l")
b = B("b")

j.z = l
j.x = l
h.v = b
h.p = j
h.x = e
i.x = d
i.s = g
e.x = d
e.s = b
d.v = g
d.p = l
d.x = i
g.v = d
g.p = j
g.x = e
l.z = j
l.x = j
b.v = h
b.p = j
b.x = i
assert b.x.s.p.x.x.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: A = None
        self.txt = txt

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

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

j = A("j")
h = B("h")
i = C("i")
e = C("e")
d = B("d")
g = B("g")
l = A("l")
b = B("b")

j.z = l
j.x = l
h.v = b
h.p = j
h.x = e
i.x = d
i.s = g
e.x = d
e.s = b
d.v = g
d.p = l
d.x = i
g.v = d
g.p = j
g.x = e
l.z = j
l.x = j
b.v = h
b.p = j
b.x = i
assert b.x.s.p.x.x.z.z.z.txt == "l"