class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: J = None
        self.z: E = None
        self.y: D = None
        self.t: F = None
        self.w: F = None
        self.x: E = None
        self.r: D = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.s: I = None
        self.q: E = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.v: G = None
        self.x: A = None
        self.t: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: J = None
        self.q: D = None
        self.v: J = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: F = None
        self.s: I = None
        self.q: E = None
        self.z: G = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.v: G = None
        self.x: A = None
        self.t: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: J = None
        self.q: D = None
        self.v: J = None
        self.t: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

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