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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.o: A = None
        self.s: G = None
        self.z: E = None
        self.y: E = None
        self.q: A = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: C = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: A = None
        self.o: A = None
        self.s: G = None
        self.z: E = None
        self.y: E = None
        self.q: A = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

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

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

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