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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.w: G = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: H = None
        self.t: B = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: B = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.w: G = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: H = None
        self.t: B = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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