class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.x: G = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: H = None
        self.z: G = None
        self.t: F = None
        self.o: E = None
        self.r: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: I = None
        self.q: J = None
        self.y: H = None
        self.o: J = None
        self.t: H = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: H = None
        self.z: G = None
        self.t: F = None
        self.o: E = None
        self.r: A = None
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: I = None
        self.q: J = None
        self.y: H = None
        self.o: J = None
        self.t: H = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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