class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.p: F = None
        self.t: B = None
        self.q: B = None
        self.o: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: I = None
        self.u: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: H = None
        self.q: H = None
        self.txt = txt

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

a = A("a")
g = B("g")
i = C("i")
f = D("f")
n = E("n")
l = F("l")
j = G("j")
d = H("d")
h = I("h")
e = J("e")

a.w = j
a.z = j
a.p = l
a.t = g
a.q = g
a.o = e
g.z = i
g.w = l
i.p = l
i.q = g
i.t = j
f.r = e
f.o = i
f.y = j
n.q = j
n.r = h
l.o = a
l.t = g
l.v = n
j.w = f
j.u = l
j.y = g
d.o = a
d.z = h
d.u = g
h.v = f
h.r = d
h.q = d
e.s = g
assert l.t.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: G = None
        self.p: F = None
        self.t: B = None
        self.q: B = None
        self.o: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.o: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.v: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: F = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: I = None
        self.u: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: H = None
        self.q: H = None
        self.txt = txt

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

a = A("a")
g = B("g")
i = C("i")
f = D("f")
n = E("n")
l = F("l")
j = G("j")
d = H("d")
h = I("h")
e = J("e")

a.w = j
a.z = j
a.p = l
a.t = g
a.q = g
a.o = e
g.z = i
g.w = l
i.p = l
i.q = g
i.t = j
f.r = e
f.o = i
f.y = j
n.q = j
n.r = h
l.o = a
l.t = g
l.v = n
j.w = f
j.u = l
j.y = g
d.o = a
d.z = h
d.u = g
h.v = f
h.r = d
h.q = d
e.s = g
assert l.t.w.t.txt == "g"