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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

j.v = c
j.r = a
j.s = m
j.o = b
j.t = b
g.q = a
g.r = j
b.u = j
b.s = f
b.q = m
b.r = n
b.z = n
d.x = j
d.u = j
d.w = f
a.r = d
c.q = n
c.r = j
f.x = j
f.u = j
f.w = e
m.x = j
m.u = j
m.w = f
e.x = j
e.u = j
e.w = f
n.r = f
assert e.w.x.s.txt == "m"