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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.o: D = None
        self.v: J = None
        self.z: G = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.o: F = None
        self.v: A = None
        self.x: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.o: D = None
        self.v: J = None
        self.z: G = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: D = None
        self.o: F = None
        self.v: A = None
        self.x: G = None
        self.txt = txt

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

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