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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.w: F = None
        self.v: B = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: E = None
        self.v: J = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: D = None
        self.v: I = None
        self.s: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: J = None
        self.w: F = None
        self.v: B = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: E = None
        self.v: J = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: D = None
        self.v: I = None
        self.s: G = None
        self.txt = txt

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

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