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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: E = None
        self.w: E = None
        self.v: F = None
        self.t: D = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.o: A = None
        self.s: D = None
        self.q: G = None
        self.z: H = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: D = None
        self.q: C = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: E = None
        self.w: E = None
        self.v: F = None
        self.t: D = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.o: A = None
        self.s: D = None
        self.q: G = None
        self.z: H = None
        self.y: C = None
        self.p: A = None
        self.txt = txt

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

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