class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: J = None
        self.u: C = None
        self.o: C = None
        self.p: H = None
        self.t: E = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.r: I = None
        self.v: B = None
        self.q: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: H = None
        self.q: J = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.s: G = None
        self.x: H = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: J = None
        self.u: C = None
        self.o: C = None
        self.p: H = None
        self.t: E = None
        self.z: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.r: I = None
        self.v: B = None
        self.q: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: H = None
        self.q: J = None
        self.x: C = None
        self.p: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.s: G = None
        self.x: H = None
        self.w: G = None
        self.txt = txt

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

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

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