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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.q: A = None
        self.p: F = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.o: G = None
        self.x: B = None
        self.q: D = None
        self.u: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: F = None
        self.z: B = None
        self.o: C = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: A = None
        self.q: G = None
        self.u: D = None
        self.y: E = None
        self.v: A = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: J = None
        self.q: A = None
        self.p: F = None
        self.r: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.o: G = None
        self.x: B = None
        self.q: D = None
        self.u: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: F = None
        self.z: B = None
        self.o: C = None
        self.s: F = None
        self.x: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: A = None
        self.q: G = None
        self.u: D = None
        self.y: E = None
        self.v: A = None
        self.o: G = None
        self.txt = txt

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

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