class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: E = None
        self.y: I = None
        self.o: H = None
        self.p: E = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: H = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: D = None
        self.y: F = None
        self.v: A = None
        self.w: D = None
        self.z: G = None
        self.q: G = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: G = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: H = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: D = None
        self.y: F = None
        self.v: A = None
        self.w: D = None
        self.z: G = None
        self.q: G = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: G = None
        self.x: C = None
        self.txt = txt

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

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