class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.o: G = None
        self.r: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: H = None
        self.p: H = None
        self.o: H = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: B = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.w: J = None
        self.x: E = None
        self.s: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: H = None
        self.p: H = None
        self.o: H = None
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: B = None
        self.o: D = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: H = None
        self.w: J = None
        self.x: E = None
        self.s: A = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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