class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.o: D = None
        self.v: E = None
        self.s: B = None
        self.t: G = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.v: E = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.v: E = None
        self.s: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

i.z = f
i.s = f
i.y = f
i.o = d
i.v = l
i.t = a
f.w = g
f.o = g
f.v = l
f.s = i
g.y = d
g.q = l
d.x = e
d.z = e
d.y = i
l.z = f
l.s = g
e.q = d
e.x = i
e.o = a
a.w = i
b.x = e
b.z = e
b.y = i
assert g.y.z.q.z.o.txt == "a"