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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.x: A = None
        self.s: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.v: E = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.u: B = None
        self.x: A = None
        self.s: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.v: E = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.v: B = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: D = None
        self.txt = txt

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

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

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