class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.o: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: J = None
        self.p: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: D = None
        self.o: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.v: D = None
        self.txt = txt

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

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

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

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