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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.q: B = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: C = None
        self.t: G = None
        self.p: D = None
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.w: G = None
        self.p: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: D = None
        self.q: B = None
        self.s: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: C = None
        self.t: G = None
        self.p: D = None
        self.v: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.w: G = None
        self.p: C = None
        self.v: F = None
        self.txt = txt

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

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