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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: A = None
        self.u: D = None
        self.t: D = None
        self.p: A = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

j = A("j")
h = B("h")
f = C("f")
d = D("d")
c = E("c")
k = F("k")
n = G("n")
g = H("g")
m = F("m")

j.z = n
j.y = n
h.o = n
h.r = n
h.s = c
h.z = c
f.p = h
f.o = h
d.x = g
d.u = g
d.p = f
c.u = h
k.y = m
k.q = h
k.v = c
n.s = g
n.q = g
n.o = j
n.p = j
n.u = d
n.t = d
n.z = k
g.v = f
g.u = c
g.y = d
m.y = k
m.q = h
m.v = c
assert n.z.v.u.r.t.p.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.s: E = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: A = None
        self.u: D = None
        self.t: D = None
        self.p: A = None
        self.q: H = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.y: D = None
        self.txt = txt

j = A("j")
h = B("h")
f = C("f")
d = D("d")
c = E("c")
k = F("k")
n = G("n")
g = H("g")
m = F("m")

j.z = n
j.y = n
h.o = n
h.r = n
h.s = c
h.z = c
f.p = h
f.o = h
d.x = g
d.u = g
d.p = f
c.u = h
k.y = m
k.q = h
k.v = c
n.s = g
n.q = g
n.o = j
n.p = j
n.u = d
n.t = d
n.z = k
g.v = f
g.u = c
g.y = d
m.y = k
m.q = h
m.v = c
assert n.z.v.u.r.t.p.o.o.txt == "n"