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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.v: F = None
        self.t: G = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.v: B = None
        self.r: C = None
        self.p: F = None
        self.w: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: E = None
        self.v: F = None
        self.t: G = None
        self.q: A = None
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: D = None
        self.v: B = None
        self.r: C = None
        self.p: F = None
        self.w: E = None
        self.txt = txt

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

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