class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.s: F = None
        self.o: J = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: G = None
        self.p: F = None
        self.x: B = None
        self.u: J = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: D = None
        self.q: J = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.q: D = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.o: D = None
        self.t: A = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.s: F = None
        self.o: J = None
        self.w: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: G = None
        self.p: F = None
        self.x: B = None
        self.u: J = None
        self.w: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: J = None
        self.t: D = None
        self.q: J = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: A = None
        self.q: D = None
        self.w: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.o: D = None
        self.t: A = None
        self.p: A = None
        self.u: F = None
        self.txt = txt

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

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

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