class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: G = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: D = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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