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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: A = None
        self.w: C = None
        self.r: E = None
        self.q: G = None
        self.v: E = None
        self.x: C = None
        self.o: D = None
        self.p: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
i = C("i")
f = D("f")
k = E("k")
m = F("m")
g = G("g")
j = H("j")
b = I("b")
n = J("n")

a.w = b
a.v = i
a.u = i
a.r = g
h.u = m
h.y = a
h.w = i
h.x = i
h.r = k
h.v = k
h.q = g
h.o = f
h.p = b
i.q = n
i.x = b
f.q = m
k.w = i
m.t = n
g.v = m
j.o = h
j.p = i
b.u = f
b.q = k
b.x = k
b.w = n
n.x = m
n.o = m
n.r = m
n.t = g
n.v = b
n.y = k
assert g.v.t.y.w.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: C = None
        self.r: G = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: A = None
        self.w: C = None
        self.r: E = None
        self.q: G = None
        self.v: E = None
        self.x: C = None
        self.o: D = None
        self.p: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

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

a = A("a")
h = B("h")
i = C("i")
f = D("f")
k = E("k")
m = F("m")
g = G("g")
j = H("j")
b = I("b")
n = J("n")

a.w = b
a.v = i
a.u = i
a.r = g
h.u = m
h.y = a
h.w = i
h.x = i
h.r = k
h.v = k
h.q = g
h.o = f
h.p = b
i.q = n
i.x = b
f.q = m
k.w = i
m.t = n
g.v = m
j.o = h
j.p = i
b.u = f
b.q = k
b.x = k
b.w = n
n.x = m
n.o = m
n.r = m
n.t = g
n.v = b
n.y = k
assert g.v.t.y.w.q.y.txt == "k"