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

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

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

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

k = A("k")
c = B("c")
h = C("h")
d = D("d")
g = B("g")
l = B("l")

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

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

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

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

k = A("k")
c = B("c")
h = C("h")
d = D("d")
g = B("g")
l = B("l")

k.w = d
c.v = d
c.z = l
c.u = l
c.s = h
h.r = d
h.s = d
h.v = l
h.t = c
d.x = l
d.q = h
d.y = h
d.r = h
g.v = d
g.z = c
g.u = l
g.s = h
l.v = d
l.z = g
l.u = c
l.s = h
assert d.y.v.u.u.u.z.txt == "l"