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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: A = None
        self.s: H = None
        self.p: C = None
        self.x: C = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: H = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: A = None
        self.o: B = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: J = None
        self.t: E = None
        self.u: F = None
        self.v: J = None
        self.w: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: I = None
        self.y: I = None
        self.txt = txt

h = A("h")
j = B("j")
m = C("m")
d = D("d")
i = E("i")
n = F("n")
e = G("e")
g = H("g")
c = I("c")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.y: A = None
        self.s: H = None
        self.p: C = None
        self.x: C = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: H = None
        self.r: D = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: A = None
        self.o: B = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: J = None
        self.t: E = None
        self.u: F = None
        self.v: J = None
        self.w: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: I = None
        self.y: I = None
        self.txt = txt

h = A("h")
j = B("j")
m = C("m")
d = D("d")
i = E("i")
n = F("n")
e = G("e")
g = H("g")
c = I("c")
f = J("f")

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