class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: H = None
        self.p: H = None
        self.q: I = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: F = None
        self.z: D = None
        self.o: B = None
        self.y: A = None
        self.x: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: C = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.x: D = None
        self.q: D = None
        self.v: F = None
        self.z: C = None
        self.s: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: I = None
        self.q: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.z: H = None
        self.s: D = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: F = None
        self.z: D = None
        self.o: B = None
        self.y: A = None
        self.x: I = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: C = None
        self.q: B = None
        self.r: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.x: D = None
        self.q: D = None
        self.v: F = None
        self.z: C = None
        self.s: E = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: I = None
        self.q: B = None
        self.txt = txt

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

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

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