class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: I = None
        self.x: C = None
        self.u: B = None
        self.v: B = None
        self.t: C = None
        self.o: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.t: G = None
        self.u: B = None
        self.z: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: B = None
        self.t: G = None
        self.u: B = None
        self.z: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: C = None
        self.txt = txt

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

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

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