class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.s: F = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.o: A = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: D = None
        self.s: B = None
        self.t: I = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: E = None
        self.v: F = None
        self.s: D = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.s: F = None
        self.x: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.o: A = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: D = None
        self.s: B = None
        self.t: I = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: E = None
        self.v: F = None
        self.s: D = None
        self.w: A = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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