class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: D = None
        self.p: F = None
        self.x: C = None
        self.t: A = None
        self.y: H = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: D = None
        self.p: F = None
        self.x: C = None
        self.t: A = None
        self.y: H = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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