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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.x: F = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: H = None
        self.o: F = None
        self.z: C = None
        self.w: C = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.p: G = None
        self.y: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.x: F = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.v: G = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: H = None
        self.o: F = None
        self.z: C = None
        self.w: C = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.p: G = None
        self.y: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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