class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: G = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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