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

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

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

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

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

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

a.u = f
a.q = f
a.r = j
a.z = n
a.s = g
j.z = l
e.x = g
f.q = g
f.s = d
n.p = j
n.u = l
n.s = g
n.z = g
l.z = j
m.q = g
m.s = d
d.p = j
d.u = l
d.s = e
d.z = e
g.x = e
b.u = f
b.q = m
b.r = j
b.z = n
b.s = g
assert m.q.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.r: B = None
        self.z: E = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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

a.u = f
a.q = f
a.r = j
a.z = n
a.s = g
j.z = l
e.x = g
f.q = g
f.s = d
n.p = j
n.u = l
n.s = g
n.z = g
l.z = j
m.q = g
m.s = d
d.p = j
d.u = l
d.s = e
d.z = e
g.x = e
b.u = f
b.q = m
b.r = j
b.z = n
b.s = g
assert m.q.x.x.txt == "g"