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

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

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

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

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

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

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

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

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

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

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

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

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