class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: H = None
        self.y: F = None
        self.s: B = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: G = None
        self.w: D = None
        self.u: A = None
        self.p: A = None
        self.x: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: G = None
        self.w: D = None
        self.u: A = None
        self.p: A = None
        self.x: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: D = None
        self.x: B = None
        self.txt = txt

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

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

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