class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: D = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.u: B = None
        self.z: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: I = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: D = None
        self.p: I = None
        self.v: I = None
        self.z: D = None
        self.q: B = None
        self.x: A = None
        self.t: E = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: C = None
        self.o: J = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: E = None
        self.u: B = None
        self.z: G = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: I = None
        self.r: F = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.y: D = None
        self.p: I = None
        self.v: I = None
        self.z: D = None
        self.q: B = None
        self.x: A = None
        self.t: E = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: C = None
        self.o: J = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.v: I = None
        self.txt = txt

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

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

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

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