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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.o: E = None
        self.r: D = None
        self.q: J = None
        self.x: D = None
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: G = None
        self.p: C = None
        self.r: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: A = None
        self.o: E = None
        self.r: D = None
        self.q: J = None
        self.x: D = None
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: G = None
        self.p: C = None
        self.r: H = None
        self.txt = txt

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

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