class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.o: B = None
        self.r: I = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: A = None
        self.o: B = None
        self.r: I = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.y: F = None
        self.q: F = None
        self.txt = txt

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

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