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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.t: C = None
        self.v: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: C = None
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: C = None
        self.t: C = None
        self.v: A = None
        self.p: B = None
        self.txt = txt

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

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