class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: B = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: A = None
        self.z: H = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: A = None
        self.s: B = None
        self.t: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: F = None
        self.v: E = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: B = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: A = None
        self.z: H = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: A = None
        self.s: B = None
        self.t: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.p: F = None
        self.v: E = None
        self.o: E = None
        self.w: C = None
        self.txt = txt

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

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