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

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

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

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

n = A("n")
c = B("c")
l = C("l")
f = D("f")
i = C("i")

n.s = f
n.u = f
n.o = i
n.q = c
c.x = n
l.t = f
l.r = c
l.z = i
l.v = n
f.y = i
i.t = f
i.r = c
i.z = l
i.v = n
assert f.y.z.v.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: D = None
        self.o: C = None
        self.q: B = None
        self.txt = txt

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

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

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

n = A("n")
c = B("c")
l = C("l")
f = D("f")
i = C("i")

n.s = f
n.u = f
n.o = i
n.q = c
c.x = n
l.t = f
l.r = c
l.z = i
l.v = n
f.y = i
i.t = f
i.r = c
i.z = l
i.v = n
assert f.y.z.v.q.x.txt == "n"