class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: F = None
        self.x: G = None
        self.r: E = None
        self.o: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.w: A = None
        self.t: A = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: B = None
        self.x: H = None
        self.o: F = None
        self.txt = txt

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

c = A("c")
f = B("f")
n = C("n")
d = D("d")
a = E("a")
g = F("g")
e = G("e")
b = H("b")
l = A("l")
h = D("h")

c.w = n
c.v = n
c.s = a
f.v = l
f.s = l
n.v = e
n.u = e
n.s = e
n.r = f
n.q = f
n.w = b
n.y = g
d.w = f
d.y = g
d.x = e
d.r = a
d.o = a
d.v = b
a.p = f
a.q = d
g.p = a
g.r = a
g.o = e
g.w = l
g.t = l
e.r = b
e.x = b
e.y = f
e.o = g
b.w = c
b.o = n
l.w = n
l.v = n
l.s = a
h.w = f
h.y = g
h.x = e
h.r = a
h.o = a
h.v = b
assert n.r.v.s.q.v.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: F = None
        self.x: G = None
        self.r: E = None
        self.o: E = None
        self.v: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: G = None
        self.w: A = None
        self.t: A = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: B = None
        self.x: H = None
        self.o: F = None
        self.txt = txt

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

c = A("c")
f = B("f")
n = C("n")
d = D("d")
a = E("a")
g = F("g")
e = G("e")
b = H("b")
l = A("l")
h = D("h")

c.w = n
c.v = n
c.s = a
f.v = l
f.s = l
n.v = e
n.u = e
n.s = e
n.r = f
n.q = f
n.w = b
n.y = g
d.w = f
d.y = g
d.x = e
d.r = a
d.o = a
d.v = b
a.p = f
a.q = d
g.p = a
g.r = a
g.o = e
g.w = l
g.t = l
e.r = b
e.x = b
e.y = f
e.o = g
b.w = c
b.o = n
l.w = n
l.v = n
l.s = a
h.w = f
h.y = g
h.x = e
h.r = a
h.o = a
h.v = b
assert n.r.v.s.q.v.o.w.txt == "b"