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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.p: I = None
        self.u: C = None
        self.v: H = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: G = None
        self.q: J = None
        self.w: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: A = None
        self.v: G = None
        self.w: F = None
        self.x: J = None
        self.u: C = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: D = None
        self.v: A = None
        self.s: D = None
        self.t: I = None
        self.o: B = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: I = None
        self.s: E = None
        self.t: D = None
        self.x: B = None
        self.v: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: E = None
        self.p: I = None
        self.u: C = None
        self.v: H = None
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: G = None
        self.q: J = None
        self.w: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: A = None
        self.v: G = None
        self.w: F = None
        self.x: J = None
        self.u: C = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: D = None
        self.v: A = None
        self.s: D = None
        self.t: I = None
        self.o: B = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: I = None
        self.s: E = None
        self.t: D = None
        self.x: B = None
        self.v: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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