class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: C = None
        self.u: E = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: I = None
        self.t: H = None
        self.z: J = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: C = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.w: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: I = None
        self.t: H = None
        self.z: J = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: C = None
        self.x: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.w: F = None
        self.txt = txt

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

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

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