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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.t: H = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: D = None
        self.x: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.t: H = None
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: I = None
        self.v: D = None
        self.x: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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