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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: J = None
        self.r: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: I = None
        self.t: G = None
        self.p: G = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: A = None
        self.r: A = None
        self.t: G = None
        self.x: D = None
        self.o: A = None
        self.s: J = None
        self.y: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: I = None
        self.p: I = None
        self.t: C = None
        self.q: C = None
        self.y: D = None
        self.u: H = None
        self.txt = txt

h = A("h")
k = B("k")
m = C("m")
l = D("l")
b = E("b")
f = F("f")
e = G("e")
c = H("c")
g = I("g")
a = J("a")

h.r = c
h.y = l
h.u = l
h.t = k
h.x = g
k.w = l
m.y = b
m.p = c
m.o = k
m.t = k
m.s = f
m.x = a
m.u = h
l.q = m
l.o = a
l.r = a
b.v = f
b.x = c
f.w = g
f.x = g
f.t = e
f.p = e
f.y = b
e.v = l
e.x = l
e.o = b
c.p = b
c.u = h
c.r = h
c.o = h
c.t = e
c.x = l
c.s = a
c.y = m
g.p = l
a.s = m
a.t = m
a.q = m
a.v = g
a.p = g
a.y = l
a.u = c
assert m.x.p.p.r.p.p.o.v.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: D = None
        self.t: B = None
        self.u: D = None
        self.x: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: J = None
        self.r: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.x: I = None
        self.t: G = None
        self.p: G = None
        self.y: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: E = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: A = None
        self.r: A = None
        self.t: G = None
        self.x: D = None
        self.o: A = None
        self.s: J = None
        self.y: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: I = None
        self.p: I = None
        self.t: C = None
        self.q: C = None
        self.y: D = None
        self.u: H = None
        self.txt = txt

h = A("h")
k = B("k")
m = C("m")
l = D("l")
b = E("b")
f = F("f")
e = G("e")
c = H("c")
g = I("g")
a = J("a")

h.r = c
h.y = l
h.u = l
h.t = k
h.x = g
k.w = l
m.y = b
m.p = c
m.o = k
m.t = k
m.s = f
m.x = a
m.u = h
l.q = m
l.o = a
l.r = a
b.v = f
b.x = c
f.w = g
f.x = g
f.t = e
f.p = e
f.y = b
e.v = l
e.x = l
e.o = b
c.p = b
c.u = h
c.r = h
c.o = h
c.t = e
c.x = l
c.s = a
c.y = m
g.p = l
a.s = m
a.t = m
a.q = m
a.v = g
a.p = g
a.y = l
a.u = c
assert m.x.p.p.r.p.p.o.v.p.q.txt == "m"