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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: H = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: H = None
        self.u: B = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.q: B = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
a = C("a")
d = D("d")
e = E("e")
f = F("f")
g = G("g")
m = H("m")

j.o = d
j.y = i
j.z = i
j.r = a
j.q = a
j.v = m
j.x = f
i.v = d
i.z = d
i.x = j
i.p = a
i.o = a
a.s = i
a.y = i
a.u = m
d.q = e
d.x = m
d.z = m
d.u = i
e.q = d
e.w = m
e.y = i
e.s = a
f.p = i
f.x = i
f.q = i
g.y = d
g.r = j
m.s = f
assert m.s.x.z.u.z.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.y: B = None
        self.z: B = None
        self.r: C = None
        self.v: H = None
        self.q: C = None
        self.x: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: H = None
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: H = None
        self.u: B = None
        self.z: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: B = None
        self.q: B = None
        self.txt = txt

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

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

j = A("j")
i = B("i")
a = C("a")
d = D("d")
e = E("e")
f = F("f")
g = G("g")
m = H("m")

j.o = d
j.y = i
j.z = i
j.r = a
j.q = a
j.v = m
j.x = f
i.v = d
i.z = d
i.x = j
i.p = a
i.o = a
a.s = i
a.y = i
a.u = m
d.q = e
d.x = m
d.z = m
d.u = i
e.q = d
e.w = m
e.y = i
e.s = a
f.p = i
f.x = i
f.q = i
g.y = d
g.r = j
m.s = f
assert m.s.x.z.u.z.q.w.txt == "m"