class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.x: E = None
        self.v: C = None
        self.u: H = None
        self.w: E = None
        self.r: A = None
        self.y: I = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.r: F = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: D = None
        self.x: E = None
        self.v: C = None
        self.u: H = None
        self.w: E = None
        self.r: A = None
        self.y: I = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: E = None
        self.r: F = None
        self.t: F = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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