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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.o: G = None
        self.x: G = None
        self.t: G = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.q: B = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.w: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: D = None
        self.r: D = None
        self.y: C = None
        self.x: F = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: I = None
        self.t: F = None
        self.r: F = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.w: F = None
        self.v: F = None
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.o: G = None
        self.x: G = None
        self.t: G = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.q: B = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: H = None
        self.w: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: D = None
        self.r: D = None
        self.y: C = None
        self.x: F = None
        self.w: A = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: I = None
        self.t: F = None
        self.r: F = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: B = None
        self.w: F = None
        self.v: F = None
        self.z: E = None
        self.y: F = None
        self.txt = txt

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

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