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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.s: E = None
        self.t: A = None
        self.z: E = 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.t: A = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

a = A("a")
e = B("e")
n = C("n")
h = D("h")
m = E("m")
k = F("k")
j = G("j")
i = D("i")
g = A("g")

a.s = k
a.q = k
a.t = j
a.z = j
e.v = j
e.x = m
e.s = m
e.z = m
e.t = a
n.q = m
h.t = a
h.q = e
m.v = k
m.s = j
k.s = e
k.o = e
k.z = i
k.v = a
k.x = m
j.o = k
i.t = g
i.q = e
g.s = k
g.q = k
g.t = j
g.z = j
assert g.s.o.v.o.o.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: F = None
        self.t: G = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.s: E = None
        self.t: A = None
        self.z: E = 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.t: A = None
        self.q: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

a = A("a")
e = B("e")
n = C("n")
h = D("h")
m = E("m")
k = F("k")
j = G("j")
i = D("i")
g = A("g")

a.s = k
a.q = k
a.t = j
a.z = j
e.v = j
e.x = m
e.s = m
e.z = m
e.t = a
n.q = m
h.t = a
h.q = e
m.v = k
m.s = j
k.s = e
k.o = e
k.z = i
k.v = a
k.x = m
j.o = k
i.t = g
i.q = e
g.s = k
g.q = k
g.t = j
g.z = j
assert g.s.o.v.o.o.v.o.txt == "k"