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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.u: H = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: B = None
        self.x: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: A = None
        self.u: H = None
        self.z: B = None
        self.y: A = None
        self.txt = txt

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

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