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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: I = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: E = None
        self.z: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

e.x = c
e.w = a
e.o = b
e.s = h
c.s = a
c.z = n
c.w = e
f.s = e
f.p = d
f.t = c
g.t = b
g.y = a
g.z = a
g.w = n
a.t = e
n.r = d
n.p = c
b.t = e
b.x = g
h.x = d
h.r = g
h.s = c
d.w = e
assert a.t.o.t.s.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: E = None
        self.o: G = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: I = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: E = None
        self.z: E = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

e.x = c
e.w = a
e.o = b
e.s = h
c.s = a
c.z = n
c.w = e
f.s = e
f.p = d
f.t = c
g.t = b
g.y = a
g.z = a
g.w = n
a.t = e
n.r = d
n.p = c
b.t = e
b.x = g
h.x = d
h.r = g
h.s = c
d.w = e
assert a.t.o.t.s.x.w.txt == "e"