class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: H = None
        self.r: J = None
        self.z: F = None
        self.o: D = None
        self.w: C = None
        self.u: D = None
        self.y: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: C = None
        self.x: B = None
        self.t: H = None
        self.v: A = None
        self.u: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: D = None
        self.p: F = None
        self.y: E = None
        self.s: B = None
        self.x: J = None
        self.q: I = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: B = None
        self.t: B = None
        self.r: E = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.r: F = None
        self.s: G = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: C = None
        self.x: B = None
        self.t: H = None
        self.v: A = None
        self.u: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: D = None
        self.p: F = None
        self.y: E = None
        self.s: B = None
        self.x: J = None
        self.q: I = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: B = None
        self.t: B = None
        self.r: E = None
        self.z: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: C = None
        self.r: F = None
        self.s: G = None
        self.o: E = None
        self.txt = txt

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

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