class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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