class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.q: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: F = None
        self.v: B = None
        self.q: G = None
        self.u: G = None
        self.w: F = None
        self.p: B = None
        self.y: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: G = None
        self.x: F = None
        self.t: J = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: F = None
        self.q: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: F = None
        self.v: B = None
        self.q: G = None
        self.u: G = None
        self.w: F = None
        self.p: B = None
        self.y: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: G = None
        self.x: F = None
        self.t: J = None
        self.txt = txt

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

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

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