class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: H = None
        self.o: F = None
        self.y: F = None
        self.r: H = None
        self.q: C = None
        self.t: J = None
        self.s: C = None
        self.p: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: I = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: I = None
        self.r: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: B = None
        self.v: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: G = None
        self.y: B = None
        self.txt = txt

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

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

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

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