class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: B = None
        self.u: B = None
        self.p: G = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: F = None
        self.z: H = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: C = None
        self.z: C = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: F = None
        self.z: H = None
        self.s: E = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: C = None
        self.z: C = None
        self.u: A = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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