class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: I = None
        self.z: H = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: F = None
        self.t: J = None
        self.o: F = None
        self.x: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: I = None
        self.u: J = None
        self.t: F = None
        self.z: B = None
        self.r: I = None
        self.x: J = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: J = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.v: H = None
        self.w: B = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: J = None
        self.y: D = None
        self.o: H = None
        self.w: J = None
        self.u: H = None
        self.x: F = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: D = None
        self.y: B = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.v: F = None
        self.t: J = None
        self.o: F = None
        self.x: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: I = None
        self.u: J = None
        self.t: F = None
        self.z: B = None
        self.r: I = None
        self.x: J = None
        self.v: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: J = None
        self.x: C = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.v: H = None
        self.w: B = None
        self.u: D = None
        self.s: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: J = None
        self.r: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: J = None
        self.y: D = None
        self.o: H = None
        self.w: J = None
        self.u: H = None
        self.x: F = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: D = None
        self.y: B = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

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