class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: H = None
        self.y: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: H = None
        self.y: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: H = None
        self.w: F = None
        self.txt = txt

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

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