class A:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: F = None
        self.r: I = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: G = None
        self.u: D = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: H = None
        self.z: D = None
        self.w: C = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.t: E = None
        self.y: A = None
        self.p: I = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: G = None
        self.u: D = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.q: H = None
        self.z: D = None
        self.w: C = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.t: E = None
        self.y: A = None
        self.p: I = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: H = None
        self.txt = txt

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

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