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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: D = None
        self.s: C = None
        self.v: A = None
        self.t: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.o: H = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.q: F = None
        self.o: C = None
        self.x: A = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.q: F = None
        self.p: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: D = None
        self.s: C = None
        self.v: A = None
        self.t: G = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.o: H = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.q: F = None
        self.o: C = None
        self.x: A = None
        self.p: B = None
        self.txt = txt

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

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