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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: H = None
        self.w: H = None
        self.v: A = None
        self.p: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: G = None
        self.t: A = None
        self.y: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.r: B = None
        self.t: A = None
        self.w: G = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: E = None
        self.r: A = None
        self.p: C = None
        self.w: F = None
        self.s: F = None
        self.v: H = None
        self.u: H = None
        self.x: H = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: A = None
        self.y: D = None
        self.v: J = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: B = None
        self.z: A = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: H = None
        self.w: H = None
        self.v: A = None
        self.p: F = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: G = None
        self.t: A = None
        self.y: J = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: A = None
        self.r: B = None
        self.t: A = None
        self.w: G = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: J = None
        self.q: E = None
        self.r: A = None
        self.p: C = None
        self.w: F = None
        self.s: F = None
        self.v: H = None
        self.u: H = None
        self.x: H = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: A = None
        self.y: D = None
        self.v: J = None
        self.x: C = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: B = None
        self.z: A = None
        self.o: E = None
        self.t: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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