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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: H = None
        self.u: C = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.z: H = None
        self.s: B = None
        self.p: B = None
        self.o: B = None
        self.x: F = None
        self.v: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

m = A("m")
n = B("n")
e = C("e")
g = D("g")
k = E("k")
a = F("a")
c = G("c")
d = H("d")
b = E("b")

m.o = g
m.p = n
n.o = d
n.t = d
n.y = d
n.u = e
e.w = c
e.v = g
e.z = a
e.s = d
g.v = e
g.z = n
k.w = m
k.u = e
k.z = d
k.s = n
k.p = n
k.o = n
k.x = a
k.v = b
a.u = m
a.y = m
c.v = g
c.z = e
c.t = m
d.o = b
b.w = m
b.u = e
b.z = d
b.s = n
b.p = n
b.o = n
b.x = a
b.v = k
assert d.o.u.s.o.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: H = None
        self.u: C = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: C = None
        self.z: H = None
        self.s: B = None
        self.p: B = None
        self.o: B = None
        self.x: F = None
        self.v: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

m = A("m")
n = B("n")
e = C("e")
g = D("g")
k = E("k")
a = F("a")
c = G("c")
d = H("d")
b = E("b")

m.o = g
m.p = n
n.o = d
n.t = d
n.y = d
n.u = e
e.w = c
e.v = g
e.z = a
e.s = d
g.v = e
g.z = n
k.w = m
k.u = e
k.z = d
k.s = n
k.p = n
k.o = n
k.x = a
k.v = b
a.u = m
a.y = m
c.v = g
c.z = e
c.t = m
d.o = b
b.w = m
b.u = e
b.z = d
b.s = n
b.p = n
b.o = n
b.x = a
b.v = k
assert d.o.u.s.o.z.o.txt == "b"