class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: D = None
        self.r: H = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: H = None
        self.s: A = None
        self.o: F = None
        self.w: G = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: D = None
        self.r: H = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: H = None
        self.s: A = None
        self.o: F = None
        self.w: G = None
        self.p: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: C = None
        self.r: B = None
        self.q: C = None
        self.txt = txt

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

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

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