class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: J = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: G = None
        self.w: G = None
        self.y: D = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.r: G = None
        self.o: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: H = None
        self.w: B = None
        self.q: A = None
        self.z: A = None
        self.s: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: B = None
        self.y: F = None
        self.x: D = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: G = None
        self.w: G = None
        self.y: D = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: A = None
        self.r: G = None
        self.o: C = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: H = None
        self.w: B = None
        self.q: A = None
        self.z: A = None
        self.s: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: B = None
        self.y: F = None
        self.x: D = None
        self.z: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.txt = txt

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

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