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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: I = None
        self.v: H = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.o: H = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: D = None
        self.z: I = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: B = None
        self.s: F = None
        self.x: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.u: E = None
        self.z: C = None
        self.t: G = None
        self.r: B = None
        self.w: I = None
        self.txt = txt

m = A("m")
i = B("i")
g = C("g")
n = D("n")
e = E("e")
b = F("b")
h = G("h")
l = H("l")
d = I("d")
j = J("j")

m.x = i
m.z = n
i.q = e
g.q = l
g.v = l
g.z = d
g.s = h
n.p = l
n.x = e
n.v = e
e.p = i
e.s = i
e.z = m
e.u = g
b.o = g
b.z = g
b.x = i
h.q = l
h.o = l
h.p = b
h.x = n
l.x = j
l.y = n
l.z = d
l.p = b
d.u = e
d.t = n
d.p = i
d.s = b
d.x = b
d.v = g
j.q = h
j.t = h
j.y = l
j.u = e
j.z = g
j.r = i
j.w = d
assert n.p.x.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: I = None
        self.v: H = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: E = None
        self.v: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: F = None
        self.o: H = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: J = None
        self.y: D = None
        self.z: I = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: D = None
        self.p: B = None
        self.s: F = None
        self.x: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.u: E = None
        self.z: C = None
        self.t: G = None
        self.r: B = None
        self.w: I = None
        self.txt = txt

m = A("m")
i = B("i")
g = C("g")
n = D("n")
e = E("e")
b = F("b")
h = G("h")
l = H("l")
d = I("d")
j = J("j")

m.x = i
m.z = n
i.q = e
g.q = l
g.v = l
g.z = d
g.s = h
n.p = l
n.x = e
n.v = e
e.p = i
e.s = i
e.z = m
e.u = g
b.o = g
b.z = g
b.x = i
h.q = l
h.o = l
h.p = b
h.x = n
l.x = j
l.y = n
l.z = d
l.p = b
d.u = e
d.t = n
d.p = i
d.s = b
d.x = b
d.v = g
j.q = h
j.t = h
j.y = l
j.u = e
j.z = g
j.r = i
j.w = d
assert n.p.x.w.u.txt == "e"