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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.p: G = None
        self.r: I = None
        self.w: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: C = None
        self.x: E = None
        self.t: E = None
        self.r: G = None
        self.z: H = None
        self.o: B = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.p: G = None
        self.r: I = None
        self.w: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: C = None
        self.x: E = None
        self.t: E = None
        self.r: G = None
        self.z: H = None
        self.o: B = None
        self.p: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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