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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.o: A = None
        self.z: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: B = None
        self.o: A = None
        self.z: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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