class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.z: F = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: C = None
        self.t: I = None
        self.y: C = None
        self.o: F = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: E = None
        self.w: J = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.s: I = None
        self.o: I = None
        self.v: G = None
        self.w: A = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: E = None
        self.w: C = None
        self.x: F = None
        self.o: G = None
        self.u: E = None
        self.z: A = None
        self.txt = txt

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

a = A("a")
e = B("e")
b = C("b")
f = D("f")
g = E("g")
h = F("h")
m = G("m")
c = H("c")
l = I("l")
n = J("n")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: C = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.z: F = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: C = None
        self.t: I = None
        self.y: C = None
        self.o: F = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: E = None
        self.w: J = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.s: I = None
        self.o: I = None
        self.v: G = None
        self.w: A = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: E = None
        self.w: C = None
        self.x: F = None
        self.o: G = None
        self.u: E = None
        self.z: A = None
        self.txt = txt

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

a = A("a")
e = B("e")
b = C("b")
f = D("f")
g = E("g")
h = F("h")
m = G("m")
c = H("c")
l = I("l")
n = J("n")

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