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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.q: A = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: B = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: G = None
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: I = None
        self.y: E = None
        self.w: H = None
        self.q: H = None
        self.r: I = None
        self.s: H = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: F = None
        self.q: A = None
        self.t: D = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: B = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: G = None
        self.q: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: I = None
        self.y: E = None
        self.w: H = None
        self.q: H = None
        self.r: I = None
        self.s: H = None
        self.x: B = None
        self.txt = txt

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

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