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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: D = None
        self.o: H = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.s: A = None
        self.x: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: D = None
        self.o: H = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: B = None
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: A = None
        self.s: A = None
        self.x: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: B = None
        self.txt = txt

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

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