class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.z: G = None
        self.q: H = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: B = None
        self.o: C = None
        self.s: E = None
        self.u: I = None
        self.r: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: A = None
        self.q: G = None
        self.w: E = None
        self.y: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: J = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: B = None
        self.o: C = None
        self.s: E = None
        self.u: I = None
        self.r: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: D = None
        self.w: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.s: A = None
        self.q: G = None
        self.w: E = None
        self.y: G = None
        self.txt = txt

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

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