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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: I = None
        self.p: F = None
        self.v: A = None
        self.z: D = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: I = None
        self.p: F = None
        self.v: A = None
        self.z: D = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.txt = txt

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

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