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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.p: B = None
        self.r: C = None
        self.z: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: C = None
        self.w: D = None
        self.t: B = None
        self.z: H = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.r: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.p: B = None
        self.r: C = None
        self.z: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: C = None
        self.w: D = None
        self.t: B = None
        self.z: H = None
        self.v: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.r: E = None
        self.txt = txt

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

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