class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: H = None
        self.w: F = None
        self.x: I = None
        self.u: H = None
        self.z: F = None
        self.s: D = None
        self.r: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: I = None
        self.s: D = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: J = None
        self.s: A = None
        self.q: J = None
        self.r: J = None
        self.o: E = None
        self.u: B = None
        self.t: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: G = None
        self.y: A = None
        self.p: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: J = None
        self.v: E = None
        self.q: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: I = None
        self.p: I = None
        self.z: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: I = None
        self.s: D = None
        self.w: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: J = None
        self.w: J = None
        self.s: A = None
        self.q: J = None
        self.r: J = None
        self.o: E = None
        self.u: B = None
        self.t: G = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.t: G = None
        self.y: A = None
        self.p: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: D = None
        self.q: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: J = None
        self.v: E = None
        self.q: J = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: I = None
        self.p: I = None
        self.z: H = None
        self.txt = txt

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

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