class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: J = None
        self.w: E = None
        self.v: A = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: H = None
        self.x: H = None
        self.s: A = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.v: H = None
        self.s: J = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: I = None
        self.r: C = None
        self.p: F = None
        self.u: B = None
        self.w: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: J = None
        self.w: E = None
        self.v: A = None
        self.p: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: H = None
        self.x: H = None
        self.s: A = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.y: B = None
        self.v: H = None
        self.s: J = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.v: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: I = None
        self.r: C = None
        self.p: F = None
        self.u: B = None
        self.w: H = None
        self.txt = txt

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

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