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

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

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

n = A("n")
f = B("f")
g = C("g")
h = C("h")
i = A("i")
d = C("d")
a = B("a")
b = C("b")
l = B("l")
e = C("e")

n.z = g
n.s = i
n.o = l
f.v = l
f.x = l
f.t = g
g.x = d
h.x = g
i.z = e
i.s = n
i.o = l
d.x = b
a.v = f
a.x = l
a.t = d
b.x = d
l.v = a
l.x = a
l.t = g
e.x = h
assert b.x.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: A = None
        self.o: B = None
        self.txt = txt

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

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

n = A("n")
f = B("f")
g = C("g")
h = C("h")
i = A("i")
d = C("d")
a = B("a")
b = C("b")
l = B("l")
e = C("e")

n.z = g
n.s = i
n.o = l
f.v = l
f.x = l
f.t = g
g.x = d
h.x = g
i.z = e
i.s = n
i.o = l
d.x = b
a.v = f
a.x = l
a.t = d
b.x = d
l.v = a
l.x = a
l.t = g
e.x = h
assert b.x.x.x.x.x.x.txt == "b"