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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.v: G = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: J = None
        self.x: I = None
        self.v: A = None
        self.r: J = None
        self.z: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

m = A("m")
n = B("n")
f = C("f")
c = D("c")
k = E("k")
j = F("j")
e = G("e")
h = H("h")
l = I("l")
b = J("b")

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.v: G = None
        self.t: E = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: J = None
        self.x: I = None
        self.v: A = None
        self.r: J = None
        self.z: A = None
        self.q: G = None
        self.txt = txt

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

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

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

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

m = A("m")
n = B("n")
f = C("f")
c = D("c")
k = E("k")
j = F("j")
e = G("e")
h = H("h")
l = I("l")
b = J("b")

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