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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: A = None
        self.o: H = None
        self.x: D = None
        self.z: G = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: I = None
        self.p: E = None
        self.x: B = None
        self.u: J = None
        self.t: J = None
        self.y: B = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: F = None
        self.x: E = None
        self.o: J = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.r: D = None
        self.w: D = None
        self.p: E = None
        self.u: E = None
        self.v: C = None
        self.z: F = None
        self.t: H = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: A = None
        self.o: H = None
        self.x: D = None
        self.z: G = None
        self.s: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: I = None
        self.p: E = None
        self.x: B = None
        self.u: J = None
        self.t: J = None
        self.y: B = None
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: F = None
        self.x: E = None
        self.o: J = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: A = None
        self.r: D = None
        self.w: D = None
        self.p: E = None
        self.u: E = None
        self.v: C = None
        self.z: F = None
        self.t: H = None
        self.o: G = None
        self.txt = txt

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

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

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