class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: F = None
        self.v: H = None
        self.z: B = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: C = None
        self.v: C = None
        self.p: A = None
        self.s: G = None
        self.o: G = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.y: F = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.x: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: C = None
        self.v: C = None
        self.p: A = None
        self.s: G = None
        self.o: G = None
        self.u: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: C = None
        self.y: F = None
        self.s: B = None
        self.txt = txt

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

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