class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: F = None
        self.o: D = None
        self.w: H = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.v: C = None
        self.z: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: B = None
        self.p: B = None
        self.x: B = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.txt = txt

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

l = A("l")
a = B("a")
g = C("g")
b = D("b")
n = E("n")
f = F("f")
j = G("j")
d = H("d")
i = I("i")
h = J("h")

l.r = g
l.z = b
l.o = f
a.t = b
a.p = n
a.w = d
a.v = d
a.y = f
a.o = h
a.s = g
a.x = l
g.r = d
g.w = d
g.s = f
g.o = b
g.z = l
b.y = l
b.w = f
b.v = g
b.z = h
n.y = j
n.w = j
n.s = j
n.r = d
n.o = h
f.t = j
f.o = a
f.p = a
f.x = a
f.y = a
j.x = g
j.r = g
j.y = d
d.o = g
d.s = g
d.y = g
d.p = g
d.t = i
d.r = i
d.v = n
d.x = a
d.z = a
d.q = l
i.p = f
i.q = f
h.x = i
h.y = i
h.s = l
h.t = d
h.o = f
assert i.q.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: D = None
        self.o: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: F = None
        self.o: D = None
        self.w: H = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: F = None
        self.v: C = None
        self.z: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: B = None
        self.p: B = None
        self.x: B = None
        self.y: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: H = None
        self.r: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: F = None
        self.txt = txt

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

l = A("l")
a = B("a")
g = C("g")
b = D("b")
n = E("n")
f = F("f")
j = G("j")
d = H("d")
i = I("i")
h = J("h")

l.r = g
l.z = b
l.o = f
a.t = b
a.p = n
a.w = d
a.v = d
a.y = f
a.o = h
a.s = g
a.x = l
g.r = d
g.w = d
g.s = f
g.o = b
g.z = l
b.y = l
b.w = f
b.v = g
b.z = h
n.y = j
n.w = j
n.s = j
n.r = d
n.o = h
f.t = j
f.o = a
f.p = a
f.x = a
f.y = a
j.x = g
j.r = g
j.y = d
d.o = g
d.s = g
d.y = g
d.p = g
d.t = i
d.r = i
d.v = n
d.x = a
d.z = a
d.q = l
i.p = f
i.q = f
h.x = i
h.y = i
h.s = l
h.t = d
h.o = f
assert i.q.t.x.txt == "g"