class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: G = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: G = None
        self.u: I = None
        self.q: B = None
        self.v: G = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: I = None
        self.s: I = None
        self.z: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.r: G = None
        self.w: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: E = None
        self.u: I = None
        self.x: E = None
        self.y: H = None
        self.r: C = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.u: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: G = None
        self.u: I = None
        self.q: B = None
        self.v: G = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: I = None
        self.s: I = None
        self.z: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.t: D = None
        self.r: G = None
        self.w: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: E = None
        self.u: I = None
        self.x: E = None
        self.y: H = None
        self.r: C = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.u: G = None
        self.txt = txt

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

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

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