class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: G = None
        self.txt = txt

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

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

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

f.z = g
f.v = l
a.s = g
a.y = g
e.r = m
l.z = g
l.s = g
l.v = a
l.o = a
l.u = i
m.v = f
m.z = g
i.y = l
i.o = l
i.q = l
i.u = f
i.v = e
i.z = m
g.q = a
g.u = f
g.z = m
assert f.z.u.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: G = None
        self.txt = txt

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

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

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

f.z = g
f.v = l
a.s = g
a.y = g
e.r = m
l.z = g
l.s = g
l.v = a
l.o = a
l.u = i
m.v = f
m.z = g
i.y = l
i.o = l
i.q = l
i.u = f
i.v = e
i.z = m
g.q = a
g.u = f
g.z = m
assert f.z.u.z.u.txt == "f"