class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: C = None
        self.v: D = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.o: F = None
        self.q: H = None
        self.v: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.o: G = None
        self.u: A = None
        self.t: J = None
        self.v: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.s: H = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: C = None
        self.u: G = None
        self.x: F = None
        self.w: G = None
        self.v: A = None
        self.s: A = None
        self.z: J = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: J = None
        self.w: H = None
        self.y: B = None
        self.p: I = None
        self.z: G = None
        self.q: A = None
        self.x: C = None
        self.u: H = None
        self.o: J = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: D = None
        self.o: F = None
        self.q: H = None
        self.v: C = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: D = None
        self.o: G = None
        self.u: A = None
        self.t: J = None
        self.v: G = None
        self.y: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.s: H = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: C = None
        self.u: G = None
        self.x: F = None
        self.w: G = None
        self.v: A = None
        self.s: A = None
        self.z: J = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: J = None
        self.w: H = None
        self.y: B = None
        self.p: I = None
        self.z: G = None
        self.q: A = None
        self.x: C = None
        self.u: H = None
        self.o: J = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

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