class A:
    def __init__(self, txt: str):
        self.u: J = None
        self.x: B = None
        self.p: E = None
        self.w: C = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: F = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.o: H = None
        self.p: F = None
        self.s: B = None
        self.v: H = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: J = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.r: C = None
        self.v: E = None
        self.x: E = None
        self.t: D = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: D = None
        self.t: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.z: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: F = None
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: B = None
        self.o: H = None
        self.p: F = None
        self.s: B = None
        self.v: H = None
        self.q: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: J = None
        self.r: J = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.p: E = None
        self.r: C = None
        self.v: E = None
        self.x: E = None
        self.t: D = None
        self.u: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.z: D = None
        self.t: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.z: J = None
        self.txt = txt

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

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

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