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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: G = None
        self.y: H = None
        self.v: D = None
        self.x: H = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: G = None
        self.t: F = None
        self.u: D = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: C = None
        self.u: A = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

m.y = n
m.q = c
h.z = n
h.v = d
d.o = h
d.y = h
d.v = h
d.x = b
d.z = m
d.q = g
c.s = b
c.v = b
c.u = n
c.t = n
c.y = e
c.x = e
i.s = n
i.q = n
i.t = g
i.y = g
i.u = c
i.z = d
g.v = a
n.t = m
n.u = m
n.r = d
n.q = d
a.z = d
a.u = g
a.t = g
e.z = d
e.u = g
e.t = g
b.s = c
b.v = c
b.u = n
b.t = n
b.y = e
b.x = e
assert a.u.v.t.v.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: G = None
        self.y: H = None
        self.v: D = None
        self.x: H = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: G = None
        self.t: F = None
        self.u: D = None
        self.y: F = None
        self.z: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: C = None
        self.u: A = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.u: F = None
        self.t: F = None
        self.txt = txt

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

m.y = n
m.q = c
h.z = n
h.v = d
d.o = h
d.y = h
d.v = h
d.x = b
d.z = m
d.q = g
c.s = b
c.v = b
c.u = n
c.t = n
c.y = e
c.x = e
i.s = n
i.q = n
i.t = g
i.y = g
i.u = c
i.z = d
g.v = a
n.t = m
n.u = m
n.r = d
n.q = d
a.z = d
a.u = g
a.t = g
e.z = d
e.u = g
e.t = g
b.s = c
b.v = c
b.u = n
b.t = n
b.y = e
b.x = e
assert a.u.v.t.v.z.q.txt == "g"