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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: H = None
        self.p: A = None
        self.s: F = None
        self.z: G = None
        self.u: E = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: F = None
        self.x: G = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: J = None
        self.r: I = None
        self.p: A = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: J = None
        self.y: G = None
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: D = None
        self.y: A = None
        self.z: H = None
        self.t: C = None
        self.o: F = None
        self.x: G = None
        self.txt = txt

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

a = A("a")
c = B("c")
l = C("l")
g = D("g")
h = E("h")
k = F("k")
e = G("e")
d = H("d")
f = I("f")
n = J("n")

a.x = d
a.p = d
a.o = g
a.s = g
a.y = k
a.u = c
c.w = a
l.y = c
l.x = d
l.p = a
l.s = k
l.z = e
l.q = e
l.u = h
g.v = d
g.r = h
h.t = c
h.q = c
h.w = k
h.x = e
k.w = g
e.o = h
e.t = h
e.s = n
e.r = f
e.p = a
e.x = a
d.u = h
d.o = n
d.y = e
d.r = l
f.p = k
f.o = k
f.v = g
f.y = a
f.z = d
f.t = l
f.x = e
n.z = h
n.t = h
n.x = f
n.v = f
n.s = f
n.w = c
n.r = g
n.o = k
n.y = e
n.q = e
assert d.r.p.u.w.o.v.y.p.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.p: H = None
        self.y: F = None
        self.s: D = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: H = None
        self.p: A = None
        self.s: F = None
        self.z: G = None
        self.u: E = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.w: F = None
        self.x: G = None
        self.q: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: J = None
        self.r: I = None
        self.p: A = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: J = None
        self.y: G = None
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: D = None
        self.y: A = None
        self.z: H = None
        self.t: C = None
        self.o: F = None
        self.x: G = None
        self.txt = txt

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

a = A("a")
c = B("c")
l = C("l")
g = D("g")
h = E("h")
k = F("k")
e = G("e")
d = H("d")
f = I("f")
n = J("n")

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