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

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

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

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

b = A("b")
a = B("a")
k = C("k")
c = D("c")
i = C("i")
g = B("g")
d = B("d")
m = A("m")

b.w = d
b.u = c
b.y = c
b.p = k
a.z = c
a.s = c
a.x = g
k.y = i
k.w = i
k.z = c
c.s = k
i.y = k
i.w = k
i.z = c
g.z = c
g.s = c
g.x = a
d.z = c
d.s = c
d.x = a
m.w = d
m.u = c
m.y = c
m.p = i
assert i.w.y.w.w.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: D = None
        self.p: C = None
        self.y: D = None
        self.txt = txt

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

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

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

b = A("b")
a = B("a")
k = C("k")
c = D("c")
i = C("i")
g = B("g")
d = B("d")
m = A("m")

b.w = d
b.u = c
b.y = c
b.p = k
a.z = c
a.s = c
a.x = g
k.y = i
k.w = i
k.z = c
c.s = k
i.y = k
i.w = k
i.z = c
g.z = c
g.s = c
g.x = a
d.z = c
d.s = c
d.x = a
m.w = d
m.u = c
m.y = c
m.p = i
assert i.w.y.w.w.z.s.txt == "k"