class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

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