class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: F = None
        self.u: C = None
        self.t: H = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: H = None
        self.s: A = None
        self.t: H = None
        self.p: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: J = None
        self.w: J = None
        self.p: A = None
        self.x: B = None
        self.u: J = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.x: D = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: I = None
        self.q: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: H = None
        self.s: A = None
        self.t: H = None
        self.p: F = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: H = None
        self.o: J = None
        self.w: J = None
        self.p: A = None
        self.x: B = None
        self.u: J = None
        self.s: I = None
        self.t: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: B = None
        self.x: D = None
        self.y: E = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: I = None
        self.q: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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