class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: I = None
        self.q: D = None
        self.v: A = None
        self.r: H = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: E = None
        self.r: G = None
        self.w: A = None
        self.p: D = None
        self.t: D = None
        self.z: H = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: A = None
        self.x: F = None
        self.u: F = None
        self.z: C = None
        self.p: H = None
        self.r: C = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: E = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: I = None
        self.q: D = None
        self.v: A = None
        self.r: H = None
        self.w: D = None
        self.x: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: E = None
        self.r: G = None
        self.w: A = None
        self.p: D = None
        self.t: D = None
        self.z: H = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: G = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: I = None
        self.v: A = None
        self.x: F = None
        self.u: F = None
        self.z: C = None
        self.p: H = None
        self.r: C = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.y: E = None
        self.z: C = None
        self.v: B = None
        self.txt = txt

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

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

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