class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: E = None
        self.t: I = None
        self.q: I = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: A = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: G = None
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: A = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: G = None
        self.p: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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