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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.z: E = None
        self.y: F = None
        self.q: E = None
        self.x: G = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: H = None
        self.p: A = None
        self.x: A = None
        self.w: D = None
        self.u: A = None
        self.y: F = None
        self.z: H = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: H = None
        self.w: F = None
        self.q: G = None
        self.p: A = None
        self.v: A = None
        self.y: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: C = None
        self.t: I = None
        self.z: C = None
        self.v: E = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.z: E = None
        self.y: F = None
        self.q: E = None
        self.x: G = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.r: H = None
        self.p: A = None
        self.x: A = None
        self.w: D = None
        self.u: A = None
        self.y: F = None
        self.z: H = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: C = None
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: H = None
        self.w: F = None
        self.q: G = None
        self.p: A = None
        self.v: A = None
        self.y: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: C = None
        self.t: I = None
        self.z: C = None
        self.v: E = None
        self.o: B = None
        self.txt = txt

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

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