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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: D = None
        self.w: E = None
        self.y: J = None
        self.x: J = None
        self.v: F = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: A = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: B = None
        self.w: C = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: J = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: G = None
        self.s: J = None
        self.y: F = None
        self.o: B = None
        self.p: D = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: D = None
        self.q: F = None
        self.w: C = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.s: D = None
        self.w: E = None
        self.y: J = None
        self.x: J = None
        self.v: F = None
        self.r: J = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: A = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.r: B = None
        self.w: C = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: J = None
        self.w: B = None
        self.y: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: G = None
        self.s: J = None
        self.y: F = None
        self.o: B = None
        self.p: D = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: D = None
        self.q: F = None
        self.w: C = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

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

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