class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: D = None
        self.q: F = None
        self.w: H = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: H = None
        self.o: G = None
        self.v: C = None
        self.p: G = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: C = None
        self.z: C = None
        self.q: C = None
        self.x: A = None
        self.t: B = None
        self.r: H = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: H = None
        self.o: G = None
        self.v: C = None
        self.p: G = None
        self.x: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: C = None
        self.z: C = None
        self.q: C = None
        self.x: A = None
        self.t: B = None
        self.r: H = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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