class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.r: F = None
        self.o: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: C = None
        self.q: D = None
        self.s: E = None
        self.z: J = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: A = None
        self.v: I = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: F = None
        self.y: F = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.r: F = None
        self.o: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: C = None
        self.q: D = None
        self.s: E = None
        self.z: J = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: A = None
        self.v: I = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: F = None
        self.y: F = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

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

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