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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.q: F = None
        self.t: G = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.v: D = None
        self.u: C = None
        self.y: C = None
        self.z: F = None
        self.txt = txt

f = A("f")
m = B("m")
n = C("n")
h = D("h")
i = E("i")
b = F("b")
g = G("g")
a = F("a")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.q: F = None
        self.t: G = None
        self.v: E = None
        self.u: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: B = None
        self.x: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.v: D = None
        self.u: C = None
        self.y: C = None
        self.z: F = None
        self.txt = txt

f = A("f")
m = B("m")
n = C("n")
h = D("h")
i = E("i")
b = F("b")
g = G("g")
a = F("a")
c = D("c")

f.s = c
f.q = c
f.y = c
f.t = m
f.o = n
m.w = f
m.p = h
m.q = a
m.t = g
m.u = g
m.v = i
n.u = i
n.r = h
n.y = m
n.s = b
n.w = a
n.x = g
n.t = g
h.z = f
h.w = g
h.x = g
i.q = m
i.t = m
i.x = n
b.r = f
g.w = b
g.x = b
g.z = b
g.v = c
g.u = n
g.y = n
a.r = f
c.z = f
c.w = g
c.x = g
assert c.w.w.r.txt == "f"