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

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

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

n = A("n")
e = B("e")
a = C("a")
i = C("i")
b = A("b")
j = C("j")
f = A("f")

n.s = f
e.v = n
e.t = n
e.z = j
a.o = n
a.z = n
i.o = b
i.z = f
b.s = n
j.o = f
j.z = b
f.s = n
assert e.v.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

n = A("n")
e = B("e")
a = C("a")
i = C("i")
b = A("b")
j = C("j")
f = A("f")

n.s = f
e.v = n
e.t = n
e.z = j
a.o = n
a.z = n
i.o = b
i.z = f
b.s = n
j.o = f
j.z = b
f.s = n
assert e.v.s.s.s.s.txt == "n"