class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.s: D = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

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

g = A("g")
i = B("i")
a = C("a")
k = D("k")
f = E("f")
b = F("b")
d = G("d")

g.q = k
g.y = i
g.o = i
i.w = k
i.r = f
i.v = d
i.u = b
i.s = b
i.x = a
a.z = i
a.s = g
k.y = b
f.x = i
f.y = i
f.p = i
f.q = i
f.s = i
f.u = b
f.z = a
b.q = i
b.w = k
b.s = k
b.t = k
b.r = g
d.y = g
d.w = g
d.q = g
d.z = f
d.s = b
assert k.y.r.y.v.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: B = None
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: D = None
        self.s: D = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

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

g = A("g")
i = B("i")
a = C("a")
k = D("k")
f = E("f")
b = F("b")
d = G("d")

g.q = k
g.y = i
g.o = i
i.w = k
i.r = f
i.v = d
i.u = b
i.s = b
i.x = a
a.z = i
a.s = g
k.y = b
f.x = i
f.y = i
f.p = i
f.q = i
f.s = i
f.u = b
f.z = a
b.q = i
b.w = k
b.s = k
b.t = k
b.r = g
d.y = g
d.w = g
d.q = g
d.z = f
d.s = b
assert k.y.r.y.v.s.r.txt == "g"