class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.y: G = None
        self.x: E = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

h = A("h")
d = B("d")
c = C("c")
e = D("e")
n = E("n")
j = F("j")
b = G("b")
i = F("i")
k = G("k")
m = F("m")

h.o = n
h.x = n
h.v = e
h.y = b
h.q = k
d.x = e
d.y = m
d.v = j
d.u = c
c.q = n
e.z = d
e.u = k
n.o = h
n.x = h
n.y = k
n.p = d
n.r = e
n.v = c
j.s = h
j.q = b
j.w = m
b.r = n
i.s = h
i.q = b
i.w = m
k.r = n
m.s = h
m.q = b
m.w = j
assert b.r.y.r.p.v.w.w.w.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: D = None
        self.y: G = None
        self.x: E = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: F = None
        self.v: F = None
        self.u: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: G = None
        self.w: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

h = A("h")
d = B("d")
c = C("c")
e = D("e")
n = E("n")
j = F("j")
b = G("b")
i = F("i")
k = G("k")
m = F("m")

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