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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: H = None
        self.v: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: D = None
        self.s: A = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: H = None
        self.v: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: D = None
        self.s: A = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

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

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