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

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

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

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

i = A("i")
m = B("m")
b = C("b")
l = D("l")
e = A("e")

i.x = e
i.s = e
i.w = m
m.v = l
m.x = l
m.y = b
m.u = e
b.z = m
l.u = m
l.x = i
e.x = i
e.s = i
e.w = m
assert b.z.y.z.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: B = None
        self.s: A = None
        self.txt = txt

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

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

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

i = A("i")
m = B("m")
b = C("b")
l = D("l")
e = A("e")

i.x = e
i.s = e
i.w = m
m.v = l
m.x = l
m.y = b
m.u = e
b.z = m
l.u = m
l.x = i
e.x = i
e.s = i
e.w = m
assert b.z.y.z.v.u.txt == "m"