class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.z: D = None
        self.o: G = None
        self.y: A = None
        self.v: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: F = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.r: D = None
        self.p: F = None
        self.s: D = None
        self.y: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: D = None
        self.z: D = None
        self.o: G = None
        self.y: A = None
        self.v: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: F = None
        self.s: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: C = None
        self.r: D = None
        self.p: F = None
        self.s: D = None
        self.y: H = None
        self.txt = txt

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

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

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