class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.u: G = None
        self.t: G = None
        self.w: I = None
        self.z: F = None
        self.o: D = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: F = None
        self.y: D = None
        self.x: E = None
        self.s: F = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: A = None
        self.r: B = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: F = None
        self.y: D = None
        self.x: E = None
        self.s: F = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.u: A = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: A = None
        self.r: B = None
        self.o: D = None
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: A = None
        self.z: D = None
        self.txt = txt

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

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