class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: G = None
        self.s: C = None
        self.o: G = None
        self.r: E = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: B = None
        self.y: C = None
        self.x: E = None
        self.q: A = None
        self.s: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: D = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: B = None
        self.y: C = None
        self.x: E = None
        self.q: A = None
        self.s: F = None
        self.txt = txt

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

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

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