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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: G = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: B = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: I = None
        self.o: H = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.w: G = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.v: B = None
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: I = None
        self.o: H = None
        self.s: D = None
        self.txt = txt

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

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

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

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