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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.z: A = None
        self.p: C = 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.p: A = None
        self.txt = txt

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

k = A("k")
n = B("n")
g = C("g")
a = D("a")
d = E("d")
j = A("j")
l = D("l")
e = B("e")
c = E("c")
m = B("m")

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: E = None
        self.z: A = None
        self.p: C = 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.p: A = None
        self.txt = txt

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

k = A("k")
n = B("n")
g = C("g")
a = D("a")
d = E("d")
j = A("j")
l = D("l")
e = B("e")
c = E("c")
m = B("m")

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