class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: F = None
        self.w: C = None
        self.u: D = None
        self.p: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: I = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: B = None
        self.u: C = None
        self.w: G = None
        self.o: H = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: G = None
        self.z: H = None
        self.y: F = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: A = None
        self.z: G = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: I = None
        self.q: F = None
        self.w: C = None
        self.u: D = None
        self.p: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: I = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: B = None
        self.u: C = None
        self.w: G = None
        self.o: H = None
        self.r: G = None
        self.v: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.w: G = None
        self.z: H = None
        self.y: F = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.r: A = None
        self.z: G = None
        self.o: A = None
        self.txt = txt

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

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