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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.x: A = None
        self.t: B = None
        self.r: A = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: I = None
        self.r: F = None
        self.z: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: F = None
        self.x: A = None
        self.t: B = None
        self.r: A = None
        self.o: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: B = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: I = None
        self.r: F = None
        self.z: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: F = None
        self.txt = txt

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

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