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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: H = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: H = None
        self.u: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.q: H = None
        self.r: J = None
        self.txt = txt

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

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

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

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

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

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