class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: D = None
        self.s: F = None
        self.o: E = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.q: F = None
        self.x: D = None
        self.u: H = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: A = None
        self.w: B = None
        self.o: F = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: C = None
        self.r: F = None
        self.s: F = None
        self.t: F = None
        self.y: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.q: F = None
        self.x: D = None
        self.u: H = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: A = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: A = None
        self.w: B = None
        self.o: F = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: C = None
        self.r: F = None
        self.s: F = None
        self.t: F = None
        self.y: F = None
        self.txt = txt

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

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