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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

j = A("j")
k = B("k")
m = C("m")
g = D("g")
i = E("i")
n = F("n")
l = G("l")
h = H("h")
a = A("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

j = A("j")
k = B("k")
m = C("m")
g = D("g")
i = E("i")
n = F("n")
l = G("l")
h = H("h")
a = A("a")

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