class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: E = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: B = None
        self.t: H = None
        self.z: C = None
        self.y: H = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
e = C("e")
b = D("b")
g = E("g")
i = F("i")
k = G("k")
j = H("j")
n = E("n")
d = F("d")

a.o = j
a.x = g
a.v = n
m.x = b
m.q = e
m.s = d
e.r = a
e.s = m
e.z = m
e.p = m
e.q = b
e.v = d
b.x = j
b.t = j
b.y = j
b.w = m
b.z = e
b.q = d
g.p = n
i.v = b
i.r = e
k.q = a
k.z = a
k.y = d
k.r = b
k.x = b
k.u = j
k.o = i
j.w = b
j.z = i
j.u = i
j.r = d
j.v = a
j.p = n
j.y = e
n.p = g
d.v = b
d.r = e
assert n.p.p.p.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: E = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.w: B = None
        self.t: H = None
        self.z: C = None
        self.y: H = None
        self.q: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: C = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
e = C("e")
b = D("b")
g = E("g")
i = F("i")
k = G("k")
j = H("j")
n = E("n")
d = F("d")

a.o = j
a.x = g
a.v = n
m.x = b
m.q = e
m.s = d
e.r = a
e.s = m
e.z = m
e.p = m
e.q = b
e.v = d
b.x = j
b.t = j
b.y = j
b.w = m
b.z = e
b.q = d
g.p = n
i.v = b
i.r = e
k.q = a
k.z = a
k.y = d
k.r = b
k.x = b
k.u = j
k.o = i
j.w = b
j.z = i
j.u = i
j.r = d
j.v = a
j.p = n
j.y = e
n.p = g
d.v = b
d.r = e
assert n.p.p.p.p.p.p.txt == "n"