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

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

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

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

c = A("c")
l = B("l")
d = C("d")
i = D("i")
f = B("f")
g = B("g")
m = C("m")
a = B("a")
n = D("n")

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

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

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

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

c = A("c")
l = B("l")
d = C("d")
i = D("i")
f = B("f")
g = B("g")
m = C("m")
a = B("a")
n = D("n")

c.y = m
c.z = n
l.y = n
d.w = g
d.u = n
i.u = l
i.x = n
i.v = m
f.y = n
g.y = i
m.w = l
m.u = i
a.y = i
n.u = f
n.x = i
n.v = m
assert f.y.u.y.x.u.y.txt == "n"