class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: H = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: F = None
        self.o: I = None
        self.x: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: F = None
        self.o: F = None
        self.p: E = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: F = None
        self.o: I = None
        self.x: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: F = None
        self.o: F = None
        self.p: E = None
        self.w: C = None
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: A = None
        self.txt = txt

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

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