class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: I = None
        self.u: I = None
        self.y: J = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.z: E = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: F = None
        self.u: H = None
        self.v: F = None
        self.s: B = None
        self.x: B = None
        self.y: H = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.z: E = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: F = None
        self.u: H = None
        self.v: F = None
        self.s: B = None
        self.x: B = None
        self.y: H = None
        self.w: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

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

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