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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.w: C = None
        self.v: G = None
        self.x: B = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.r: E = None
        self.s: E = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: D = None
        self.w: C = None
        self.v: G = None
        self.x: B = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: D = None
        self.r: E = None
        self.s: E = None
        self.p: E = None
        self.w: C = None
        self.txt = txt

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

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