class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: H = None
        self.o: F = None
        self.x: G = None
        self.t: E = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.p: B = None
        self.o: J = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.s: B = None
        self.q: A = None
        self.w: B = None
        self.o: J = None
        self.p: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.p: B = None
        self.o: J = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.s: B = None
        self.q: A = None
        self.w: B = None
        self.o: J = None
        self.p: C = None
        self.txt = txt

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

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

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

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