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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: J = None
        self.q: D = None
        self.v: H = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: H = None
        self.v: B = None
        self.z: H = None
        self.u: I = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: I = None
        self.q: C = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: F = None
        self.o: F = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.s: B = None
        self.o: B = None
        self.u: I = None
        self.v: D = None
        self.q: I = None
        self.y: E = None
        self.z: I = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: G = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: J = None
        self.q: D = None
        self.v: H = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: H = None
        self.v: B = None
        self.z: H = None
        self.u: I = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: I = None
        self.q: C = None
        self.s: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: F = None
        self.o: F = None
        self.v: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.s: B = None
        self.o: B = None
        self.u: I = None
        self.v: D = None
        self.q: I = None
        self.y: E = None
        self.z: I = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: G = None
        self.o: B = None
        self.y: A = None
        self.txt = txt

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

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