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

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

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

k = A("k")
n = B("n")
c = C("c")
e = A("e")
j = C("j")
l = B("l")

k.z = n
n.s = l
n.y = l
n.w = j
c.o = l
c.v = e
e.z = l
j.o = n
j.v = k
l.s = n
l.y = n
l.w = j
assert n.w.v.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

k = A("k")
n = B("n")
c = C("c")
e = A("e")
j = C("j")
l = B("l")

k.z = n
n.s = l
n.y = l
n.w = j
c.o = l
c.v = e
e.z = l
j.o = n
j.v = k
l.s = n
l.y = n
l.w = j
assert n.w.v.z.w.txt == "j"