class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: G = None
        self.p: D = None
        self.v: I = None
        self.r: I = None
        self.z: H = None
        self.q: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.r: G = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: G = None
        self.y: E = None
        self.x: I = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.r: G = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: G = None
        self.y: E = None
        self.x: I = None
        self.txt = txt

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

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

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