class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: H = None
        self.x: H = None
        self.p: B = None
        self.z: G = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.y: B = None
        self.z: J = None
        self.q: H = None
        self.p: H = None
        self.r: F = None
        self.t: J = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: F = None
        self.y: B = None
        self.z: J = None
        self.q: H = None
        self.p: H = None
        self.r: F = None
        self.t: J = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: C = None
        self.q: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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