class A:
    def __init__(self, txt: str):
        self.p: J = None
        self.s: E = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: J = None
        self.w: A = None
        self.p: D = None
        self.y: D = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: J = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: F = None
        self.x: F = None
        self.s: B = None
        self.y: D = None
        self.t: A = None
        self.u: J = None
        self.v: J = None
        self.q: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: G = None
        self.z: G = None
        self.r: F = None
        self.t: G = None
        self.x: G = None
        self.o: F = None
        self.w: G = None
        self.txt = txt

m = A("m")
d = B("d")
i = C("i")
a = D("a")
f = E("f")
k = F("k")
c = G("c")
h = H("h")
g = I("g")
n = J("n")

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

class B:
    def __init__(self, txt: str):
        self.u: I = None
        self.t: J = None
        self.w: A = None
        self.p: D = None
        self.y: D = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: J = None
        self.y: E = None
        self.x: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: F = None
        self.x: F = None
        self.s: B = None
        self.y: D = None
        self.t: A = None
        self.u: J = None
        self.v: J = None
        self.q: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: G = None
        self.z: G = None
        self.r: F = None
        self.t: G = None
        self.x: G = None
        self.o: F = None
        self.w: G = None
        self.txt = txt

m = A("m")
d = B("d")
i = C("i")
a = D("a")
f = E("f")
k = F("k")
c = G("c")
h = H("h")
g = I("g")
n = J("n")

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