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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.s: A = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.t: H = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: F = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.x: G = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: D = None
        self.s: A = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: D = None
        self.t: H = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

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

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