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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.t: C = None
        self.r: E = None
        self.s: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

b = A("b")
i = B("i")
m = C("m")
e = D("e")
n = E("n")
g = F("g")
l = G("l")
f = H("f")
a = E("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: A = None
        self.t: C = None
        self.r: E = None
        self.s: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

b = A("b")
i = B("i")
m = C("m")
e = D("e")
n = E("n")
g = F("g")
l = G("l")
f = H("f")
a = E("a")

b.o = e
i.p = e
i.r = m
i.z = m
i.u = f
i.w = a
i.v = n
m.y = n
e.o = g
e.x = b
e.s = b
e.t = m
e.r = n
e.q = l
n.u = f
n.o = f
n.z = m
n.q = l
n.w = l
n.s = i
g.z = b
g.w = l
l.u = i
l.s = i
f.q = e
a.u = f
a.o = f
a.z = m
a.q = l
a.w = l
a.s = i
assert l.u.p.o.w.txt == "l"