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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: D = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

l = A("l")
c = B("c")
k = C("k")
e = D("e")

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: D = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

l = A("l")
c = B("c")
k = C("k")
e = D("e")

l.y = k
l.r = k
l.w = c
c.q = l
k.v = e
k.u = e
k.t = e
k.x = c
e.u = l
e.z = k
assert k.t.u.w.txt == "c"