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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: D = None
        self.o: A = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.v: D = None
        self.o: A = None
        self.w: D = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: F = None
        self.t: G = None
        self.txt = txt

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

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

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

b.z = c
b.q = c
b.v = i
b.s = i
c.z = g
c.v = l
c.w = l
c.o = b
c.y = b
i.p = e
i.o = l
i.y = l
i.z = j
l.s = g
l.w = g
l.r = c
l.z = c
l.y = c
l.t = e
e.q = j
e.t = j
e.z = g
g.v = i
g.z = c
j.y = g
j.o = i
j.q = c
assert l.w.z.o.txt == "b"