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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.s: A = None
        self.p: B = None
        self.t: F = None
        self.q: J = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.x: C = None
        self.p: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: A = None
        self.t: J = None
        self.v: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.r: G = None
        self.v: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.w: F = None
        self.s: A = None
        self.p: B = None
        self.t: F = None
        self.q: J = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: D = None
        self.x: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: A = None
        self.x: C = None
        self.p: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: A = None
        self.t: J = None
        self.v: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: C = None
        self.r: G = None
        self.v: D = None
        self.txt = txt

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

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