class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: G = None
        self.u: E = None
        self.w: E = None
        self.z: F = None
        self.v: D = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.z: G = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.x: E = None
        self.v: F = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: B = None
        self.z: G = None
        self.w: D = None
        self.u: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.q: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: C = None
        self.x: E = None
        self.v: F = None
        self.s: D = None
        self.txt = txt

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

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