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

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

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

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

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

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

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

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

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

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

i.z = c
i.w = l
i.q = k
i.u = k
l.r = n
l.y = n
l.s = c
n.w = l
n.y = k
n.x = i
c.t = n
c.r = n
k.r = n
k.y = n
k.s = c
assert i.w.r.y.s.r.txt == "n"