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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.r: E = None
        self.p: C = None
        self.z: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: J = None
        self.x: C = None
        self.y: H = None
        self.t: J = None
        self.w: C = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: H = None
        self.v: F = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: C = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: H = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.r: E = None
        self.p: C = None
        self.z: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: J = None
        self.p: J = None
        self.x: C = None
        self.y: H = None
        self.t: J = None
        self.w: C = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: H = None
        self.v: F = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.v: C = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: H = None
        self.s: B = None
        self.x: C = None
        self.txt = txt

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

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