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

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

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

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

l = A("l")
h = B("h")
i = C("i")
f = D("f")
c = B("c")
a = C("a")

l.w = a
h.y = i
h.z = f
h.x = f
i.y = f
i.v = f
i.u = h
i.w = a
f.w = h
c.y = a
c.z = f
c.x = f
a.y = f
a.v = f
a.u = c
a.w = i
assert f.w.y.w.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

l = A("l")
h = B("h")
i = C("i")
f = D("f")
c = B("c")
a = C("a")

l.w = a
h.y = i
h.z = f
h.x = f
i.y = f
i.v = f
i.u = h
i.w = a
f.w = h
c.y = a
c.z = f
c.x = f
a.y = f
a.v = f
a.u = c
a.w = i
assert f.w.y.w.u.y.txt == "a"