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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: H = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: E = None
        self.t: J = None
        self.z: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: H = None
        self.v: I = None
        self.q: I = None
        self.s: I = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.q: E = None
        self.w: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.w: A = None
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: H = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: G = None
        self.o: B = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: E = None
        self.t: J = None
        self.z: A = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: H = None
        self.v: I = None
        self.q: I = None
        self.s: I = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.q: E = None
        self.w: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.w: A = None
        self.x: F = None
        self.txt = txt

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

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

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