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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.z: C = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.s: E = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: A = None
        self.z: C = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.s: E = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

a.p = n
a.y = m
a.x = j
a.s = l
m.p = d
m.s = f
m.z = l
m.q = c
k.w = a
k.v = l
k.z = c
k.y = c
k.t = m
j.r = l
j.t = a
j.s = d
j.o = m
d.q = a
l.p = m
l.y = n
l.x = j
l.s = a
c.w = l
c.v = a
c.z = f
c.y = k
c.t = n
n.p = d
n.s = f
n.z = a
n.q = k
f.w = a
f.v = l
f.z = k
f.y = k
f.t = n
assert d.q.y.p.q.s.s.txt == "a"