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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: A = None
        self.t: F = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

b.w = n
b.s = n
b.u = n
b.o = a
b.r = i
b.p = i
b.z = g
b.x = g
g.s = k
g.o = b
g.t = f
g.w = n
n.r = g
n.z = g
n.q = b
n.x = f
n.v = a
i.u = k
i.x = k
i.q = h
k.r = h
f.t = b
f.s = a
a.r = f
a.v = f
a.z = h
h.r = g
h.t = n
h.y = n
assert i.q.r.s.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: G = None
        self.r: D = None
        self.s: C = None
        self.p: D = None
        self.z: B = None
        self.u: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: A = None
        self.t: F = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: H = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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