class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: J = None
        self.z: H = None
        self.v: B = None
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.q: D = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: H = None
        self.z: E = None
        self.o: J = None
        self.y: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: J = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: H = None
        self.t: I = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
e = C("e")
i = D("i")
m = E("m")
b = F("b")
h = G("h")
c = H("c")
f = I("f")
n = J("n")

g.o = l
g.v = l
g.w = n
g.z = c
g.q = f
l.u = i
l.q = i
l.o = e
l.w = e
l.x = h
e.s = b
e.y = b
e.x = c
e.z = m
e.r = m
e.o = n
i.p = l
i.v = n
i.z = b
i.w = b
m.u = g
m.w = n
m.y = i
b.v = m
b.u = c
b.t = f
h.x = f
h.o = f
h.v = c
h.q = e
h.s = g
h.z = m
h.w = m
c.y = l
c.u = l
c.z = l
c.q = e
c.p = e
c.w = i
c.v = b
c.x = n
c.s = n
f.y = g
f.r = i
f.v = i
f.t = b
f.s = m
f.u = n
f.x = n
n.o = e
n.q = m
assert b.u.w.v.q.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: J = None
        self.z: H = None
        self.v: B = None
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: C = None
        self.q: D = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: H = None
        self.z: E = None
        self.o: J = None
        self.y: F = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: J = None
        self.z: F = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: H = None
        self.t: I = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
e = C("e")
i = D("i")
m = E("m")
b = F("b")
h = G("h")
c = H("c")
f = I("f")
n = J("n")

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