class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: D = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: E = None
        self.v: E = None
        self.w: H = None
        self.t: B = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: F = None
        self.u: G = None
        self.o: C = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: I = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: A = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.r: E = None
        self.v: E = None
        self.w: H = None
        self.t: B = None
        self.p: A = None
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: F = None
        self.u: G = None
        self.o: C = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.q: I = None
        self.x: E = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: A = None
        self.s: B = None
        self.y: B = None
        self.txt = txt

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

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