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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: G = None
        self.q: F = None
        self.z: B = None
        self.s: F = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: H = None
        self.q: C = None
        self.y: C = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: G = None
        self.q: F = None
        self.z: B = None
        self.s: F = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: H = None
        self.q: C = None
        self.y: C = None
        self.r: G = None
        self.txt = txt

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

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