class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.p: C = None
        self.z: F = None
        self.s: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.t: H = None
        self.r: I = None
        self.w: D = None
        self.s: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: J = None
        self.x: B = None
        self.w: B = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: J = None
        self.t: H = None
        self.r: I = None
        self.w: D = None
        self.s: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: J = None
        self.x: B = None
        self.w: B = None
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

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