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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: H = None
        self.q: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.o: A = None
        self.w: B = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.p: A = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: H = None
        self.q: G = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: D = None
        self.o: A = None
        self.w: B = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: A = None
        self.p: A = None
        self.z: F = None
        self.txt = txt

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

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