class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.q: A = None
        self.o: G = None
        self.t: C = None
        self.v: G = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: E = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: G = None
        self.r: I = None
        self.u: D = None
        self.t: B = None
        self.y: D = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: B = None
        self.t: E = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: G = None
        self.o: F = None
        self.s: F = None
        self.v: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: A = None
        self.q: A = None
        self.o: G = None
        self.t: C = None
        self.v: G = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: E = None
        self.z: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: G = None
        self.r: I = None
        self.u: D = None
        self.t: B = None
        self.y: D = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: B = None
        self.t: E = None
        self.y: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: G = None
        self.o: F = None
        self.s: F = None
        self.v: D = None
        self.q: E = None
        self.txt = txt

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

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

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