class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.q: I = None
        self.o: E = None
        self.s: B = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.r: I = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.q: I = None
        self.o: E = None
        self.s: B = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.r: I = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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