class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: E = None
        self.o: J = None
        self.r: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: H = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.w: H = None
        self.p: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.w: B = None
        self.t: G = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: H = None
        self.x: G = None
        self.t: C = None
        self.o: E = None
        self.w: C = None
        self.v: H = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: J = None
        self.p: I = None
        self.s: H = None
        self.x: F = None
        self.q: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: H = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.w: H = None
        self.p: B = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: B = None
        self.w: B = None
        self.t: G = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: H = None
        self.x: G = None
        self.t: C = None
        self.o: E = None
        self.w: C = None
        self.v: H = None
        self.p: E = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: J = None
        self.p: I = None
        self.s: H = None
        self.x: F = None
        self.q: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: B = None
        self.r: B = None
        self.x: C = None
        self.txt = txt

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

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