class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: H = None
        self.t: G = None
        self.s: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: G = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: B = None
        self.z: A = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.o: A = None
        self.u: B = None
        self.q: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: G = None
        self.p: F = None
        self.q: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: B = None
        self.z: A = None
        self.u: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: A = None
        self.t: E = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.o: A = None
        self.u: B = None
        self.q: F = None
        self.txt = txt

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

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

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