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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: E = None
        self.r: C = None
        self.q: F = None
        self.s: A = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

n = A("n")
j = B("j")
f = C("f")
b = D("b")
l = E("l")
i = F("i")
h = G("h")
k = B("k")
m = G("m")
d = A("d")

n.y = b
n.z = d
j.z = k
j.y = l
j.r = f
j.q = i
j.u = i
j.s = n
f.z = n
b.w = f
b.p = f
b.v = d
b.z = i
l.q = h
i.y = j
i.p = k
i.o = f
h.y = f
h.w = k
h.s = i
h.z = m
k.z = j
k.y = l
k.r = f
k.q = i
k.u = i
k.s = d
m.y = f
m.w = j
m.s = i
m.z = h
d.y = b
d.z = n
assert d.z.z.y.p.z.y.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: E = None
        self.r: C = None
        self.q: F = None
        self.s: A = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.s: F = None
        self.z: G = None
        self.txt = txt

n = A("n")
j = B("j")
f = C("f")
b = D("b")
l = E("l")
i = F("i")
h = G("h")
k = B("k")
m = G("m")
d = A("d")

n.y = b
n.z = d
j.z = k
j.y = l
j.r = f
j.q = i
j.u = i
j.s = n
f.z = n
b.w = f
b.p = f
b.v = d
b.z = i
l.q = h
i.y = j
i.p = k
i.o = f
h.y = f
h.w = k
h.s = i
h.z = m
k.z = j
k.y = l
k.r = f
k.q = i
k.u = i
k.s = d
m.y = f
m.w = j
m.s = i
m.z = h
d.y = b
d.z = n
assert d.z.z.y.p.z.y.w.z.txt == "n"