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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: H = None
        self.y: A = None
        self.z: C = None
        self.v: G = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.r: H = None
        self.t: A = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: A = None
        self.p: E = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: H = None
        self.y: A = None
        self.z: C = None
        self.v: G = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: C = None
        self.r: H = None
        self.t: A = None
        self.w: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: A = None
        self.p: E = None
        self.x: E = None
        self.z: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: F = None
        self.p: D = None
        self.txt = txt

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

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