class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: H = None
        self.v: F = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: D = None
        self.s: H = None
        self.u: F = None
        self.q: F = None
        self.r: G = None
        self.z: A = None
        self.y: I = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.v: C = None
        self.o: H = None
        self.r: H = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: I = None
        self.q: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: D = None
        self.s: H = None
        self.u: F = None
        self.q: F = None
        self.r: G = None
        self.z: A = None
        self.y: I = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.v: C = None
        self.o: H = None
        self.r: H = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: I = None
        self.q: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: H = None
        self.r: E = None
        self.txt = txt

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

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