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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: C = None
        self.t: B = None
        self.w: C = None
        self.s: A = None
        self.o: G = None
        self.y: I = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: F = None
        self.y: A = None
        self.r: G = None
        self.o: E = None
        self.w: A = None
        self.x: D = None
        self.s: G = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: C = None
        self.t: B = None
        self.w: C = None
        self.s: A = None
        self.o: G = None
        self.y: I = None
        self.r: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: F = None
        self.y: A = None
        self.r: G = None
        self.o: E = None
        self.w: A = None
        self.x: D = None
        self.s: G = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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