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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: B = None
        self.q: A = None
        self.p: E = None
        self.z: A = None
        self.t: B = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: G = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: B = None
        self.q: A = None
        self.p: E = None
        self.z: A = None
        self.t: B = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: G = None
        self.o: C = None
        self.s: G = None
        self.txt = txt

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

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

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

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

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

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