class A:
    def __init__(self, txt: str):
        self.w: J = None
        self.r: B = None
        self.z: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: G = None
        self.r: I = None
        self.v: A = None
        self.s: F = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: A = None
        self.u: J = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.w: A = None
        self.y: D = None
        self.p: F = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: G = None
        self.r: I = None
        self.v: A = None
        self.s: F = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: A = None
        self.u: J = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: F = None
        self.w: A = None
        self.y: D = None
        self.p: F = None
        self.v: C = None
        self.t: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: I = None
        self.txt = txt

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

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

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

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