class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: F = None
        self.q: D = None
        self.y: D = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: D = None
        self.w: F = None
        self.r: E = None
        self.v: D = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.q: F = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.v: F = None
        self.y: C = None
        self.p: F = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: D = None
        self.w: F = None
        self.r: E = None
        self.v: D = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: B = None
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: C = None
        self.q: F = None
        self.z: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.v: F = None
        self.y: C = None
        self.p: F = None
        self.w: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: F = None
        self.o: E = None
        self.u: D = None
        self.txt = txt

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

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

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