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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.r: G = None
        self.p: F = None
        self.z: F = None
        self.v: F = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.t: H = None
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.q: C = None
        self.x: E = None
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: G = None
        self.r: G = None
        self.p: F = None
        self.z: F = None
        self.v: F = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: H = None
        self.t: H = None
        self.w: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.q: C = None
        self.x: E = None
        self.z: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

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

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