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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.o: D = None
        self.r: D = None
        self.v: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

m = A("m")
d = B("d")
j = C("j")
c = D("c")
f = E("f")
n = F("n")
e = G("e")
g = C("g")
b = E("b")

m.v = g
d.v = j
j.q = f
j.o = g
j.t = n
c.t = d
c.z = j
f.u = n
f.t = n
f.z = e
f.o = c
f.r = c
f.v = m
n.s = d
e.q = b
g.q = b
g.o = j
g.t = n
b.u = n
b.t = n
b.z = e
b.o = c
b.r = c
b.v = m
assert j.t.s.v.q.t.s.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: G = None
        self.o: D = None
        self.r: D = None
        self.v: A = None
        self.t: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

m = A("m")
d = B("d")
j = C("j")
c = D("c")
f = E("f")
n = F("n")
e = G("e")
g = C("g")
b = E("b")

m.v = g
d.v = j
j.q = f
j.o = g
j.t = n
c.t = d
c.z = j
f.u = n
f.t = n
f.z = e
f.o = c
f.r = c
f.v = m
n.s = d
e.q = b
g.q = b
g.o = j
g.t = n
b.u = n
b.t = n
b.z = e
b.o = c
b.r = c
b.v = m
assert j.t.s.v.q.t.s.v.t.txt == "n"