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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: C = None
        self.z: A = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: G = None
        self.z: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.r: F = None
        self.y: F = None
        self.q: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: C = None
        self.z: A = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: G = None
        self.z: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.r: F = None
        self.y: F = None
        self.q: H = None
        self.txt = txt

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

k.w = d
d.w = e
d.o = b
d.z = k
d.v = a
b.y = i
i.o = j
i.w = e
i.z = m
l.s = d
l.y = a
g.q = k
e.w = a
e.y = d
e.s = b
a.z = b
a.u = g
j.r = m
j.q = k
m.x = g
m.r = g
m.y = g
m.w = i
m.q = a
assert k.w.w.w.z.y.txt == "i"