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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: E = None
        self.z: H = None
        self.v: D = None
        self.r: D = None
        self.w: F = None
        self.y: J = None
        self.s: I = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.w: C = None
        self.v: H = None
        self.t: H = None
        self.u: A = None
        self.x: C = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: G = None
        self.r: C = None
        self.q: J = None
        self.u: B = None
        self.v: H = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.q: A = None
        self.o: F = None
        self.r: F = None
        self.u: A = None
        self.y: B = None
        self.w: E = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.v: E = None
        self.t: J = None
        self.r: E = None
        self.z: B = None
        self.x: H = None
        self.txt = txt

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

m = A("m")
l = B("l")
j = C("j")
d = D("d")
k = E("k")
c = F("c")
n = G("n")
e = H("e")
f = I("f")
i = J("i")

m.q = e
m.u = l
l.t = n
l.x = k
l.z = e
l.v = d
l.r = d
l.w = c
l.o = c
l.y = i
l.s = f
j.s = n
j.v = n
j.w = f
d.s = l
k.z = c
k.q = j
k.w = j
k.x = j
k.v = e
k.t = e
k.u = m
k.p = f
c.p = j
c.r = j
c.z = n
c.o = n
c.q = i
c.u = l
c.v = e
n.v = i
n.q = m
n.u = m
n.o = c
n.r = c
n.y = l
n.t = l
n.w = k
n.z = j
e.u = l
e.w = l
e.z = l
e.r = l
f.u = c
f.o = j
f.v = k
f.r = k
f.t = i
f.z = l
f.x = e
i.u = j
i.s = d
i.r = l
i.o = c
i.t = k
assert i.t.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: E = None
        self.z: H = None
        self.v: D = None
        self.r: D = None
        self.w: F = None
        self.y: J = None
        self.s: I = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: C = None
        self.w: C = None
        self.v: H = None
        self.t: H = None
        self.u: A = None
        self.x: C = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: G = None
        self.r: C = None
        self.q: J = None
        self.u: B = None
        self.v: H = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: J = None
        self.q: A = None
        self.o: F = None
        self.r: F = None
        self.u: A = None
        self.y: B = None
        self.w: E = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.z: B = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: C = None
        self.v: E = None
        self.t: J = None
        self.r: E = None
        self.z: B = None
        self.x: H = None
        self.txt = txt

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

m = A("m")
l = B("l")
j = C("j")
d = D("d")
k = E("k")
c = F("c")
n = G("n")
e = H("e")
f = I("f")
i = J("i")

m.q = e
m.u = l
l.t = n
l.x = k
l.z = e
l.v = d
l.r = d
l.w = c
l.o = c
l.y = i
l.s = f
j.s = n
j.v = n
j.w = f
d.s = l
k.z = c
k.q = j
k.w = j
k.x = j
k.v = e
k.t = e
k.u = m
k.p = f
c.p = j
c.r = j
c.z = n
c.o = n
c.q = i
c.u = l
c.v = e
n.v = i
n.q = m
n.u = m
n.o = c
n.r = c
n.y = l
n.t = l
n.w = k
n.z = j
e.u = l
e.w = l
e.z = l
e.r = l
f.u = c
f.o = j
f.v = k
f.r = k
f.t = i
f.z = l
f.x = e
i.u = j
i.s = d
i.r = l
i.o = c
i.t = k
assert i.t.x.w.txt == "f"