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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: I = None
        self.q: D = None
        self.v: C = None
        self.t: A = None
        self.p: I = None
        self.u: D = None
        self.o: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: I = None
        self.q: D = None
        self.v: C = None
        self.t: A = None
        self.p: I = None
        self.u: D = None
        self.o: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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