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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: H = None
        self.o: E = None
        self.u: F = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: H = None
        self.x: C = None
        self.o: F = None
        self.y: F = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: D = None
        self.r: E = None
        self.x: A = None
        self.p: A = None
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: H = None
        self.o: E = None
        self.u: F = None
        self.p: E = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: H = None
        self.x: C = None
        self.o: F = None
        self.y: F = None
        self.v: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: D = None
        self.r: E = None
        self.x: A = None
        self.p: A = None
        self.u: E = None
        self.txt = txt

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

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