class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.t: B = None
        self.u: E = None
        self.y: G = None
        self.s: E = None
        self.z: C = None
        self.o: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.p: I = None
        self.u: C = None
        self.z: J = None
        self.w: B = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: A = None
        self.q: B = None
        self.x: J = None
        self.o: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.t: B = None
        self.u: E = None
        self.y: G = None
        self.s: E = None
        self.z: C = None
        self.o: I = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.p: I = None
        self.u: C = None
        self.z: J = None
        self.w: B = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: D = None
        self.p: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: A = None
        self.q: B = None
        self.x: J = None
        self.o: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: A = None
        self.txt = txt

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

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