class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: F = None
        self.x: F = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: H = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

n.s = e
n.v = e
n.q = g
n.x = g
n.p = m
e.w = b
e.x = b
e.v = a
e.u = g
e.r = l
e.z = l
m.p = b
m.x = b
m.u = l
a.x = b
a.z = e
a.w = e
a.p = e
a.o = m
a.v = m
a.q = l
l.v = a
l.o = a
g.r = h
g.x = h
h.x = g
h.p = b
h.o = m
h.q = a
b.p = m
b.o = a
b.v = e
assert h.o.x.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: F = None
        self.x: F = None
        self.p: C = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: H = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

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