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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

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

m.y = a
m.s = g
m.z = n
m.w = l
e.u = m
e.t = c
e.x = n
a.t = i
a.s = l
a.p = c
a.z = c
l.w = i
l.x = i
f.u = m
f.t = c
f.x = l
n.w = l
n.x = i
g.y = a
g.s = m
g.z = l
g.w = l
i.w = n
i.x = l
c.t = i
c.s = l
c.p = a
c.z = a
k.u = g
k.t = a
k.x = n
assert l.x.x.x.w.x.w.txt == "n"