class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: C = None
        self.q: F = None
        self.y: F = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.x: I = None
        self.p: H = None
        self.z: E = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: H = None
        self.s: I = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.u: D = None
        self.v: C = None
        self.s: A = None
        self.q: I = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.x: I = None
        self.p: H = None
        self.z: E = None
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: H = None
        self.s: I = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: E = None
        self.w: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.u: D = None
        self.v: C = None
        self.s: A = None
        self.q: I = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.p: F = None
        self.z: B = None
        self.txt = txt

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

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

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

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