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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.z: H = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.r: G = None
        self.w: C = None
        self.txt = txt

j = A("j")
h = B("h")
i = C("i")
n = D("n")
m = E("m")
k = F("k")
l = G("l")
e = H("e")
a = B("a")
f = G("f")

j.s = h
j.o = n
j.q = f
h.v = m
h.y = m
h.r = a
h.z = e
h.w = n
i.t = m
n.z = l
n.y = m
m.s = i
k.v = h
k.r = e
l.y = k
e.x = i
e.w = i
e.z = j
e.r = l
a.v = m
a.y = m
a.r = h
a.z = e
a.w = n
f.y = k
assert l.y.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: B = None
        self.z: H = None
        self.w: D = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.r: G = None
        self.w: C = None
        self.txt = txt

j = A("j")
h = B("h")
i = C("i")
n = D("n")
m = E("m")
k = F("k")
l = G("l")
e = H("e")
a = B("a")
f = G("f")

j.s = h
j.o = n
j.q = f
h.v = m
h.y = m
h.r = a
h.z = e
h.w = n
i.t = m
n.z = l
n.y = m
m.s = i
k.v = h
k.r = e
l.y = k
e.x = i
e.w = i
e.z = j
e.r = l
a.v = m
a.y = m
a.r = h
a.z = e
a.w = n
f.y = k
assert l.y.v.w.txt == "n"