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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: A = None
        self.x: F = None
        self.p: E = None
        self.r: A = None
        self.q: H = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.z: I = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: H = None
        self.p: G = None
        self.z: C = None
        self.x: B = None
        self.o: A = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: A = None
        self.x: F = None
        self.p: E = None
        self.r: A = None
        self.q: H = None
        self.w: F = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.z: I = None
        self.p: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: H = None
        self.p: G = None
        self.z: C = None
        self.x: B = None
        self.o: A = None
        self.v: E = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: E = None
        self.txt = txt

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

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

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