class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: H = None
        self.y: F = None
        self.r: F = None
        self.p: H = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: G = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: F = None
        self.z: J = None
        self.q: A = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.p: D = None
        self.x: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: G = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: F = None
        self.z: J = None
        self.q: A = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.p: D = None
        self.x: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: H = None
        self.txt = txt

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

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

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