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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.w: J = None
        self.r: D = None
        self.q: J = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: D = None
        self.w: H = None
        self.p: I = None
        self.y: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.s: F = None
        self.y: B = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.o: D = None
        self.x: I = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.w: J = None
        self.r: D = None
        self.q: J = None
        self.u: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.q: D = None
        self.w: H = None
        self.p: I = None
        self.y: F = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.s: F = None
        self.y: B = None
        self.o: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.o: D = None
        self.x: I = None
        self.txt = txt

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

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