class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.p: H = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: F = None
        self.u: H = None
        self.w: I = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.q: B = None
        self.p: H = None
        self.t: B = None
        self.s: D = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: A = None
        self.p: H = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: F = None
        self.u: H = None
        self.w: I = None
        self.r: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.q: B = None
        self.p: H = None
        self.t: B = None
        self.s: D = None
        self.x: E = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: F = None
        self.txt = txt

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

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