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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.u: G = None
        self.t: H = None
        self.w: E = None
        self.z: E = None
        self.r: I = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.w: H = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: G = None
        self.q: G = None
        self.v: A = None
        self.y: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: C = None
        self.o: B = None
        self.q: E = None
        self.z: E = None
        self.w: A = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: I = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: G = None
        self.u: G = None
        self.t: H = None
        self.w: E = None
        self.z: E = None
        self.r: I = None
        self.p: C = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: H = None
        self.w: H = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: G = None
        self.q: G = None
        self.v: A = None
        self.y: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: C = None
        self.o: B = None
        self.q: E = None
        self.z: E = None
        self.w: A = None
        self.p: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: I = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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