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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: A = None
        self.w: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: C = None
        self.txt = txt

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

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

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