class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: J = None
        self.r: A = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: J = None
        self.u: B = None
        self.s: J = None
        self.y: D = None
        self.t: A = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: H = None
        self.u: E = None
        self.v: B = None
        self.y: J = None
        self.w: I = None
        self.r: F = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.r: D = None
        self.x: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: I = None
        self.x: J = None
        self.r: A = None
        self.p: G = None
        self.t: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: J = None
        self.u: B = None
        self.s: J = None
        self.y: D = None
        self.t: A = None
        self.q: I = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: H = None
        self.u: E = None
        self.v: B = None
        self.y: J = None
        self.w: I = None
        self.r: F = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: A = None
        self.r: D = None
        self.x: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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