class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.y: I = None
        self.r: I = None
        self.z: I = None
        self.x: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: I = None
        self.w: H = None
        self.u: H = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: H = None
        self.q: B = None
        self.x: G = None
        self.t: A = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: H = None
        self.z: D = None
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.x: E = None
        self.s: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: I = None
        self.w: H = None
        self.u: H = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: H = None
        self.q: B = None
        self.x: G = None
        self.t: A = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: H = None
        self.z: D = None
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: D = None
        self.x: E = None
        self.s: A = None
        self.txt = txt

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

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