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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.p: B = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: F = None
        self.v: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.p: B = None
        self.v: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: F = None
        self.v: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.txt = txt

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

j.v = m
g.o = j
g.x = j
m.t = j
m.z = g
m.p = g
m.v = h
i.q = c
i.y = n
i.v = g
b.p = c
b.q = i
n.v = b
n.z = b
n.q = b
n.t = d
n.x = h
n.y = h
n.p = i
n.w = m
n.s = m
c.v = b
c.q = g
c.u = d
c.y = d
c.w = m
c.x = i
h.v = n
h.w = c
d.q = g
d.w = n
assert n.w.p.o.v.t.v.txt == "m"