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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.q: H = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: F = None
        self.q: H = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

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

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