class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: I = None
        self.y: E = None
        self.w: I = None
        self.z: G = None
        self.t: D = None
        self.p: I = None
        self.r: E = None
        self.s: E = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.r: F = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: J = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: H = None
        self.z: A = None
        self.t: A = None
        self.q: I = None
        self.x: C = None
        self.o: I = None
        self.y: C = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.x: F = None
        self.txt = txt

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

a = A("a")
d = B("d")
f = C("f")
e = D("e")
g = E("g")
m = F("m")
j = G("j")
b = H("b")
k = I("k")
n = J("n")

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

class B:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.r: F = None
        self.z: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: J = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: H = None
        self.z: A = None
        self.t: A = None
        self.q: I = None
        self.x: C = None
        self.o: I = None
        self.y: C = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: J = None
        self.x: F = None
        self.txt = txt

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

a = A("a")
d = B("d")
f = C("f")
e = D("e")
g = E("g")
m = F("m")
j = G("j")
b = H("b")
k = I("k")
n = J("n")

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