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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.t: I = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: G = None
        self.w: E = None
        self.r: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.t: I = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: D = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: G = None
        self.w: E = None
        self.r: G = None
        self.txt = txt

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

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