class A:
    def __init__(self, txt: str):
        self.s: J = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: G = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: H = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: G = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.q: H = None
        self.t: A = None
        self.w: D = None
        self.s: I = None
        self.y: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: C = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: G = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: J = None
        self.q: H = None
        self.p: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: G = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.q: H = None
        self.t: A = None
        self.w: D = None
        self.s: I = None
        self.y: J = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: C = None
        self.q: C = None
        self.w: A = None
        self.txt = txt

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

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