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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: G = None
        self.t: E = None
        self.o: D = None
        self.v: D = None
        self.s: D = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: G = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.w: F = None
        self.txt = txt

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

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

m.w = d
a.r = c
a.o = d
j.w = d
j.o = d
j.v = d
j.s = d
j.z = d
j.u = h
j.t = e
j.q = a
d.o = c
e.z = a
f.w = d
f.y = d
f.s = h
f.z = a
h.z = f
h.w = f
h.t = d
c.u = m
c.q = m
c.r = d
c.t = d
c.o = a
c.w = a
c.s = e
assert j.u.z.w.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: G = None
        self.t: E = None
        self.o: D = None
        self.v: D = None
        self.s: D = None
        self.q: B = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: G = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: D = None
        self.w: F = None
        self.txt = txt

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

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

m.w = d
a.r = c
a.o = d
j.w = d
j.o = d
j.v = d
j.s = d
j.z = d
j.u = h
j.t = e
j.q = a
d.o = c
e.z = a
f.w = d
f.y = d
f.s = h
f.z = a
h.z = f
h.w = f
h.t = d
c.u = m
c.q = m
c.r = d
c.t = d
c.o = a
c.w = a
c.s = e
assert j.u.z.w.o.o.o.txt == "d"