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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.y: F = None
        self.s: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: I = None
        self.z: I = None
        self.u: B = None
        self.w: E = None
        self.s: E = None
        self.q: F = None
        self.p: C = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: D = None
        self.s: C = None
        self.z: E = None
        self.y: I = None
        self.r: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.u: E = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: C = None
        self.y: F = None
        self.s: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: I = None
        self.z: I = None
        self.u: B = None
        self.w: E = None
        self.s: E = None
        self.q: F = None
        self.p: C = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: D = None
        self.s: C = None
        self.z: E = None
        self.y: I = None
        self.r: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: F = None
        self.u: E = None
        self.p: C = None
        self.txt = txt

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

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