class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.x: G = None
        self.y: F = None
        self.z: B = None
        self.s: J = None
        self.u: G = None
        self.v: F = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: A = None
        self.p: J = None
        self.s: D = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: H = None
        self.o: B = None
        self.u: I = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: B = None
        self.z: E = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.w: E = None
        self.y: D = None
        self.txt = txt

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

n = A("n")
c = B("c")
e = C("e")
a = D("a")
g = E("g")
b = F("b")
f = G("f")
j = H("j")
i = I("i")
h = J("h")

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

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

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: G = None
        self.x: G = None
        self.y: F = None
        self.z: B = None
        self.s: J = None
        self.u: G = None
        self.v: F = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: A = None
        self.p: J = None
        self.s: D = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: H = None
        self.o: B = None
        self.u: I = None
        self.w: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: B = None
        self.z: E = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.z: C = None
        self.w: E = None
        self.y: D = None
        self.txt = txt

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

n = A("n")
c = B("c")
e = C("e")
a = D("a")
g = E("g")
b = F("b")
f = G("f")
j = H("j")
i = I("i")
h = J("h")

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