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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.o: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: E = None
        self.o: B = None
        self.v: A = None
        self.txt = txt

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

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

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

j.u = l
j.q = m
j.y = m
j.z = f
f.p = c
f.x = c
f.s = g
m.t = d
m.q = d
m.o = f
m.v = j
l.z = j
l.o = i
l.p = e
d.x = f
c.p = f
c.x = f
c.s = m
i.t = d
i.q = d
i.o = f
i.v = e
g.t = d
g.q = d
g.o = c
g.v = j
e.u = l
e.q = m
e.z = c
e.y = g
a.z = e
a.o = i
a.p = j
assert d.x.p.p.s.txt == "g"