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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.q: G = None
        self.x: B = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.q: G = None
        self.x: B = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: E = None
        self.txt = txt

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

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