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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.y: F = None
        self.u: E = None
        self.s: E = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.y: F = None
        self.u: E = None
        self.s: E = None
        self.p: B = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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