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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.u: E = None
        self.v: C = None
        self.z: C = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

n = A("n")
i = B("i")
a = C("a")
d = D("d")
e = E("e")
c = F("c")
f = G("f")
j = C("j")

n.s = c
n.x = c
n.q = i
n.y = i
n.v = i
i.x = f
a.s = n
d.t = f
d.p = n
d.w = n
d.q = e
d.v = c
e.q = d
e.t = f
c.o = j
f.r = n
f.y = c
f.u = e
f.x = e
f.q = e
f.v = j
f.z = a
j.s = n
assert e.q.v.o.s.x.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: B = None
        self.y: B = None
        self.x: F = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.u: E = None
        self.v: C = None
        self.z: C = None
        self.x: E = None
        self.q: E = None
        self.txt = txt

n = A("n")
i = B("i")
a = C("a")
d = D("d")
e = E("e")
c = F("c")
f = G("f")
j = C("j")

n.s = c
n.x = c
n.q = i
n.y = i
n.v = i
i.x = f
a.s = n
d.t = f
d.p = n
d.w = n
d.q = e
d.v = c
e.q = d
e.t = f
c.o = j
f.r = n
f.y = c
f.u = e
f.x = e
f.q = e
f.v = j
f.z = a
j.s = n
assert e.q.v.o.s.x.o.s.txt == "n"