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

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

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

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

l = A("l")
k = B("k")
c = C("c")
d = D("d")
n = C("n")
j = A("j")
a = D("a")

l.y = k
l.p = k
l.w = a
l.o = d
k.z = c
k.s = d
c.u = d
d.t = c
d.w = k
n.u = a
j.y = k
j.p = k
j.w = a
j.o = a
a.t = n
a.w = k
assert k.s.w.z.u.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: D = None
        self.o: D = None
        self.p: B = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
c = C("c")
d = D("d")
n = C("n")
j = A("j")
a = D("a")

l.y = k
l.p = k
l.w = a
l.o = d
k.z = c
k.s = d
c.u = d
d.t = c
d.w = k
n.u = a
j.y = k
j.p = k
j.w = a
j.o = a
a.t = n
a.w = k
assert k.s.w.z.u.w.s.txt == "d"