class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: H = None
        self.q: B = None
        self.w: D = None
        self.p: H = None
        self.x: B = None
        self.r: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.t: D = None
        self.r: H = None
        self.s: C = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: A = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.t: I = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: F = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.t: D = None
        self.r: H = None
        self.s: C = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: A = None
        self.s: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.t: I = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: F = None
        self.t: E = None
        self.v: B = None
        self.txt = txt

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

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