class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

n.y = j
n.r = k
k.x = e
k.s = l
k.z = n
i.z = l
i.p = l
i.s = l
i.q = e
j.w = k
j.u = n
l.z = i
l.p = i
l.s = i
l.q = e
e.y = j
e.r = k
assert l.z.p.q.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

n.y = j
n.r = k
k.x = e
k.s = l
k.z = n
i.z = l
i.p = l
i.s = l
i.q = e
j.w = k
j.u = n
l.z = i
l.p = i
l.s = i
l.q = e
e.y = j
e.r = k
assert l.z.p.q.y.u.txt == "n"