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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: H = None
        self.v: J = None
        self.y: B = None
        self.t: B = None
        self.z: A = None
        self.x: H = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.u: E = None
        self.o: I = None
        self.s: F = None
        self.t: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: H = None
        self.v: J = None
        self.y: B = None
        self.t: B = None
        self.z: A = None
        self.x: H = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.u: E = None
        self.o: I = None
        self.s: F = None
        self.t: H = None
        self.txt = txt

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

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