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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: F = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: H = None
        self.w: F = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: C = None
        self.y: B = None
        self.r: B = None
        self.p: H = None
        self.x: C = None
        self.s: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.z: G = None
        self.s: A = None
        self.r: B = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

k = A("k")
d = B("d")
j = C("j")
f = D("f")
l = E("l")
n = F("n")
h = G("h")
e = H("e")

k.y = e
k.p = l
d.o = l
d.v = n
d.t = n
d.w = e
j.z = l
j.q = l
j.p = e
j.w = n
f.x = k
l.z = n
l.w = j
l.x = j
l.y = d
l.r = d
l.s = d
l.o = d
l.p = e
n.x = f
n.y = e
h.x = j
e.w = d
e.r = d
e.y = d
e.t = k
e.s = k
e.z = h
e.q = j
assert f.x.y.q.q.p.w.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: F = None
        self.t: F = None
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: H = None
        self.w: F = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: C = None
        self.y: B = None
        self.r: B = None
        self.p: H = None
        self.x: C = None
        self.s: B = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.z: G = None
        self.s: A = None
        self.r: B = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

k = A("k")
d = B("d")
j = C("j")
f = D("f")
l = E("l")
n = F("n")
h = G("h")
e = H("e")

k.y = e
k.p = l
d.o = l
d.v = n
d.t = n
d.w = e
j.z = l
j.q = l
j.p = e
j.w = n
f.x = k
l.z = n
l.w = j
l.x = j
l.y = d
l.r = d
l.s = d
l.o = d
l.p = e
n.x = f
n.y = e
h.x = j
e.w = d
e.r = d
e.y = d
e.t = k
e.s = k
e.z = h
e.q = j
assert f.x.y.q.q.p.w.o.z.txt == "n"