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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

n = A("n")
e = B("e")
c = C("c")
m = D("m")
k = D("k")
b = C("b")

n.u = k
e.t = n
e.o = k
e.z = c
c.v = b
c.q = b
c.s = n
m.q = e
k.q = e
b.v = c
b.q = c
b.s = n
assert b.q.s.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

n = A("n")
e = B("e")
c = C("c")
m = D("m")
k = D("k")
b = C("b")

n.u = k
e.t = n
e.o = k
e.z = c
c.v = b
c.q = b
c.s = n
m.q = e
k.q = e
b.v = c
b.q = c
b.s = n
assert b.q.s.u.q.txt == "e"