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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.txt = txt

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

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

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

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