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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.s: G = None
        self.x: F = None
        self.y: H = None
        self.o: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: G = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.s: G = None
        self.x: F = None
        self.y: H = None
        self.o: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: B = None
        self.z: C = None
        self.y: D = None
        self.txt = txt

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

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