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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: D = None
        self.s: D = None
        self.x: H = None
        self.w: E = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: H = None
        self.u: D = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: D = None
        self.s: D = None
        self.x: H = None
        self.w: E = None
        self.r: H = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: H = None
        self.u: D = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.txt = txt

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

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

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

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