class A:
    def __init__(self, txt: str):
        self.y: I = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: J = None
        self.z: D = None
        self.v: H = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: J = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: J = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: I = None
        self.p: B = None
        self.x: E = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: H = None
        self.r: A = None
        self.o: G = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.o: G = None
        self.v: H = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.x: J = None
        self.z: D = None
        self.v: H = None
        self.q: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: J = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: J = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: I = None
        self.p: B = None
        self.x: E = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: H = None
        self.r: A = None
        self.o: G = None
        self.v: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.o: G = None
        self.v: H = None
        self.r: D = None
        self.p: A = None
        self.txt = txt

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

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